// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
(function(global, factory) { /* global define, require, module */

    /* AMD */ if (typeof define === 'function' && define.amd)
        define(["protobufjs/minimal"], factory);

    /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
        module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal);

})(this, function($protobuf) {
    "use strict";

    // Common aliases
    var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
    
    // Exported root namespace
    var $root = $protobuf.roots._google_ai_generativelanguage_protos || ($protobuf.roots._google_ai_generativelanguage_protos = {});
    
    $root.google = (function() {
    
        /**
         * Namespace google.
         * @exports google
         * @namespace
         */
        var google = {};
    
        google.ai = (function() {
    
            /**
             * Namespace ai.
             * @memberof google
             * @namespace
             */
            var ai = {};
    
            ai.generativelanguage = (function() {
    
                /**
                 * Namespace generativelanguage.
                 * @memberof google.ai
                 * @namespace
                 */
                var generativelanguage = {};
    
                generativelanguage.v1 = (function() {
    
                    /**
                     * Namespace v1.
                     * @memberof google.ai.generativelanguage
                     * @namespace
                     */
                    var v1 = {};
    
                    v1.CitationMetadata = (function() {
    
                        /**
                         * Properties of a CitationMetadata.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface ICitationMetadata
                         * @property {Array.<google.ai.generativelanguage.v1.ICitationSource>|null} [citationSources] CitationMetadata citationSources
                         */
    
                        /**
                         * Constructs a new CitationMetadata.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a CitationMetadata.
                         * @implements ICitationMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.ICitationMetadata=} [properties] Properties to set
                         */
                        function CitationMetadata(properties) {
                            this.citationSources = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CitationMetadata citationSources.
                         * @member {Array.<google.ai.generativelanguage.v1.ICitationSource>} citationSources
                         * @memberof google.ai.generativelanguage.v1.CitationMetadata
                         * @instance
                         */
                        CitationMetadata.prototype.citationSources = $util.emptyArray;
    
                        /**
                         * Creates a new CitationMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICitationMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.CitationMetadata} CitationMetadata instance
                         */
                        CitationMetadata.create = function create(properties) {
                            return new CitationMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1.CitationMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICitationMetadata} message CitationMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.citationSources != null && message.citationSources.length)
                                for (var i = 0; i < message.citationSources.length; ++i)
                                    $root.google.ai.generativelanguage.v1.CitationSource.encode(message.citationSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.CitationMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICitationMetadata} message CitationMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CitationMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.CitationMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.CitationMetadata} CitationMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.CitationMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.citationSources && message.citationSources.length))
                                            message.citationSources = [];
                                        message.citationSources.push($root.google.ai.generativelanguage.v1.CitationSource.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CitationMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.CitationMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.CitationMetadata} CitationMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CitationMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.CitationMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CitationMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.citationSources != null && message.hasOwnProperty("citationSources")) {
                                if (!Array.isArray(message.citationSources))
                                    return "citationSources: array expected";
                                for (var i = 0; i < message.citationSources.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.CitationSource.verify(message.citationSources[i]);
                                    if (error)
                                        return "citationSources." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CitationMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.CitationMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.CitationMetadata} CitationMetadata
                         */
                        CitationMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.CitationMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.CitationMetadata();
                            if (object.citationSources) {
                                if (!Array.isArray(object.citationSources))
                                    throw TypeError(".google.ai.generativelanguage.v1.CitationMetadata.citationSources: array expected");
                                message.citationSources = [];
                                for (var i = 0; i < object.citationSources.length; ++i) {
                                    if (typeof object.citationSources[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.CitationMetadata.citationSources: object expected");
                                    message.citationSources[i] = $root.google.ai.generativelanguage.v1.CitationSource.fromObject(object.citationSources[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CitationMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.CitationMetadata} message CitationMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CitationMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.citationSources = [];
                            if (message.citationSources && message.citationSources.length) {
                                object.citationSources = [];
                                for (var j = 0; j < message.citationSources.length; ++j)
                                    object.citationSources[j] = $root.google.ai.generativelanguage.v1.CitationSource.toObject(message.citationSources[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CitationMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.CitationMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CitationMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CitationMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.CitationMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CitationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.CitationMetadata";
                        };
    
                        return CitationMetadata;
                    })();
    
                    v1.CitationSource = (function() {
    
                        /**
                         * Properties of a CitationSource.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface ICitationSource
                         * @property {number|null} [startIndex] CitationSource startIndex
                         * @property {number|null} [endIndex] CitationSource endIndex
                         * @property {string|null} [uri] CitationSource uri
                         * @property {string|null} [license] CitationSource license
                         */
    
                        /**
                         * Constructs a new CitationSource.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a CitationSource.
                         * @implements ICitationSource
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.ICitationSource=} [properties] Properties to set
                         */
                        function CitationSource(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CitationSource startIndex.
                         * @member {number|null|undefined} startIndex
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.startIndex = null;
    
                        /**
                         * CitationSource endIndex.
                         * @member {number|null|undefined} endIndex
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.endIndex = null;
    
                        /**
                         * CitationSource uri.
                         * @member {string|null|undefined} uri
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.uri = null;
    
                        /**
                         * CitationSource license.
                         * @member {string|null|undefined} license
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.license = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CitationSource _startIndex.
                         * @member {"startIndex"|undefined} _startIndex
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_startIndex", {
                            get: $util.oneOfGetter($oneOfFields = ["startIndex"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _endIndex.
                         * @member {"endIndex"|undefined} _endIndex
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_endIndex", {
                            get: $util.oneOfGetter($oneOfFields = ["endIndex"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _uri.
                         * @member {"uri"|undefined} _uri
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_uri", {
                            get: $util.oneOfGetter($oneOfFields = ["uri"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _license.
                         * @member {"license"|undefined} _license
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_license", {
                            get: $util.oneOfGetter($oneOfFields = ["license"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CitationSource instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICitationSource=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.CitationSource} CitationSource instance
                         */
                        CitationSource.create = function create(properties) {
                            return new CitationSource(properties);
                        };
    
                        /**
                         * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1.CitationSource.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICitationSource} message CitationSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationSource.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startIndex);
                            if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endIndex);
                            if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri);
                            if (message.license != null && Object.hasOwnProperty.call(message, "license"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.license);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.CitationSource.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICitationSource} message CitationSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationSource.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CitationSource message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.CitationSource} CitationSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationSource.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.CitationSource();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.startIndex = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.endIndex = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.uri = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.license = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CitationSource message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.CitationSource} CitationSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationSource.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CitationSource message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CitationSource.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.startIndex != null && message.hasOwnProperty("startIndex")) {
                                properties._startIndex = 1;
                                if (!$util.isInteger(message.startIndex))
                                    return "startIndex: integer expected";
                            }
                            if (message.endIndex != null && message.hasOwnProperty("endIndex")) {
                                properties._endIndex = 1;
                                if (!$util.isInteger(message.endIndex))
                                    return "endIndex: integer expected";
                            }
                            if (message.uri != null && message.hasOwnProperty("uri")) {
                                properties._uri = 1;
                                if (!$util.isString(message.uri))
                                    return "uri: string expected";
                            }
                            if (message.license != null && message.hasOwnProperty("license")) {
                                properties._license = 1;
                                if (!$util.isString(message.license))
                                    return "license: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CitationSource message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.CitationSource} CitationSource
                         */
                        CitationSource.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.CitationSource)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.CitationSource();
                            if (object.startIndex != null)
                                message.startIndex = object.startIndex | 0;
                            if (object.endIndex != null)
                                message.endIndex = object.endIndex | 0;
                            if (object.uri != null)
                                message.uri = String(object.uri);
                            if (object.license != null)
                                message.license = String(object.license);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CitationSource message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1.CitationSource} message CitationSource
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CitationSource.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.startIndex != null && message.hasOwnProperty("startIndex")) {
                                object.startIndex = message.startIndex;
                                if (options.oneofs)
                                    object._startIndex = "startIndex";
                            }
                            if (message.endIndex != null && message.hasOwnProperty("endIndex")) {
                                object.endIndex = message.endIndex;
                                if (options.oneofs)
                                    object._endIndex = "endIndex";
                            }
                            if (message.uri != null && message.hasOwnProperty("uri")) {
                                object.uri = message.uri;
                                if (options.oneofs)
                                    object._uri = "uri";
                            }
                            if (message.license != null && message.hasOwnProperty("license")) {
                                object.license = message.license;
                                if (options.oneofs)
                                    object._license = "license";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CitationSource to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CitationSource.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CitationSource
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.CitationSource
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CitationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.CitationSource";
                        };
    
                        return CitationSource;
                    })();
    
                    v1.Content = (function() {
    
                        /**
                         * Properties of a Content.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IContent
                         * @property {Array.<google.ai.generativelanguage.v1.IPart>|null} [parts] Content parts
                         * @property {string|null} [role] Content role
                         */
    
                        /**
                         * Constructs a new Content.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a Content.
                         * @implements IContent
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IContent=} [properties] Properties to set
                         */
                        function Content(properties) {
                            this.parts = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Content parts.
                         * @member {Array.<google.ai.generativelanguage.v1.IPart>} parts
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @instance
                         */
                        Content.prototype.parts = $util.emptyArray;
    
                        /**
                         * Content role.
                         * @member {string} role
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @instance
                         */
                        Content.prototype.role = "";
    
                        /**
                         * Creates a new Content instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1.IContent=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.Content} Content instance
                         */
                        Content.create = function create(properties) {
                            return new Content(properties);
                        };
    
                        /**
                         * Encodes the specified Content message. Does not implicitly {@link google.ai.generativelanguage.v1.Content.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1.IContent} message Content message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Content.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parts != null && message.parts.length)
                                for (var i = 0; i < message.parts.length; ++i)
                                    $root.google.ai.generativelanguage.v1.Part.encode(message.parts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.role != null && Object.hasOwnProperty.call(message, "role"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.role);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Content message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.Content.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1.IContent} message Content message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Content.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Content message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.Content} Content
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Content.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.Content();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.parts && message.parts.length))
                                            message.parts = [];
                                        message.parts.push($root.google.ai.generativelanguage.v1.Part.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.role = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Content message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.Content} Content
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Content.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Content message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Content.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parts != null && message.hasOwnProperty("parts")) {
                                if (!Array.isArray(message.parts))
                                    return "parts: array expected";
                                for (var i = 0; i < message.parts.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.Part.verify(message.parts[i]);
                                    if (error)
                                        return "parts." + error;
                                }
                            }
                            if (message.role != null && message.hasOwnProperty("role"))
                                if (!$util.isString(message.role))
                                    return "role: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a Content message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.Content} Content
                         */
                        Content.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.Content)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.Content();
                            if (object.parts) {
                                if (!Array.isArray(object.parts))
                                    throw TypeError(".google.ai.generativelanguage.v1.Content.parts: array expected");
                                message.parts = [];
                                for (var i = 0; i < object.parts.length; ++i) {
                                    if (typeof object.parts[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.Content.parts: object expected");
                                    message.parts[i] = $root.google.ai.generativelanguage.v1.Part.fromObject(object.parts[i]);
                                }
                            }
                            if (object.role != null)
                                message.role = String(object.role);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Content message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1.Content} message Content
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Content.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.parts = [];
                            if (options.defaults)
                                object.role = "";
                            if (message.parts && message.parts.length) {
                                object.parts = [];
                                for (var j = 0; j < message.parts.length; ++j)
                                    object.parts[j] = $root.google.ai.generativelanguage.v1.Part.toObject(message.parts[j], options);
                            }
                            if (message.role != null && message.hasOwnProperty("role"))
                                object.role = message.role;
                            return object;
                        };
    
                        /**
                         * Converts this Content to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Content.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Content
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.Content
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Content.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.Content";
                        };
    
                        return Content;
                    })();
    
                    v1.Part = (function() {
    
                        /**
                         * Properties of a Part.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IPart
                         * @property {string|null} [text] Part text
                         * @property {google.ai.generativelanguage.v1.IBlob|null} [inlineData] Part inlineData
                         */
    
                        /**
                         * Constructs a new Part.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a Part.
                         * @implements IPart
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IPart=} [properties] Properties to set
                         */
                        function Part(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Part text.
                         * @member {string|null|undefined} text
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @instance
                         */
                        Part.prototype.text = null;
    
                        /**
                         * Part inlineData.
                         * @member {google.ai.generativelanguage.v1.IBlob|null|undefined} inlineData
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @instance
                         */
                        Part.prototype.inlineData = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Part data.
                         * @member {"text"|"inlineData"|undefined} data
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @instance
                         */
                        Object.defineProperty(Part.prototype, "data", {
                            get: $util.oneOfGetter($oneOfFields = ["text", "inlineData"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Part instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1.IPart=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.Part} Part instance
                         */
                        Part.create = function create(properties) {
                            return new Part(properties);
                        };
    
                        /**
                         * Encodes the specified Part message. Does not implicitly {@link google.ai.generativelanguage.v1.Part.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1.IPart} message Part message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Part.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.text);
                            if (message.inlineData != null && Object.hasOwnProperty.call(message, "inlineData"))
                                $root.google.ai.generativelanguage.v1.Blob.encode(message.inlineData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Part message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.Part.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1.IPart} message Part message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Part.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Part message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.Part} Part
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Part.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.Part();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.text = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.inlineData = $root.google.ai.generativelanguage.v1.Blob.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Part message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.Part} Part
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Part.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Part message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Part.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.text != null && message.hasOwnProperty("text")) {
                                properties.data = 1;
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            }
                            if (message.inlineData != null && message.hasOwnProperty("inlineData")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1.Blob.verify(message.inlineData);
                                    if (error)
                                        return "inlineData." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Part message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.Part} Part
                         */
                        Part.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.Part)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.Part();
                            if (object.text != null)
                                message.text = String(object.text);
                            if (object.inlineData != null) {
                                if (typeof object.inlineData !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.Part.inlineData: object expected");
                                message.inlineData = $root.google.ai.generativelanguage.v1.Blob.fromObject(object.inlineData);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Part message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1.Part} message Part
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Part.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.text != null && message.hasOwnProperty("text")) {
                                object.text = message.text;
                                if (options.oneofs)
                                    object.data = "text";
                            }
                            if (message.inlineData != null && message.hasOwnProperty("inlineData")) {
                                object.inlineData = $root.google.ai.generativelanguage.v1.Blob.toObject(message.inlineData, options);
                                if (options.oneofs)
                                    object.data = "inlineData";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Part to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Part.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Part
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.Part
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Part.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.Part";
                        };
    
                        return Part;
                    })();
    
                    v1.Blob = (function() {
    
                        /**
                         * Properties of a Blob.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IBlob
                         * @property {string|null} [mimeType] Blob mimeType
                         * @property {Uint8Array|null} [data] Blob data
                         */
    
                        /**
                         * Constructs a new Blob.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a Blob.
                         * @implements IBlob
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IBlob=} [properties] Properties to set
                         */
                        function Blob(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Blob mimeType.
                         * @member {string} mimeType
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @instance
                         */
                        Blob.prototype.mimeType = "";
    
                        /**
                         * Blob data.
                         * @member {Uint8Array} data
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @instance
                         */
                        Blob.prototype.data = $util.newBuffer([]);
    
                        /**
                         * Creates a new Blob instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1.IBlob=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.Blob} Blob instance
                         */
                        Blob.create = function create(properties) {
                            return new Blob(properties);
                        };
    
                        /**
                         * Encodes the specified Blob message. Does not implicitly {@link google.ai.generativelanguage.v1.Blob.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1.IBlob} message Blob message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Blob.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType);
                            if (message.data != null && Object.hasOwnProperty.call(message, "data"))
                                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.Blob.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1.IBlob} message Blob message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Blob.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Blob message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.Blob} Blob
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Blob.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.Blob();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.mimeType = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.data = reader.bytes();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Blob message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.Blob} Blob
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Blob.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Blob message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Blob.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                if (!$util.isString(message.mimeType))
                                    return "mimeType: string expected";
                            if (message.data != null && message.hasOwnProperty("data"))
                                if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data)))
                                    return "data: buffer expected";
                            return null;
                        };
    
                        /**
                         * Creates a Blob message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.Blob} Blob
                         */
                        Blob.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.Blob)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.Blob();
                            if (object.mimeType != null)
                                message.mimeType = String(object.mimeType);
                            if (object.data != null)
                                if (typeof object.data === "string")
                                    $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0);
                                else if (object.data.length >= 0)
                                    message.data = object.data;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Blob message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1.Blob} message Blob
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Blob.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.mimeType = "";
                                if (options.bytes === String)
                                    object.data = "";
                                else {
                                    object.data = [];
                                    if (options.bytes !== Array)
                                        object.data = $util.newBuffer(object.data);
                                }
                            }
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                object.mimeType = message.mimeType;
                            if (message.data != null && message.hasOwnProperty("data"))
                                object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data;
                            return object;
                        };
    
                        /**
                         * Converts this Blob to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Blob.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Blob
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.Blob
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Blob.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.Blob";
                        };
    
                        return Blob;
                    })();
    
                    v1.GenerativeService = (function() {
    
                        /**
                         * Constructs a new GenerativeService service.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a GenerativeService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function GenerativeService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (GenerativeService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GenerativeService;
    
                        /**
                         * Creates new GenerativeService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {GenerativeService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        GenerativeService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1.GenerativeService|generateContent}.
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @typedef GenerateContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1.GenerateContentResponse} [response] GenerateContentResponse
                         */
    
                        /**
                         * Calls GenerateContent.
                         * @function generateContent
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1.GenerativeService.GenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.generateContent = function generateContent(request, callback) {
                            return this.rpcCall(generateContent, $root.google.ai.generativelanguage.v1.GenerateContentRequest, $root.google.ai.generativelanguage.v1.GenerateContentResponse, request, callback);
                        }, "name", { value: "GenerateContent" });
    
                        /**
                         * Calls GenerateContent.
                         * @function generateContent
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1.GenerateContentResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1.GenerativeService|streamGenerateContent}.
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @typedef StreamGenerateContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1.GenerateContentResponse} [response] GenerateContentResponse
                         */
    
                        /**
                         * Calls StreamGenerateContent.
                         * @function streamGenerateContent
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1.GenerativeService.StreamGenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.streamGenerateContent = function streamGenerateContent(request, callback) {
                            return this.rpcCall(streamGenerateContent, $root.google.ai.generativelanguage.v1.GenerateContentRequest, $root.google.ai.generativelanguage.v1.GenerateContentResponse, request, callback);
                        }, "name", { value: "StreamGenerateContent" });
    
                        /**
                         * Calls StreamGenerateContent.
                         * @function streamGenerateContent
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1.GenerateContentResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1.GenerativeService|embedContent}.
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @typedef EmbedContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1.EmbedContentResponse} [response] EmbedContentResponse
                         */
    
                        /**
                         * Calls EmbedContent.
                         * @function embedContent
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IEmbedContentRequest} request EmbedContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1.GenerativeService.EmbedContentCallback} callback Node-style callback called with the error, if any, and EmbedContentResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.embedContent = function embedContent(request, callback) {
                            return this.rpcCall(embedContent, $root.google.ai.generativelanguage.v1.EmbedContentRequest, $root.google.ai.generativelanguage.v1.EmbedContentResponse, request, callback);
                        }, "name", { value: "EmbedContent" });
    
                        /**
                         * Calls EmbedContent.
                         * @function embedContent
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IEmbedContentRequest} request EmbedContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1.EmbedContentResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1.GenerativeService|batchEmbedContents}.
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @typedef BatchEmbedContentsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1.BatchEmbedContentsResponse} [response] BatchEmbedContentsResponse
                         */
    
                        /**
                         * Calls BatchEmbedContents.
                         * @function batchEmbedContents
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1.GenerativeService.BatchEmbedContentsCallback} callback Node-style callback called with the error, if any, and BatchEmbedContentsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.batchEmbedContents = function batchEmbedContents(request, callback) {
                            return this.rpcCall(batchEmbedContents, $root.google.ai.generativelanguage.v1.BatchEmbedContentsRequest, $root.google.ai.generativelanguage.v1.BatchEmbedContentsResponse, request, callback);
                        }, "name", { value: "BatchEmbedContents" });
    
                        /**
                         * Calls BatchEmbedContents.
                         * @function batchEmbedContents
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1.BatchEmbedContentsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1.GenerativeService|countTokens}.
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @typedef CountTokensCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1.CountTokensResponse} [response] CountTokensResponse
                         */
    
                        /**
                         * Calls CountTokens.
                         * @function countTokens
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.ICountTokensRequest} request CountTokensRequest message or plain object
                         * @param {google.ai.generativelanguage.v1.GenerativeService.CountTokensCallback} callback Node-style callback called with the error, if any, and CountTokensResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.countTokens = function countTokens(request, callback) {
                            return this.rpcCall(countTokens, $root.google.ai.generativelanguage.v1.CountTokensRequest, $root.google.ai.generativelanguage.v1.CountTokensResponse, request, callback);
                        }, "name", { value: "CountTokens" });
    
                        /**
                         * Calls CountTokens.
                         * @function countTokens
                         * @memberof google.ai.generativelanguage.v1.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.ICountTokensRequest} request CountTokensRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1.CountTokensResponse>} Promise
                         * @variation 2
                         */
    
                        return GenerativeService;
                    })();
    
                    /**
                     * TaskType enum.
                     * @name google.ai.generativelanguage.v1.TaskType
                     * @enum {number}
                     * @property {number} TASK_TYPE_UNSPECIFIED=0 TASK_TYPE_UNSPECIFIED value
                     * @property {number} RETRIEVAL_QUERY=1 RETRIEVAL_QUERY value
                     * @property {number} RETRIEVAL_DOCUMENT=2 RETRIEVAL_DOCUMENT value
                     * @property {number} SEMANTIC_SIMILARITY=3 SEMANTIC_SIMILARITY value
                     * @property {number} CLASSIFICATION=4 CLASSIFICATION value
                     * @property {number} CLUSTERING=5 CLUSTERING value
                     * @property {number} QUESTION_ANSWERING=6 QUESTION_ANSWERING value
                     * @property {number} FACT_VERIFICATION=7 FACT_VERIFICATION value
                     */
                    v1.TaskType = (function() {
                        var valuesById = {}, values = Object.create(valuesById);
                        values[valuesById[0] = "TASK_TYPE_UNSPECIFIED"] = 0;
                        values[valuesById[1] = "RETRIEVAL_QUERY"] = 1;
                        values[valuesById[2] = "RETRIEVAL_DOCUMENT"] = 2;
                        values[valuesById[3] = "SEMANTIC_SIMILARITY"] = 3;
                        values[valuesById[4] = "CLASSIFICATION"] = 4;
                        values[valuesById[5] = "CLUSTERING"] = 5;
                        values[valuesById[6] = "QUESTION_ANSWERING"] = 6;
                        values[valuesById[7] = "FACT_VERIFICATION"] = 7;
                        return values;
                    })();
    
                    v1.GenerateContentRequest = (function() {
    
                        /**
                         * Properties of a GenerateContentRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IGenerateContentRequest
                         * @property {string|null} [model] GenerateContentRequest model
                         * @property {Array.<google.ai.generativelanguage.v1.IContent>|null} [contents] GenerateContentRequest contents
                         * @property {Array.<google.ai.generativelanguage.v1.ISafetySetting>|null} [safetySettings] GenerateContentRequest safetySettings
                         * @property {google.ai.generativelanguage.v1.IGenerationConfig|null} [generationConfig] GenerateContentRequest generationConfig
                         */
    
                        /**
                         * Constructs a new GenerateContentRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a GenerateContentRequest.
                         * @implements IGenerateContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IGenerateContentRequest=} [properties] Properties to set
                         */
                        function GenerateContentRequest(properties) {
                            this.contents = [];
                            this.safetySettings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateContentRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.model = "";
    
                        /**
                         * GenerateContentRequest contents.
                         * @member {Array.<google.ai.generativelanguage.v1.IContent>} contents
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.contents = $util.emptyArray;
    
                        /**
                         * GenerateContentRequest safetySettings.
                         * @member {Array.<google.ai.generativelanguage.v1.ISafetySetting>} safetySettings
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.safetySettings = $util.emptyArray;
    
                        /**
                         * GenerateContentRequest generationConfig.
                         * @member {google.ai.generativelanguage.v1.IGenerationConfig|null|undefined} generationConfig
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.generationConfig = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateContentRequest _generationConfig.
                         * @member {"generationConfig"|undefined} _generationConfig
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateContentRequest.prototype, "_generationConfig", {
                            get: $util.oneOfGetter($oneOfFields = ["generationConfig"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGenerateContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.GenerateContentRequest} GenerateContentRequest instance
                         */
                        GenerateContentRequest.create = function create(properties) {
                            return new GenerateContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1.GenerateContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.contents != null && message.contents.length)
                                for (var i = 0; i < message.contents.length; ++i)
                                    $root.google.ai.generativelanguage.v1.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.safetySettings != null && message.safetySettings.length)
                                for (var i = 0; i < message.safetySettings.length; ++i)
                                    $root.google.ai.generativelanguage.v1.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.generationConfig != null && Object.hasOwnProperty.call(message, "generationConfig"))
                                $root.google.ai.generativelanguage.v1.GenerationConfig.encode(message.generationConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.GenerateContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.GenerateContentRequest} GenerateContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.GenerateContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.contents && message.contents.length))
                                            message.contents = [];
                                        message.contents.push($root.google.ai.generativelanguage.v1.Content.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.safetySettings && message.safetySettings.length))
                                            message.safetySettings = [];
                                        message.safetySettings.push($root.google.ai.generativelanguage.v1.SafetySetting.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.generationConfig = $root.google.ai.generativelanguage.v1.GenerationConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.GenerateContentRequest} GenerateContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.contents != null && message.hasOwnProperty("contents")) {
                                if (!Array.isArray(message.contents))
                                    return "contents: array expected";
                                for (var i = 0; i < message.contents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.Content.verify(message.contents[i]);
                                    if (error)
                                        return "contents." + error;
                                }
                            }
                            if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) {
                                if (!Array.isArray(message.safetySettings))
                                    return "safetySettings: array expected";
                                for (var i = 0; i < message.safetySettings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.SafetySetting.verify(message.safetySettings[i]);
                                    if (error)
                                        return "safetySettings." + error;
                                }
                            }
                            if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) {
                                properties._generationConfig = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1.GenerationConfig.verify(message.generationConfig);
                                    if (error)
                                        return "generationConfig." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.GenerateContentRequest} GenerateContentRequest
                         */
                        GenerateContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.GenerateContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.GenerateContentRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.contents) {
                                if (!Array.isArray(object.contents))
                                    throw TypeError(".google.ai.generativelanguage.v1.GenerateContentRequest.contents: array expected");
                                message.contents = [];
                                for (var i = 0; i < object.contents.length; ++i) {
                                    if (typeof object.contents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.GenerateContentRequest.contents: object expected");
                                    message.contents[i] = $root.google.ai.generativelanguage.v1.Content.fromObject(object.contents[i]);
                                }
                            }
                            if (object.safetySettings) {
                                if (!Array.isArray(object.safetySettings))
                                    throw TypeError(".google.ai.generativelanguage.v1.GenerateContentRequest.safetySettings: array expected");
                                message.safetySettings = [];
                                for (var i = 0; i < object.safetySettings.length; ++i) {
                                    if (typeof object.safetySettings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.GenerateContentRequest.safetySettings: object expected");
                                    message.safetySettings[i] = $root.google.ai.generativelanguage.v1.SafetySetting.fromObject(object.safetySettings[i]);
                                }
                            }
                            if (object.generationConfig != null) {
                                if (typeof object.generationConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.GenerateContentRequest.generationConfig: object expected");
                                message.generationConfig = $root.google.ai.generativelanguage.v1.GenerationConfig.fromObject(object.generationConfig);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.GenerateContentRequest} message GenerateContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.contents = [];
                                object.safetySettings = [];
                            }
                            if (options.defaults)
                                object.model = "";
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.contents && message.contents.length) {
                                object.contents = [];
                                for (var j = 0; j < message.contents.length; ++j)
                                    object.contents[j] = $root.google.ai.generativelanguage.v1.Content.toObject(message.contents[j], options);
                            }
                            if (message.safetySettings && message.safetySettings.length) {
                                object.safetySettings = [];
                                for (var j = 0; j < message.safetySettings.length; ++j)
                                    object.safetySettings[j] = $root.google.ai.generativelanguage.v1.SafetySetting.toObject(message.safetySettings[j], options);
                            }
                            if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) {
                                object.generationConfig = $root.google.ai.generativelanguage.v1.GenerationConfig.toObject(message.generationConfig, options);
                                if (options.oneofs)
                                    object._generationConfig = "generationConfig";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.GenerateContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.GenerateContentRequest";
                        };
    
                        return GenerateContentRequest;
                    })();
    
                    v1.GenerationConfig = (function() {
    
                        /**
                         * Properties of a GenerationConfig.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IGenerationConfig
                         * @property {number|null} [candidateCount] GenerationConfig candidateCount
                         * @property {Array.<string>|null} [stopSequences] GenerationConfig stopSequences
                         * @property {number|null} [maxOutputTokens] GenerationConfig maxOutputTokens
                         * @property {number|null} [temperature] GenerationConfig temperature
                         * @property {number|null} [topP] GenerationConfig topP
                         * @property {number|null} [topK] GenerationConfig topK
                         * @property {number|null} [presencePenalty] GenerationConfig presencePenalty
                         * @property {number|null} [frequencyPenalty] GenerationConfig frequencyPenalty
                         * @property {boolean|null} [responseLogprobs] GenerationConfig responseLogprobs
                         * @property {number|null} [logprobs] GenerationConfig logprobs
                         * @property {boolean|null} [enableEnhancedCivicAnswers] GenerationConfig enableEnhancedCivicAnswers
                         */
    
                        /**
                         * Constructs a new GenerationConfig.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a GenerationConfig.
                         * @implements IGenerationConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IGenerationConfig=} [properties] Properties to set
                         */
                        function GenerationConfig(properties) {
                            this.stopSequences = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerationConfig candidateCount.
                         * @member {number|null|undefined} candidateCount
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.candidateCount = null;
    
                        /**
                         * GenerationConfig stopSequences.
                         * @member {Array.<string>} stopSequences
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.stopSequences = $util.emptyArray;
    
                        /**
                         * GenerationConfig maxOutputTokens.
                         * @member {number|null|undefined} maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.maxOutputTokens = null;
    
                        /**
                         * GenerationConfig temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.temperature = null;
    
                        /**
                         * GenerationConfig topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.topP = null;
    
                        /**
                         * GenerationConfig topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.topK = null;
    
                        /**
                         * GenerationConfig presencePenalty.
                         * @member {number|null|undefined} presencePenalty
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.presencePenalty = null;
    
                        /**
                         * GenerationConfig frequencyPenalty.
                         * @member {number|null|undefined} frequencyPenalty
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.frequencyPenalty = null;
    
                        /**
                         * GenerationConfig responseLogprobs.
                         * @member {boolean|null|undefined} responseLogprobs
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.responseLogprobs = null;
    
                        /**
                         * GenerationConfig logprobs.
                         * @member {number|null|undefined} logprobs
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.logprobs = null;
    
                        /**
                         * GenerationConfig enableEnhancedCivicAnswers.
                         * @member {boolean|null|undefined} enableEnhancedCivicAnswers
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.enableEnhancedCivicAnswers = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerationConfig _candidateCount.
                         * @member {"candidateCount"|undefined} _candidateCount
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_candidateCount", {
                            get: $util.oneOfGetter($oneOfFields = ["candidateCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _maxOutputTokens.
                         * @member {"maxOutputTokens"|undefined} _maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_maxOutputTokens", {
                            get: $util.oneOfGetter($oneOfFields = ["maxOutputTokens"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _presencePenalty.
                         * @member {"presencePenalty"|undefined} _presencePenalty
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_presencePenalty", {
                            get: $util.oneOfGetter($oneOfFields = ["presencePenalty"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _frequencyPenalty.
                         * @member {"frequencyPenalty"|undefined} _frequencyPenalty
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_frequencyPenalty", {
                            get: $util.oneOfGetter($oneOfFields = ["frequencyPenalty"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _responseLogprobs.
                         * @member {"responseLogprobs"|undefined} _responseLogprobs
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_responseLogprobs", {
                            get: $util.oneOfGetter($oneOfFields = ["responseLogprobs"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _logprobs.
                         * @member {"logprobs"|undefined} _logprobs
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_logprobs", {
                            get: $util.oneOfGetter($oneOfFields = ["logprobs"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _enableEnhancedCivicAnswers.
                         * @member {"enableEnhancedCivicAnswers"|undefined} _enableEnhancedCivicAnswers
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_enableEnhancedCivicAnswers", {
                            get: $util.oneOfGetter($oneOfFields = ["enableEnhancedCivicAnswers"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerationConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGenerationConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.GenerationConfig} GenerationConfig instance
                         */
                        GenerationConfig.create = function create(properties) {
                            return new GenerationConfig(properties);
                        };
    
                        /**
                         * Encodes the specified GenerationConfig message. Does not implicitly {@link google.ai.generativelanguage.v1.GenerationConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGenerationConfig} message GenerationConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerationConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.candidateCount);
                            if (message.stopSequences != null && message.stopSequences.length)
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.stopSequences[i]);
                            if (message.maxOutputTokens != null && Object.hasOwnProperty.call(message, "maxOutputTokens"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxOutputTokens);
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 5, wireType 5 =*/45).float(message.temperature);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 6, wireType 5 =*/53).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.topK);
                            if (message.presencePenalty != null && Object.hasOwnProperty.call(message, "presencePenalty"))
                                writer.uint32(/* id 15, wireType 5 =*/125).float(message.presencePenalty);
                            if (message.frequencyPenalty != null && Object.hasOwnProperty.call(message, "frequencyPenalty"))
                                writer.uint32(/* id 16, wireType 5 =*/133).float(message.frequencyPenalty);
                            if (message.responseLogprobs != null && Object.hasOwnProperty.call(message, "responseLogprobs"))
                                writer.uint32(/* id 17, wireType 0 =*/136).bool(message.responseLogprobs);
                            if (message.logprobs != null && Object.hasOwnProperty.call(message, "logprobs"))
                                writer.uint32(/* id 18, wireType 0 =*/144).int32(message.logprobs);
                            if (message.enableEnhancedCivicAnswers != null && Object.hasOwnProperty.call(message, "enableEnhancedCivicAnswers"))
                                writer.uint32(/* id 19, wireType 0 =*/152).bool(message.enableEnhancedCivicAnswers);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerationConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.GenerationConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGenerationConfig} message GenerationConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerationConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerationConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.GenerationConfig} GenerationConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerationConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.GenerationConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.candidateCount = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.stopSequences && message.stopSequences.length))
                                            message.stopSequences = [];
                                        message.stopSequences.push(reader.string());
                                        break;
                                    }
                                case 4: {
                                        message.maxOutputTokens = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 6: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 7: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                case 15: {
                                        message.presencePenalty = reader.float();
                                        break;
                                    }
                                case 16: {
                                        message.frequencyPenalty = reader.float();
                                        break;
                                    }
                                case 17: {
                                        message.responseLogprobs = reader.bool();
                                        break;
                                    }
                                case 18: {
                                        message.logprobs = reader.int32();
                                        break;
                                    }
                                case 19: {
                                        message.enableEnhancedCivicAnswers = reader.bool();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerationConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.GenerationConfig} GenerationConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerationConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerationConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerationConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                properties._candidateCount = 1;
                                if (!$util.isInteger(message.candidateCount))
                                    return "candidateCount: integer expected";
                            }
                            if (message.stopSequences != null && message.hasOwnProperty("stopSequences")) {
                                if (!Array.isArray(message.stopSequences))
                                    return "stopSequences: array expected";
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    if (!$util.isString(message.stopSequences[i]))
                                        return "stopSequences: string[] expected";
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                properties._maxOutputTokens = 1;
                                if (!$util.isInteger(message.maxOutputTokens))
                                    return "maxOutputTokens: integer expected";
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            if (message.presencePenalty != null && message.hasOwnProperty("presencePenalty")) {
                                properties._presencePenalty = 1;
                                if (typeof message.presencePenalty !== "number")
                                    return "presencePenalty: number expected";
                            }
                            if (message.frequencyPenalty != null && message.hasOwnProperty("frequencyPenalty")) {
                                properties._frequencyPenalty = 1;
                                if (typeof message.frequencyPenalty !== "number")
                                    return "frequencyPenalty: number expected";
                            }
                            if (message.responseLogprobs != null && message.hasOwnProperty("responseLogprobs")) {
                                properties._responseLogprobs = 1;
                                if (typeof message.responseLogprobs !== "boolean")
                                    return "responseLogprobs: boolean expected";
                            }
                            if (message.logprobs != null && message.hasOwnProperty("logprobs")) {
                                properties._logprobs = 1;
                                if (!$util.isInteger(message.logprobs))
                                    return "logprobs: integer expected";
                            }
                            if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) {
                                properties._enableEnhancedCivicAnswers = 1;
                                if (typeof message.enableEnhancedCivicAnswers !== "boolean")
                                    return "enableEnhancedCivicAnswers: boolean expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerationConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.GenerationConfig} GenerationConfig
                         */
                        GenerationConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.GenerationConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.GenerationConfig();
                            if (object.candidateCount != null)
                                message.candidateCount = object.candidateCount | 0;
                            if (object.stopSequences) {
                                if (!Array.isArray(object.stopSequences))
                                    throw TypeError(".google.ai.generativelanguage.v1.GenerationConfig.stopSequences: array expected");
                                message.stopSequences = [];
                                for (var i = 0; i < object.stopSequences.length; ++i)
                                    message.stopSequences[i] = String(object.stopSequences[i]);
                            }
                            if (object.maxOutputTokens != null)
                                message.maxOutputTokens = object.maxOutputTokens | 0;
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            if (object.presencePenalty != null)
                                message.presencePenalty = Number(object.presencePenalty);
                            if (object.frequencyPenalty != null)
                                message.frequencyPenalty = Number(object.frequencyPenalty);
                            if (object.responseLogprobs != null)
                                message.responseLogprobs = Boolean(object.responseLogprobs);
                            if (object.logprobs != null)
                                message.logprobs = object.logprobs | 0;
                            if (object.enableEnhancedCivicAnswers != null)
                                message.enableEnhancedCivicAnswers = Boolean(object.enableEnhancedCivicAnswers);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerationConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1.GenerationConfig} message GenerationConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerationConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.stopSequences = [];
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                object.candidateCount = message.candidateCount;
                                if (options.oneofs)
                                    object._candidateCount = "candidateCount";
                            }
                            if (message.stopSequences && message.stopSequences.length) {
                                object.stopSequences = [];
                                for (var j = 0; j < message.stopSequences.length; ++j)
                                    object.stopSequences[j] = message.stopSequences[j];
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                object.maxOutputTokens = message.maxOutputTokens;
                                if (options.oneofs)
                                    object._maxOutputTokens = "maxOutputTokens";
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.presencePenalty != null && message.hasOwnProperty("presencePenalty")) {
                                object.presencePenalty = options.json && !isFinite(message.presencePenalty) ? String(message.presencePenalty) : message.presencePenalty;
                                if (options.oneofs)
                                    object._presencePenalty = "presencePenalty";
                            }
                            if (message.frequencyPenalty != null && message.hasOwnProperty("frequencyPenalty")) {
                                object.frequencyPenalty = options.json && !isFinite(message.frequencyPenalty) ? String(message.frequencyPenalty) : message.frequencyPenalty;
                                if (options.oneofs)
                                    object._frequencyPenalty = "frequencyPenalty";
                            }
                            if (message.responseLogprobs != null && message.hasOwnProperty("responseLogprobs")) {
                                object.responseLogprobs = message.responseLogprobs;
                                if (options.oneofs)
                                    object._responseLogprobs = "responseLogprobs";
                            }
                            if (message.logprobs != null && message.hasOwnProperty("logprobs")) {
                                object.logprobs = message.logprobs;
                                if (options.oneofs)
                                    object._logprobs = "logprobs";
                            }
                            if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) {
                                object.enableEnhancedCivicAnswers = message.enableEnhancedCivicAnswers;
                                if (options.oneofs)
                                    object._enableEnhancedCivicAnswers = "enableEnhancedCivicAnswers";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerationConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerationConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerationConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.GenerationConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.GenerationConfig";
                        };
    
                        return GenerationConfig;
                    })();
    
                    v1.GenerateContentResponse = (function() {
    
                        /**
                         * Properties of a GenerateContentResponse.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IGenerateContentResponse
                         * @property {Array.<google.ai.generativelanguage.v1.ICandidate>|null} [candidates] GenerateContentResponse candidates
                         * @property {google.ai.generativelanguage.v1.GenerateContentResponse.IPromptFeedback|null} [promptFeedback] GenerateContentResponse promptFeedback
                         * @property {google.ai.generativelanguage.v1.GenerateContentResponse.IUsageMetadata|null} [usageMetadata] GenerateContentResponse usageMetadata
                         * @property {string|null} [modelVersion] GenerateContentResponse modelVersion
                         */
    
                        /**
                         * Constructs a new GenerateContentResponse.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a GenerateContentResponse.
                         * @implements IGenerateContentResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IGenerateContentResponse=} [properties] Properties to set
                         */
                        function GenerateContentResponse(properties) {
                            this.candidates = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateContentResponse candidates.
                         * @member {Array.<google.ai.generativelanguage.v1.ICandidate>} candidates
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.candidates = $util.emptyArray;
    
                        /**
                         * GenerateContentResponse promptFeedback.
                         * @member {google.ai.generativelanguage.v1.GenerateContentResponse.IPromptFeedback|null|undefined} promptFeedback
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.promptFeedback = null;
    
                        /**
                         * GenerateContentResponse usageMetadata.
                         * @member {google.ai.generativelanguage.v1.GenerateContentResponse.IUsageMetadata|null|undefined} usageMetadata
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.usageMetadata = null;
    
                        /**
                         * GenerateContentResponse modelVersion.
                         * @member {string} modelVersion
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.modelVersion = "";
    
                        /**
                         * Creates a new GenerateContentResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGenerateContentResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.GenerateContentResponse} GenerateContentResponse instance
                         */
                        GenerateContentResponse.create = function create(properties) {
                            return new GenerateContentResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateContentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1.GenerateContentResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGenerateContentResponse} message GenerateContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidates != null && message.candidates.length)
                                for (var i = 0; i < message.candidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1.Candidate.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.promptFeedback != null && Object.hasOwnProperty.call(message, "promptFeedback"))
                                $root.google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.encode(message.promptFeedback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.usageMetadata != null && Object.hasOwnProperty.call(message, "usageMetadata"))
                                $root.google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelVersion);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateContentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.GenerateContentResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGenerateContentResponse} message GenerateContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateContentResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.GenerateContentResponse} GenerateContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.GenerateContentResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.candidates && message.candidates.length))
                                            message.candidates = [];
                                        message.candidates.push($root.google.ai.generativelanguage.v1.Candidate.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.promptFeedback = $root.google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.usageMetadata = $root.google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.modelVersion = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateContentResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.GenerateContentResponse} GenerateContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateContentResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateContentResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                if (!Array.isArray(message.candidates))
                                    return "candidates: array expected";
                                for (var i = 0; i < message.candidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.Candidate.verify(message.candidates[i]);
                                    if (error)
                                        return "candidates." + error;
                                }
                            }
                            if (message.promptFeedback != null && message.hasOwnProperty("promptFeedback")) {
                                var error = $root.google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.verify(message.promptFeedback);
                                if (error)
                                    return "promptFeedback." + error;
                            }
                            if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata.verify(message.usageMetadata);
                                if (error)
                                    return "usageMetadata." + error;
                            }
                            if (message.modelVersion != null && message.hasOwnProperty("modelVersion"))
                                if (!$util.isString(message.modelVersion))
                                    return "modelVersion: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GenerateContentResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.GenerateContentResponse} GenerateContentResponse
                         */
                        GenerateContentResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.GenerateContentResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.GenerateContentResponse();
                            if (object.candidates) {
                                if (!Array.isArray(object.candidates))
                                    throw TypeError(".google.ai.generativelanguage.v1.GenerateContentResponse.candidates: array expected");
                                message.candidates = [];
                                for (var i = 0; i < object.candidates.length; ++i) {
                                    if (typeof object.candidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.GenerateContentResponse.candidates: object expected");
                                    message.candidates[i] = $root.google.ai.generativelanguage.v1.Candidate.fromObject(object.candidates[i]);
                                }
                            }
                            if (object.promptFeedback != null) {
                                if (typeof object.promptFeedback !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.GenerateContentResponse.promptFeedback: object expected");
                                message.promptFeedback = $root.google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.fromObject(object.promptFeedback);
                            }
                            if (object.usageMetadata != null) {
                                if (typeof object.usageMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.GenerateContentResponse.usageMetadata: object expected");
                                message.usageMetadata = $root.google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata.fromObject(object.usageMetadata);
                            }
                            if (object.modelVersion != null)
                                message.modelVersion = String(object.modelVersion);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateContentResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.GenerateContentResponse} message GenerateContentResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateContentResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.candidates = [];
                            if (options.defaults) {
                                object.promptFeedback = null;
                                object.usageMetadata = null;
                                object.modelVersion = "";
                            }
                            if (message.candidates && message.candidates.length) {
                                object.candidates = [];
                                for (var j = 0; j < message.candidates.length; ++j)
                                    object.candidates[j] = $root.google.ai.generativelanguage.v1.Candidate.toObject(message.candidates[j], options);
                            }
                            if (message.promptFeedback != null && message.hasOwnProperty("promptFeedback"))
                                object.promptFeedback = $root.google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.toObject(message.promptFeedback, options);
                            if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata"))
                                object.usageMetadata = $root.google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata.toObject(message.usageMetadata, options);
                            if (message.modelVersion != null && message.hasOwnProperty("modelVersion"))
                                object.modelVersion = message.modelVersion;
                            return object;
                        };
    
                        /**
                         * Converts this GenerateContentResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateContentResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateContentResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateContentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.GenerateContentResponse";
                        };
    
                        GenerateContentResponse.PromptFeedback = (function() {
    
                            /**
                             * Properties of a PromptFeedback.
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                             * @interface IPromptFeedback
                             * @property {google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.BlockReason|null} [blockReason] PromptFeedback blockReason
                             * @property {Array.<google.ai.generativelanguage.v1.ISafetyRating>|null} [safetyRatings] PromptFeedback safetyRatings
                             */
    
                            /**
                             * Constructs a new PromptFeedback.
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                             * @classdesc Represents a PromptFeedback.
                             * @implements IPromptFeedback
                             * @constructor
                             * @param {google.ai.generativelanguage.v1.GenerateContentResponse.IPromptFeedback=} [properties] Properties to set
                             */
                            function PromptFeedback(properties) {
                                this.safetyRatings = [];
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * PromptFeedback blockReason.
                             * @member {google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.BlockReason} blockReason
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @instance
                             */
                            PromptFeedback.prototype.blockReason = 0;
    
                            /**
                             * PromptFeedback safetyRatings.
                             * @member {Array.<google.ai.generativelanguage.v1.ISafetyRating>} safetyRatings
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @instance
                             */
                            PromptFeedback.prototype.safetyRatings = $util.emptyArray;
    
                            /**
                             * Creates a new PromptFeedback instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1.GenerateContentResponse.IPromptFeedback=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback} PromptFeedback instance
                             */
                            PromptFeedback.create = function create(properties) {
                                return new PromptFeedback(properties);
                            };
    
                            /**
                             * Encodes the specified PromptFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1.GenerateContentResponse.IPromptFeedback} message PromptFeedback message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            PromptFeedback.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.blockReason != null && Object.hasOwnProperty.call(message, "blockReason"))
                                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.blockReason);
                                if (message.safetyRatings != null && message.safetyRatings.length)
                                    for (var i = 0; i < message.safetyRatings.length; ++i)
                                        $root.google.ai.generativelanguage.v1.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                                return writer;
                            };
    
                            /**
                             * Encodes the specified PromptFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1.GenerateContentResponse.IPromptFeedback} message PromptFeedback message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            PromptFeedback.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a PromptFeedback message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback} PromptFeedback
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            PromptFeedback.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.blockReason = reader.int32();
                                            break;
                                        }
                                    case 2: {
                                            if (!(message.safetyRatings && message.safetyRatings.length))
                                                message.safetyRatings = [];
                                            message.safetyRatings.push($root.google.ai.generativelanguage.v1.SafetyRating.decode(reader, reader.uint32()));
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a PromptFeedback message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback} PromptFeedback
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            PromptFeedback.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a PromptFeedback message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            PromptFeedback.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.blockReason != null && message.hasOwnProperty("blockReason"))
                                    switch (message.blockReason) {
                                    default:
                                        return "blockReason: enum value expected";
                                    case 0:
                                    case 1:
                                    case 2:
                                    case 3:
                                    case 4:
                                    case 5:
                                        break;
                                    }
                                if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                    if (!Array.isArray(message.safetyRatings))
                                        return "safetyRatings: array expected";
                                    for (var i = 0; i < message.safetyRatings.length; ++i) {
                                        var error = $root.google.ai.generativelanguage.v1.SafetyRating.verify(message.safetyRatings[i]);
                                        if (error)
                                            return "safetyRatings." + error;
                                    }
                                }
                                return null;
                            };
    
                            /**
                             * Creates a PromptFeedback message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback} PromptFeedback
                             */
                            PromptFeedback.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback();
                                switch (object.blockReason) {
                                default:
                                    if (typeof object.blockReason === "number") {
                                        message.blockReason = object.blockReason;
                                        break;
                                    }
                                    break;
                                case "BLOCK_REASON_UNSPECIFIED":
                                case 0:
                                    message.blockReason = 0;
                                    break;
                                case "SAFETY":
                                case 1:
                                    message.blockReason = 1;
                                    break;
                                case "OTHER":
                                case 2:
                                    message.blockReason = 2;
                                    break;
                                case "BLOCKLIST":
                                case 3:
                                    message.blockReason = 3;
                                    break;
                                case "PROHIBITED_CONTENT":
                                case 4:
                                    message.blockReason = 4;
                                    break;
                                case "IMAGE_SAFETY":
                                case 5:
                                    message.blockReason = 5;
                                    break;
                                }
                                if (object.safetyRatings) {
                                    if (!Array.isArray(object.safetyRatings))
                                        throw TypeError(".google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.safetyRatings: array expected");
                                    message.safetyRatings = [];
                                    for (var i = 0; i < object.safetyRatings.length; ++i) {
                                        if (typeof object.safetyRatings[i] !== "object")
                                            throw TypeError(".google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.safetyRatings: object expected");
                                        message.safetyRatings[i] = $root.google.ai.generativelanguage.v1.SafetyRating.fromObject(object.safetyRatings[i]);
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a PromptFeedback message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback} message PromptFeedback
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            PromptFeedback.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.arrays || options.defaults)
                                    object.safetyRatings = [];
                                if (options.defaults)
                                    object.blockReason = options.enums === String ? "BLOCK_REASON_UNSPECIFIED" : 0;
                                if (message.blockReason != null && message.hasOwnProperty("blockReason"))
                                    object.blockReason = options.enums === String ? $root.google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.BlockReason[message.blockReason] === undefined ? message.blockReason : $root.google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.BlockReason[message.blockReason] : message.blockReason;
                                if (message.safetyRatings && message.safetyRatings.length) {
                                    object.safetyRatings = [];
                                    for (var j = 0; j < message.safetyRatings.length; ++j)
                                        object.safetyRatings[j] = $root.google.ai.generativelanguage.v1.SafetyRating.toObject(message.safetyRatings[j], options);
                                }
                                return object;
                            };
    
                            /**
                             * Converts this PromptFeedback to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            PromptFeedback.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for PromptFeedback
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            PromptFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback";
                            };
    
                            /**
                             * BlockReason enum.
                             * @name google.ai.generativelanguage.v1.GenerateContentResponse.PromptFeedback.BlockReason
                             * @enum {number}
                             * @property {number} BLOCK_REASON_UNSPECIFIED=0 BLOCK_REASON_UNSPECIFIED value
                             * @property {number} SAFETY=1 SAFETY value
                             * @property {number} OTHER=2 OTHER value
                             * @property {number} BLOCKLIST=3 BLOCKLIST value
                             * @property {number} PROHIBITED_CONTENT=4 PROHIBITED_CONTENT value
                             * @property {number} IMAGE_SAFETY=5 IMAGE_SAFETY value
                             */
                            PromptFeedback.BlockReason = (function() {
                                var valuesById = {}, values = Object.create(valuesById);
                                values[valuesById[0] = "BLOCK_REASON_UNSPECIFIED"] = 0;
                                values[valuesById[1] = "SAFETY"] = 1;
                                values[valuesById[2] = "OTHER"] = 2;
                                values[valuesById[3] = "BLOCKLIST"] = 3;
                                values[valuesById[4] = "PROHIBITED_CONTENT"] = 4;
                                values[valuesById[5] = "IMAGE_SAFETY"] = 5;
                                return values;
                            })();
    
                            return PromptFeedback;
                        })();
    
                        GenerateContentResponse.UsageMetadata = (function() {
    
                            /**
                             * Properties of a UsageMetadata.
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                             * @interface IUsageMetadata
                             * @property {number|null} [promptTokenCount] UsageMetadata promptTokenCount
                             * @property {number|null} [candidatesTokenCount] UsageMetadata candidatesTokenCount
                             * @property {number|null} [totalTokenCount] UsageMetadata totalTokenCount
                             */
    
                            /**
                             * Constructs a new UsageMetadata.
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse
                             * @classdesc Represents a UsageMetadata.
                             * @implements IUsageMetadata
                             * @constructor
                             * @param {google.ai.generativelanguage.v1.GenerateContentResponse.IUsageMetadata=} [properties] Properties to set
                             */
                            function UsageMetadata(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * UsageMetadata promptTokenCount.
                             * @member {number} promptTokenCount
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.promptTokenCount = 0;
    
                            /**
                             * UsageMetadata candidatesTokenCount.
                             * @member {number} candidatesTokenCount
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.candidatesTokenCount = 0;
    
                            /**
                             * UsageMetadata totalTokenCount.
                             * @member {number} totalTokenCount
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.totalTokenCount = 0;
    
                            /**
                             * Creates a new UsageMetadata instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1.GenerateContentResponse.IUsageMetadata=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata} UsageMetadata instance
                             */
                            UsageMetadata.create = function create(properties) {
                                return new UsageMetadata(properties);
                            };
    
                            /**
                             * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1.GenerateContentResponse.IUsageMetadata} message UsageMetadata message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            UsageMetadata.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.promptTokenCount != null && Object.hasOwnProperty.call(message, "promptTokenCount"))
                                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.promptTokenCount);
                                if (message.candidatesTokenCount != null && Object.hasOwnProperty.call(message, "candidatesTokenCount"))
                                    writer.uint32(/* id 2, wireType 0 =*/16).int32(message.candidatesTokenCount);
                                if (message.totalTokenCount != null && Object.hasOwnProperty.call(message, "totalTokenCount"))
                                    writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalTokenCount);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1.GenerateContentResponse.IUsageMetadata} message UsageMetadata message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            UsageMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a UsageMetadata message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata} UsageMetadata
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            UsageMetadata.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.promptTokenCount = reader.int32();
                                            break;
                                        }
                                    case 2: {
                                            message.candidatesTokenCount = reader.int32();
                                            break;
                                        }
                                    case 3: {
                                            message.totalTokenCount = reader.int32();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a UsageMetadata message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata} UsageMetadata
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            UsageMetadata.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a UsageMetadata message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            UsageMetadata.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.promptTokenCount != null && message.hasOwnProperty("promptTokenCount"))
                                    if (!$util.isInteger(message.promptTokenCount))
                                        return "promptTokenCount: integer expected";
                                if (message.candidatesTokenCount != null && message.hasOwnProperty("candidatesTokenCount"))
                                    if (!$util.isInteger(message.candidatesTokenCount))
                                        return "candidatesTokenCount: integer expected";
                                if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount"))
                                    if (!$util.isInteger(message.totalTokenCount))
                                        return "totalTokenCount: integer expected";
                                return null;
                            };
    
                            /**
                             * Creates a UsageMetadata message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata} UsageMetadata
                             */
                            UsageMetadata.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata();
                                if (object.promptTokenCount != null)
                                    message.promptTokenCount = object.promptTokenCount | 0;
                                if (object.candidatesTokenCount != null)
                                    message.candidatesTokenCount = object.candidatesTokenCount | 0;
                                if (object.totalTokenCount != null)
                                    message.totalTokenCount = object.totalTokenCount | 0;
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a UsageMetadata message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata} message UsageMetadata
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            UsageMetadata.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.defaults) {
                                    object.promptTokenCount = 0;
                                    object.candidatesTokenCount = 0;
                                    object.totalTokenCount = 0;
                                }
                                if (message.promptTokenCount != null && message.hasOwnProperty("promptTokenCount"))
                                    object.promptTokenCount = message.promptTokenCount;
                                if (message.candidatesTokenCount != null && message.hasOwnProperty("candidatesTokenCount"))
                                    object.candidatesTokenCount = message.candidatesTokenCount;
                                if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount"))
                                    object.totalTokenCount = message.totalTokenCount;
                                return object;
                            };
    
                            /**
                             * Converts this UsageMetadata to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            UsageMetadata.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for UsageMetadata
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            UsageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1.GenerateContentResponse.UsageMetadata";
                            };
    
                            return UsageMetadata;
                        })();
    
                        return GenerateContentResponse;
                    })();
    
                    v1.Candidate = (function() {
    
                        /**
                         * Properties of a Candidate.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface ICandidate
                         * @property {number|null} [index] Candidate index
                         * @property {google.ai.generativelanguage.v1.IContent|null} [content] Candidate content
                         * @property {google.ai.generativelanguage.v1.Candidate.FinishReason|null} [finishReason] Candidate finishReason
                         * @property {Array.<google.ai.generativelanguage.v1.ISafetyRating>|null} [safetyRatings] Candidate safetyRatings
                         * @property {google.ai.generativelanguage.v1.ICitationMetadata|null} [citationMetadata] Candidate citationMetadata
                         * @property {number|null} [tokenCount] Candidate tokenCount
                         * @property {google.ai.generativelanguage.v1.IGroundingMetadata|null} [groundingMetadata] Candidate groundingMetadata
                         * @property {number|null} [avgLogprobs] Candidate avgLogprobs
                         * @property {google.ai.generativelanguage.v1.ILogprobsResult|null} [logprobsResult] Candidate logprobsResult
                         */
    
                        /**
                         * Constructs a new Candidate.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a Candidate.
                         * @implements ICandidate
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.ICandidate=} [properties] Properties to set
                         */
                        function Candidate(properties) {
                            this.safetyRatings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Candidate index.
                         * @member {number|null|undefined} index
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @instance
                         */
                        Candidate.prototype.index = null;
    
                        /**
                         * Candidate content.
                         * @member {google.ai.generativelanguage.v1.IContent|null|undefined} content
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @instance
                         */
                        Candidate.prototype.content = null;
    
                        /**
                         * Candidate finishReason.
                         * @member {google.ai.generativelanguage.v1.Candidate.FinishReason} finishReason
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @instance
                         */
                        Candidate.prototype.finishReason = 0;
    
                        /**
                         * Candidate safetyRatings.
                         * @member {Array.<google.ai.generativelanguage.v1.ISafetyRating>} safetyRatings
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @instance
                         */
                        Candidate.prototype.safetyRatings = $util.emptyArray;
    
                        /**
                         * Candidate citationMetadata.
                         * @member {google.ai.generativelanguage.v1.ICitationMetadata|null|undefined} citationMetadata
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @instance
                         */
                        Candidate.prototype.citationMetadata = null;
    
                        /**
                         * Candidate tokenCount.
                         * @member {number} tokenCount
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @instance
                         */
                        Candidate.prototype.tokenCount = 0;
    
                        /**
                         * Candidate groundingMetadata.
                         * @member {google.ai.generativelanguage.v1.IGroundingMetadata|null|undefined} groundingMetadata
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @instance
                         */
                        Candidate.prototype.groundingMetadata = null;
    
                        /**
                         * Candidate avgLogprobs.
                         * @member {number} avgLogprobs
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @instance
                         */
                        Candidate.prototype.avgLogprobs = 0;
    
                        /**
                         * Candidate logprobsResult.
                         * @member {google.ai.generativelanguage.v1.ILogprobsResult|null|undefined} logprobsResult
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @instance
                         */
                        Candidate.prototype.logprobsResult = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Candidate _index.
                         * @member {"index"|undefined} _index
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @instance
                         */
                        Object.defineProperty(Candidate.prototype, "_index", {
                            get: $util.oneOfGetter($oneOfFields = ["index"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Candidate instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICandidate=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.Candidate} Candidate instance
                         */
                        Candidate.create = function create(properties) {
                            return new Candidate(properties);
                        };
    
                        /**
                         * Encodes the specified Candidate message. Does not implicitly {@link google.ai.generativelanguage.v1.Candidate.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICandidate} message Candidate message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Candidate.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                $root.google.ai.generativelanguage.v1.Content.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.finishReason != null && Object.hasOwnProperty.call(message, "finishReason"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.finishReason);
                            if (message.index != null && Object.hasOwnProperty.call(message, "index"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.index);
                            if (message.safetyRatings != null && message.safetyRatings.length)
                                for (var i = 0; i < message.safetyRatings.length; ++i)
                                    $root.google.ai.generativelanguage.v1.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata"))
                                $root.google.ai.generativelanguage.v1.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.tokenCount);
                            if (message.groundingMetadata != null && Object.hasOwnProperty.call(message, "groundingMetadata"))
                                $root.google.ai.generativelanguage.v1.GroundingMetadata.encode(message.groundingMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                            if (message.avgLogprobs != null && Object.hasOwnProperty.call(message, "avgLogprobs"))
                                writer.uint32(/* id 10, wireType 1 =*/81).double(message.avgLogprobs);
                            if (message.logprobsResult != null && Object.hasOwnProperty.call(message, "logprobsResult"))
                                $root.google.ai.generativelanguage.v1.LogprobsResult.encode(message.logprobsResult, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.Candidate.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICandidate} message Candidate message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Candidate.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Candidate message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.Candidate} Candidate
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Candidate.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.Candidate();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.index = reader.int32();
                                        break;
                                    }
                                case 1: {
                                        message.content = $root.google.ai.generativelanguage.v1.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.finishReason = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        if (!(message.safetyRatings && message.safetyRatings.length))
                                            message.safetyRatings = [];
                                        message.safetyRatings.push($root.google.ai.generativelanguage.v1.SafetyRating.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 6: {
                                        message.citationMetadata = $root.google.ai.generativelanguage.v1.CitationMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 7: {
                                        message.tokenCount = reader.int32();
                                        break;
                                    }
                                case 9: {
                                        message.groundingMetadata = $root.google.ai.generativelanguage.v1.GroundingMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 10: {
                                        message.avgLogprobs = reader.double();
                                        break;
                                    }
                                case 11: {
                                        message.logprobsResult = $root.google.ai.generativelanguage.v1.LogprobsResult.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Candidate message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.Candidate} Candidate
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Candidate.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Candidate message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Candidate.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.index != null && message.hasOwnProperty("index")) {
                                properties._index = 1;
                                if (!$util.isInteger(message.index))
                                    return "index: integer expected";
                            }
                            if (message.content != null && message.hasOwnProperty("content")) {
                                var error = $root.google.ai.generativelanguage.v1.Content.verify(message.content);
                                if (error)
                                    return "content." + error;
                            }
                            if (message.finishReason != null && message.hasOwnProperty("finishReason"))
                                switch (message.finishReason) {
                                default:
                                    return "finishReason: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 6:
                                case 5:
                                case 7:
                                case 8:
                                case 9:
                                case 10:
                                case 11:
                                    break;
                                }
                            if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                if (!Array.isArray(message.safetyRatings))
                                    return "safetyRatings: array expected";
                                for (var i = 0; i < message.safetyRatings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.SafetyRating.verify(message.safetyRatings[i]);
                                    if (error)
                                        return "safetyRatings." + error;
                                }
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1.CitationMetadata.verify(message.citationMetadata);
                                if (error)
                                    return "citationMetadata." + error;
                            }
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                if (!$util.isInteger(message.tokenCount))
                                    return "tokenCount: integer expected";
                            if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1.GroundingMetadata.verify(message.groundingMetadata);
                                if (error)
                                    return "groundingMetadata." + error;
                            }
                            if (message.avgLogprobs != null && message.hasOwnProperty("avgLogprobs"))
                                if (typeof message.avgLogprobs !== "number")
                                    return "avgLogprobs: number expected";
                            if (message.logprobsResult != null && message.hasOwnProperty("logprobsResult")) {
                                var error = $root.google.ai.generativelanguage.v1.LogprobsResult.verify(message.logprobsResult);
                                if (error)
                                    return "logprobsResult." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Candidate message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.Candidate} Candidate
                         */
                        Candidate.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.Candidate)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.Candidate();
                            if (object.index != null)
                                message.index = object.index | 0;
                            if (object.content != null) {
                                if (typeof object.content !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.Candidate.content: object expected");
                                message.content = $root.google.ai.generativelanguage.v1.Content.fromObject(object.content);
                            }
                            switch (object.finishReason) {
                            default:
                                if (typeof object.finishReason === "number") {
                                    message.finishReason = object.finishReason;
                                    break;
                                }
                                break;
                            case "FINISH_REASON_UNSPECIFIED":
                            case 0:
                                message.finishReason = 0;
                                break;
                            case "STOP":
                            case 1:
                                message.finishReason = 1;
                                break;
                            case "MAX_TOKENS":
                            case 2:
                                message.finishReason = 2;
                                break;
                            case "SAFETY":
                            case 3:
                                message.finishReason = 3;
                                break;
                            case "RECITATION":
                            case 4:
                                message.finishReason = 4;
                                break;
                            case "LANGUAGE":
                            case 6:
                                message.finishReason = 6;
                                break;
                            case "OTHER":
                            case 5:
                                message.finishReason = 5;
                                break;
                            case "BLOCKLIST":
                            case 7:
                                message.finishReason = 7;
                                break;
                            case "PROHIBITED_CONTENT":
                            case 8:
                                message.finishReason = 8;
                                break;
                            case "SPII":
                            case 9:
                                message.finishReason = 9;
                                break;
                            case "MALFORMED_FUNCTION_CALL":
                            case 10:
                                message.finishReason = 10;
                                break;
                            case "IMAGE_SAFETY":
                            case 11:
                                message.finishReason = 11;
                                break;
                            }
                            if (object.safetyRatings) {
                                if (!Array.isArray(object.safetyRatings))
                                    throw TypeError(".google.ai.generativelanguage.v1.Candidate.safetyRatings: array expected");
                                message.safetyRatings = [];
                                for (var i = 0; i < object.safetyRatings.length; ++i) {
                                    if (typeof object.safetyRatings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.Candidate.safetyRatings: object expected");
                                    message.safetyRatings[i] = $root.google.ai.generativelanguage.v1.SafetyRating.fromObject(object.safetyRatings[i]);
                                }
                            }
                            if (object.citationMetadata != null) {
                                if (typeof object.citationMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.Candidate.citationMetadata: object expected");
                                message.citationMetadata = $root.google.ai.generativelanguage.v1.CitationMetadata.fromObject(object.citationMetadata);
                            }
                            if (object.tokenCount != null)
                                message.tokenCount = object.tokenCount | 0;
                            if (object.groundingMetadata != null) {
                                if (typeof object.groundingMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.Candidate.groundingMetadata: object expected");
                                message.groundingMetadata = $root.google.ai.generativelanguage.v1.GroundingMetadata.fromObject(object.groundingMetadata);
                            }
                            if (object.avgLogprobs != null)
                                message.avgLogprobs = Number(object.avgLogprobs);
                            if (object.logprobsResult != null) {
                                if (typeof object.logprobsResult !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.Candidate.logprobsResult: object expected");
                                message.logprobsResult = $root.google.ai.generativelanguage.v1.LogprobsResult.fromObject(object.logprobsResult);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Candidate message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1.Candidate} message Candidate
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Candidate.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.safetyRatings = [];
                            if (options.defaults) {
                                object.content = null;
                                object.finishReason = options.enums === String ? "FINISH_REASON_UNSPECIFIED" : 0;
                                object.citationMetadata = null;
                                object.tokenCount = 0;
                                object.groundingMetadata = null;
                                object.avgLogprobs = 0;
                                object.logprobsResult = null;
                            }
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = $root.google.ai.generativelanguage.v1.Content.toObject(message.content, options);
                            if (message.finishReason != null && message.hasOwnProperty("finishReason"))
                                object.finishReason = options.enums === String ? $root.google.ai.generativelanguage.v1.Candidate.FinishReason[message.finishReason] === undefined ? message.finishReason : $root.google.ai.generativelanguage.v1.Candidate.FinishReason[message.finishReason] : message.finishReason;
                            if (message.index != null && message.hasOwnProperty("index")) {
                                object.index = message.index;
                                if (options.oneofs)
                                    object._index = "index";
                            }
                            if (message.safetyRatings && message.safetyRatings.length) {
                                object.safetyRatings = [];
                                for (var j = 0; j < message.safetyRatings.length; ++j)
                                    object.safetyRatings[j] = $root.google.ai.generativelanguage.v1.SafetyRating.toObject(message.safetyRatings[j], options);
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata"))
                                object.citationMetadata = $root.google.ai.generativelanguage.v1.CitationMetadata.toObject(message.citationMetadata, options);
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                object.tokenCount = message.tokenCount;
                            if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata"))
                                object.groundingMetadata = $root.google.ai.generativelanguage.v1.GroundingMetadata.toObject(message.groundingMetadata, options);
                            if (message.avgLogprobs != null && message.hasOwnProperty("avgLogprobs"))
                                object.avgLogprobs = options.json && !isFinite(message.avgLogprobs) ? String(message.avgLogprobs) : message.avgLogprobs;
                            if (message.logprobsResult != null && message.hasOwnProperty("logprobsResult"))
                                object.logprobsResult = $root.google.ai.generativelanguage.v1.LogprobsResult.toObject(message.logprobsResult, options);
                            return object;
                        };
    
                        /**
                         * Converts this Candidate to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Candidate.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Candidate
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.Candidate
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Candidate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.Candidate";
                        };
    
                        /**
                         * FinishReason enum.
                         * @name google.ai.generativelanguage.v1.Candidate.FinishReason
                         * @enum {number}
                         * @property {number} FINISH_REASON_UNSPECIFIED=0 FINISH_REASON_UNSPECIFIED value
                         * @property {number} STOP=1 STOP value
                         * @property {number} MAX_TOKENS=2 MAX_TOKENS value
                         * @property {number} SAFETY=3 SAFETY value
                         * @property {number} RECITATION=4 RECITATION value
                         * @property {number} LANGUAGE=6 LANGUAGE value
                         * @property {number} OTHER=5 OTHER value
                         * @property {number} BLOCKLIST=7 BLOCKLIST value
                         * @property {number} PROHIBITED_CONTENT=8 PROHIBITED_CONTENT value
                         * @property {number} SPII=9 SPII value
                         * @property {number} MALFORMED_FUNCTION_CALL=10 MALFORMED_FUNCTION_CALL value
                         * @property {number} IMAGE_SAFETY=11 IMAGE_SAFETY value
                         */
                        Candidate.FinishReason = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "FINISH_REASON_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "STOP"] = 1;
                            values[valuesById[2] = "MAX_TOKENS"] = 2;
                            values[valuesById[3] = "SAFETY"] = 3;
                            values[valuesById[4] = "RECITATION"] = 4;
                            values[valuesById[6] = "LANGUAGE"] = 6;
                            values[valuesById[5] = "OTHER"] = 5;
                            values[valuesById[7] = "BLOCKLIST"] = 7;
                            values[valuesById[8] = "PROHIBITED_CONTENT"] = 8;
                            values[valuesById[9] = "SPII"] = 9;
                            values[valuesById[10] = "MALFORMED_FUNCTION_CALL"] = 10;
                            values[valuesById[11] = "IMAGE_SAFETY"] = 11;
                            return values;
                        })();
    
                        return Candidate;
                    })();
    
                    v1.LogprobsResult = (function() {
    
                        /**
                         * Properties of a LogprobsResult.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface ILogprobsResult
                         * @property {Array.<google.ai.generativelanguage.v1.LogprobsResult.ITopCandidates>|null} [topCandidates] LogprobsResult topCandidates
                         * @property {Array.<google.ai.generativelanguage.v1.LogprobsResult.ICandidate>|null} [chosenCandidates] LogprobsResult chosenCandidates
                         */
    
                        /**
                         * Constructs a new LogprobsResult.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a LogprobsResult.
                         * @implements ILogprobsResult
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.ILogprobsResult=} [properties] Properties to set
                         */
                        function LogprobsResult(properties) {
                            this.topCandidates = [];
                            this.chosenCandidates = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * LogprobsResult topCandidates.
                         * @member {Array.<google.ai.generativelanguage.v1.LogprobsResult.ITopCandidates>} topCandidates
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @instance
                         */
                        LogprobsResult.prototype.topCandidates = $util.emptyArray;
    
                        /**
                         * LogprobsResult chosenCandidates.
                         * @member {Array.<google.ai.generativelanguage.v1.LogprobsResult.ICandidate>} chosenCandidates
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @instance
                         */
                        LogprobsResult.prototype.chosenCandidates = $util.emptyArray;
    
                        /**
                         * Creates a new LogprobsResult instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1.ILogprobsResult=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.LogprobsResult} LogprobsResult instance
                         */
                        LogprobsResult.create = function create(properties) {
                            return new LogprobsResult(properties);
                        };
    
                        /**
                         * Encodes the specified LogprobsResult message. Does not implicitly {@link google.ai.generativelanguage.v1.LogprobsResult.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1.ILogprobsResult} message LogprobsResult message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        LogprobsResult.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.topCandidates != null && message.topCandidates.length)
                                for (var i = 0; i < message.topCandidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1.LogprobsResult.TopCandidates.encode(message.topCandidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.chosenCandidates != null && message.chosenCandidates.length)
                                for (var i = 0; i < message.chosenCandidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1.LogprobsResult.Candidate.encode(message.chosenCandidates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified LogprobsResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.LogprobsResult.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1.ILogprobsResult} message LogprobsResult message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        LogprobsResult.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a LogprobsResult message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.LogprobsResult} LogprobsResult
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        LogprobsResult.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.LogprobsResult();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.topCandidates && message.topCandidates.length))
                                            message.topCandidates = [];
                                        message.topCandidates.push($root.google.ai.generativelanguage.v1.LogprobsResult.TopCandidates.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        if (!(message.chosenCandidates && message.chosenCandidates.length))
                                            message.chosenCandidates = [];
                                        message.chosenCandidates.push($root.google.ai.generativelanguage.v1.LogprobsResult.Candidate.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a LogprobsResult message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.LogprobsResult} LogprobsResult
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        LogprobsResult.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a LogprobsResult message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        LogprobsResult.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.topCandidates != null && message.hasOwnProperty("topCandidates")) {
                                if (!Array.isArray(message.topCandidates))
                                    return "topCandidates: array expected";
                                for (var i = 0; i < message.topCandidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.LogprobsResult.TopCandidates.verify(message.topCandidates[i]);
                                    if (error)
                                        return "topCandidates." + error;
                                }
                            }
                            if (message.chosenCandidates != null && message.hasOwnProperty("chosenCandidates")) {
                                if (!Array.isArray(message.chosenCandidates))
                                    return "chosenCandidates: array expected";
                                for (var i = 0; i < message.chosenCandidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.LogprobsResult.Candidate.verify(message.chosenCandidates[i]);
                                    if (error)
                                        return "chosenCandidates." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a LogprobsResult message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.LogprobsResult} LogprobsResult
                         */
                        LogprobsResult.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.LogprobsResult)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.LogprobsResult();
                            if (object.topCandidates) {
                                if (!Array.isArray(object.topCandidates))
                                    throw TypeError(".google.ai.generativelanguage.v1.LogprobsResult.topCandidates: array expected");
                                message.topCandidates = [];
                                for (var i = 0; i < object.topCandidates.length; ++i) {
                                    if (typeof object.topCandidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.LogprobsResult.topCandidates: object expected");
                                    message.topCandidates[i] = $root.google.ai.generativelanguage.v1.LogprobsResult.TopCandidates.fromObject(object.topCandidates[i]);
                                }
                            }
                            if (object.chosenCandidates) {
                                if (!Array.isArray(object.chosenCandidates))
                                    throw TypeError(".google.ai.generativelanguage.v1.LogprobsResult.chosenCandidates: array expected");
                                message.chosenCandidates = [];
                                for (var i = 0; i < object.chosenCandidates.length; ++i) {
                                    if (typeof object.chosenCandidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.LogprobsResult.chosenCandidates: object expected");
                                    message.chosenCandidates[i] = $root.google.ai.generativelanguage.v1.LogprobsResult.Candidate.fromObject(object.chosenCandidates[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a LogprobsResult message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1.LogprobsResult} message LogprobsResult
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        LogprobsResult.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.topCandidates = [];
                                object.chosenCandidates = [];
                            }
                            if (message.topCandidates && message.topCandidates.length) {
                                object.topCandidates = [];
                                for (var j = 0; j < message.topCandidates.length; ++j)
                                    object.topCandidates[j] = $root.google.ai.generativelanguage.v1.LogprobsResult.TopCandidates.toObject(message.topCandidates[j], options);
                            }
                            if (message.chosenCandidates && message.chosenCandidates.length) {
                                object.chosenCandidates = [];
                                for (var j = 0; j < message.chosenCandidates.length; ++j)
                                    object.chosenCandidates[j] = $root.google.ai.generativelanguage.v1.LogprobsResult.Candidate.toObject(message.chosenCandidates[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this LogprobsResult to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        LogprobsResult.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for LogprobsResult
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.LogprobsResult
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        LogprobsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.LogprobsResult";
                        };
    
                        LogprobsResult.Candidate = (function() {
    
                            /**
                             * Properties of a Candidate.
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult
                             * @interface ICandidate
                             * @property {string|null} [token] Candidate token
                             * @property {number|null} [tokenId] Candidate tokenId
                             * @property {number|null} [logProbability] Candidate logProbability
                             */
    
                            /**
                             * Constructs a new Candidate.
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult
                             * @classdesc Represents a Candidate.
                             * @implements ICandidate
                             * @constructor
                             * @param {google.ai.generativelanguage.v1.LogprobsResult.ICandidate=} [properties] Properties to set
                             */
                            function Candidate(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * Candidate token.
                             * @member {string|null|undefined} token
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @instance
                             */
                            Candidate.prototype.token = null;
    
                            /**
                             * Candidate tokenId.
                             * @member {number|null|undefined} tokenId
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @instance
                             */
                            Candidate.prototype.tokenId = null;
    
                            /**
                             * Candidate logProbability.
                             * @member {number|null|undefined} logProbability
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @instance
                             */
                            Candidate.prototype.logProbability = null;
    
                            // OneOf field names bound to virtual getters and setters
                            var $oneOfFields;
    
                            /**
                             * Candidate _token.
                             * @member {"token"|undefined} _token
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @instance
                             */
                            Object.defineProperty(Candidate.prototype, "_token", {
                                get: $util.oneOfGetter($oneOfFields = ["token"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Candidate _tokenId.
                             * @member {"tokenId"|undefined} _tokenId
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @instance
                             */
                            Object.defineProperty(Candidate.prototype, "_tokenId", {
                                get: $util.oneOfGetter($oneOfFields = ["tokenId"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Candidate _logProbability.
                             * @member {"logProbability"|undefined} _logProbability
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @instance
                             */
                            Object.defineProperty(Candidate.prototype, "_logProbability", {
                                get: $util.oneOfGetter($oneOfFields = ["logProbability"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Creates a new Candidate instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1.LogprobsResult.ICandidate=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1.LogprobsResult.Candidate} Candidate instance
                             */
                            Candidate.create = function create(properties) {
                                return new Candidate(properties);
                            };
    
                            /**
                             * Encodes the specified Candidate message. Does not implicitly {@link google.ai.generativelanguage.v1.LogprobsResult.Candidate.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1.LogprobsResult.ICandidate} message Candidate message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Candidate.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.token != null && Object.hasOwnProperty.call(message, "token"))
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.token);
                                if (message.logProbability != null && Object.hasOwnProperty.call(message, "logProbability"))
                                    writer.uint32(/* id 2, wireType 5 =*/21).float(message.logProbability);
                                if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId"))
                                    writer.uint32(/* id 3, wireType 0 =*/24).int32(message.tokenId);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.LogprobsResult.Candidate.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1.LogprobsResult.ICandidate} message Candidate message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Candidate.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a Candidate message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1.LogprobsResult.Candidate} Candidate
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Candidate.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.LogprobsResult.Candidate();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.token = reader.string();
                                            break;
                                        }
                                    case 3: {
                                            message.tokenId = reader.int32();
                                            break;
                                        }
                                    case 2: {
                                            message.logProbability = reader.float();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a Candidate message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1.LogprobsResult.Candidate} Candidate
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Candidate.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a Candidate message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            Candidate.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                var properties = {};
                                if (message.token != null && message.hasOwnProperty("token")) {
                                    properties._token = 1;
                                    if (!$util.isString(message.token))
                                        return "token: string expected";
                                }
                                if (message.tokenId != null && message.hasOwnProperty("tokenId")) {
                                    properties._tokenId = 1;
                                    if (!$util.isInteger(message.tokenId))
                                        return "tokenId: integer expected";
                                }
                                if (message.logProbability != null && message.hasOwnProperty("logProbability")) {
                                    properties._logProbability = 1;
                                    if (typeof message.logProbability !== "number")
                                        return "logProbability: number expected";
                                }
                                return null;
                            };
    
                            /**
                             * Creates a Candidate message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1.LogprobsResult.Candidate} Candidate
                             */
                            Candidate.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1.LogprobsResult.Candidate)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1.LogprobsResult.Candidate();
                                if (object.token != null)
                                    message.token = String(object.token);
                                if (object.tokenId != null)
                                    message.tokenId = object.tokenId | 0;
                                if (object.logProbability != null)
                                    message.logProbability = Number(object.logProbability);
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a Candidate message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1.LogprobsResult.Candidate} message Candidate
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            Candidate.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (message.token != null && message.hasOwnProperty("token")) {
                                    object.token = message.token;
                                    if (options.oneofs)
                                        object._token = "token";
                                }
                                if (message.logProbability != null && message.hasOwnProperty("logProbability")) {
                                    object.logProbability = options.json && !isFinite(message.logProbability) ? String(message.logProbability) : message.logProbability;
                                    if (options.oneofs)
                                        object._logProbability = "logProbability";
                                }
                                if (message.tokenId != null && message.hasOwnProperty("tokenId")) {
                                    object.tokenId = message.tokenId;
                                    if (options.oneofs)
                                        object._tokenId = "tokenId";
                                }
                                return object;
                            };
    
                            /**
                             * Converts this Candidate to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            Candidate.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for Candidate
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.Candidate
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            Candidate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1.LogprobsResult.Candidate";
                            };
    
                            return Candidate;
                        })();
    
                        LogprobsResult.TopCandidates = (function() {
    
                            /**
                             * Properties of a TopCandidates.
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult
                             * @interface ITopCandidates
                             * @property {Array.<google.ai.generativelanguage.v1.LogprobsResult.ICandidate>|null} [candidates] TopCandidates candidates
                             */
    
                            /**
                             * Constructs a new TopCandidates.
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult
                             * @classdesc Represents a TopCandidates.
                             * @implements ITopCandidates
                             * @constructor
                             * @param {google.ai.generativelanguage.v1.LogprobsResult.ITopCandidates=} [properties] Properties to set
                             */
                            function TopCandidates(properties) {
                                this.candidates = [];
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * TopCandidates candidates.
                             * @member {Array.<google.ai.generativelanguage.v1.LogprobsResult.ICandidate>} candidates
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.TopCandidates
                             * @instance
                             */
                            TopCandidates.prototype.candidates = $util.emptyArray;
    
                            /**
                             * Creates a new TopCandidates instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1.LogprobsResult.ITopCandidates=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1.LogprobsResult.TopCandidates} TopCandidates instance
                             */
                            TopCandidates.create = function create(properties) {
                                return new TopCandidates(properties);
                            };
    
                            /**
                             * Encodes the specified TopCandidates message. Does not implicitly {@link google.ai.generativelanguage.v1.LogprobsResult.TopCandidates.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1.LogprobsResult.ITopCandidates} message TopCandidates message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            TopCandidates.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.candidates != null && message.candidates.length)
                                    for (var i = 0; i < message.candidates.length; ++i)
                                        $root.google.ai.generativelanguage.v1.LogprobsResult.Candidate.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                                return writer;
                            };
    
                            /**
                             * Encodes the specified TopCandidates message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.LogprobsResult.TopCandidates.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1.LogprobsResult.ITopCandidates} message TopCandidates message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            TopCandidates.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a TopCandidates message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.TopCandidates
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1.LogprobsResult.TopCandidates} TopCandidates
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            TopCandidates.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.LogprobsResult.TopCandidates();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            if (!(message.candidates && message.candidates.length))
                                                message.candidates = [];
                                            message.candidates.push($root.google.ai.generativelanguage.v1.LogprobsResult.Candidate.decode(reader, reader.uint32()));
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a TopCandidates message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.TopCandidates
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1.LogprobsResult.TopCandidates} TopCandidates
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            TopCandidates.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a TopCandidates message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.TopCandidates
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            TopCandidates.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                    if (!Array.isArray(message.candidates))
                                        return "candidates: array expected";
                                    for (var i = 0; i < message.candidates.length; ++i) {
                                        var error = $root.google.ai.generativelanguage.v1.LogprobsResult.Candidate.verify(message.candidates[i]);
                                        if (error)
                                            return "candidates." + error;
                                    }
                                }
                                return null;
                            };
    
                            /**
                             * Creates a TopCandidates message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.TopCandidates
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1.LogprobsResult.TopCandidates} TopCandidates
                             */
                            TopCandidates.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1.LogprobsResult.TopCandidates)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1.LogprobsResult.TopCandidates();
                                if (object.candidates) {
                                    if (!Array.isArray(object.candidates))
                                        throw TypeError(".google.ai.generativelanguage.v1.LogprobsResult.TopCandidates.candidates: array expected");
                                    message.candidates = [];
                                    for (var i = 0; i < object.candidates.length; ++i) {
                                        if (typeof object.candidates[i] !== "object")
                                            throw TypeError(".google.ai.generativelanguage.v1.LogprobsResult.TopCandidates.candidates: object expected");
                                        message.candidates[i] = $root.google.ai.generativelanguage.v1.LogprobsResult.Candidate.fromObject(object.candidates[i]);
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a TopCandidates message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1.LogprobsResult.TopCandidates} message TopCandidates
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            TopCandidates.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.arrays || options.defaults)
                                    object.candidates = [];
                                if (message.candidates && message.candidates.length) {
                                    object.candidates = [];
                                    for (var j = 0; j < message.candidates.length; ++j)
                                        object.candidates[j] = $root.google.ai.generativelanguage.v1.LogprobsResult.Candidate.toObject(message.candidates[j], options);
                                }
                                return object;
                            };
    
                            /**
                             * Converts this TopCandidates to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.TopCandidates
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            TopCandidates.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for TopCandidates
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1.LogprobsResult.TopCandidates
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            TopCandidates.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1.LogprobsResult.TopCandidates";
                            };
    
                            return TopCandidates;
                        })();
    
                        return LogprobsResult;
                    })();
    
                    v1.RetrievalMetadata = (function() {
    
                        /**
                         * Properties of a RetrievalMetadata.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IRetrievalMetadata
                         * @property {number|null} [googleSearchDynamicRetrievalScore] RetrievalMetadata googleSearchDynamicRetrievalScore
                         */
    
                        /**
                         * Constructs a new RetrievalMetadata.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a RetrievalMetadata.
                         * @implements IRetrievalMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IRetrievalMetadata=} [properties] Properties to set
                         */
                        function RetrievalMetadata(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * RetrievalMetadata googleSearchDynamicRetrievalScore.
                         * @member {number} googleSearchDynamicRetrievalScore
                         * @memberof google.ai.generativelanguage.v1.RetrievalMetadata
                         * @instance
                         */
                        RetrievalMetadata.prototype.googleSearchDynamicRetrievalScore = 0;
    
                        /**
                         * Creates a new RetrievalMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.IRetrievalMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.RetrievalMetadata} RetrievalMetadata instance
                         */
                        RetrievalMetadata.create = function create(properties) {
                            return new RetrievalMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified RetrievalMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1.RetrievalMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.IRetrievalMetadata} message RetrievalMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        RetrievalMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.googleSearchDynamicRetrievalScore != null && Object.hasOwnProperty.call(message, "googleSearchDynamicRetrievalScore"))
                                writer.uint32(/* id 2, wireType 5 =*/21).float(message.googleSearchDynamicRetrievalScore);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified RetrievalMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.RetrievalMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.IRetrievalMetadata} message RetrievalMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        RetrievalMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a RetrievalMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.RetrievalMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.RetrievalMetadata} RetrievalMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        RetrievalMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.RetrievalMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.googleSearchDynamicRetrievalScore = reader.float();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a RetrievalMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.RetrievalMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.RetrievalMetadata} RetrievalMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        RetrievalMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a RetrievalMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.RetrievalMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        RetrievalMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.googleSearchDynamicRetrievalScore != null && message.hasOwnProperty("googleSearchDynamicRetrievalScore"))
                                if (typeof message.googleSearchDynamicRetrievalScore !== "number")
                                    return "googleSearchDynamicRetrievalScore: number expected";
                            return null;
                        };
    
                        /**
                         * Creates a RetrievalMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.RetrievalMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.RetrievalMetadata} RetrievalMetadata
                         */
                        RetrievalMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.RetrievalMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.RetrievalMetadata();
                            if (object.googleSearchDynamicRetrievalScore != null)
                                message.googleSearchDynamicRetrievalScore = Number(object.googleSearchDynamicRetrievalScore);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a RetrievalMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.RetrievalMetadata} message RetrievalMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        RetrievalMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.googleSearchDynamicRetrievalScore = 0;
                            if (message.googleSearchDynamicRetrievalScore != null && message.hasOwnProperty("googleSearchDynamicRetrievalScore"))
                                object.googleSearchDynamicRetrievalScore = options.json && !isFinite(message.googleSearchDynamicRetrievalScore) ? String(message.googleSearchDynamicRetrievalScore) : message.googleSearchDynamicRetrievalScore;
                            return object;
                        };
    
                        /**
                         * Converts this RetrievalMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.RetrievalMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        RetrievalMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for RetrievalMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.RetrievalMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        RetrievalMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.RetrievalMetadata";
                        };
    
                        return RetrievalMetadata;
                    })();
    
                    v1.GroundingMetadata = (function() {
    
                        /**
                         * Properties of a GroundingMetadata.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IGroundingMetadata
                         * @property {google.ai.generativelanguage.v1.ISearchEntryPoint|null} [searchEntryPoint] GroundingMetadata searchEntryPoint
                         * @property {Array.<google.ai.generativelanguage.v1.IGroundingChunk>|null} [groundingChunks] GroundingMetadata groundingChunks
                         * @property {Array.<google.ai.generativelanguage.v1.IGroundingSupport>|null} [groundingSupports] GroundingMetadata groundingSupports
                         * @property {google.ai.generativelanguage.v1.IRetrievalMetadata|null} [retrievalMetadata] GroundingMetadata retrievalMetadata
                         * @property {Array.<string>|null} [webSearchQueries] GroundingMetadata webSearchQueries
                         */
    
                        /**
                         * Constructs a new GroundingMetadata.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a GroundingMetadata.
                         * @implements IGroundingMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IGroundingMetadata=} [properties] Properties to set
                         */
                        function GroundingMetadata(properties) {
                            this.groundingChunks = [];
                            this.groundingSupports = [];
                            this.webSearchQueries = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingMetadata searchEntryPoint.
                         * @member {google.ai.generativelanguage.v1.ISearchEntryPoint|null|undefined} searchEntryPoint
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.searchEntryPoint = null;
    
                        /**
                         * GroundingMetadata groundingChunks.
                         * @member {Array.<google.ai.generativelanguage.v1.IGroundingChunk>} groundingChunks
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.groundingChunks = $util.emptyArray;
    
                        /**
                         * GroundingMetadata groundingSupports.
                         * @member {Array.<google.ai.generativelanguage.v1.IGroundingSupport>} groundingSupports
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.groundingSupports = $util.emptyArray;
    
                        /**
                         * GroundingMetadata retrievalMetadata.
                         * @member {google.ai.generativelanguage.v1.IRetrievalMetadata|null|undefined} retrievalMetadata
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.retrievalMetadata = null;
    
                        /**
                         * GroundingMetadata webSearchQueries.
                         * @member {Array.<string>} webSearchQueries
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.webSearchQueries = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GroundingMetadata _searchEntryPoint.
                         * @member {"searchEntryPoint"|undefined} _searchEntryPoint
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @instance
                         */
                        Object.defineProperty(GroundingMetadata.prototype, "_searchEntryPoint", {
                            get: $util.oneOfGetter($oneOfFields = ["searchEntryPoint"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GroundingMetadata _retrievalMetadata.
                         * @member {"retrievalMetadata"|undefined} _retrievalMetadata
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @instance
                         */
                        Object.defineProperty(GroundingMetadata.prototype, "_retrievalMetadata", {
                            get: $util.oneOfGetter($oneOfFields = ["retrievalMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GroundingMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGroundingMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.GroundingMetadata} GroundingMetadata instance
                         */
                        GroundingMetadata.create = function create(properties) {
                            return new GroundingMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1.GroundingMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGroundingMetadata} message GroundingMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.searchEntryPoint != null && Object.hasOwnProperty.call(message, "searchEntryPoint"))
                                $root.google.ai.generativelanguage.v1.SearchEntryPoint.encode(message.searchEntryPoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.groundingChunks != null && message.groundingChunks.length)
                                for (var i = 0; i < message.groundingChunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1.GroundingChunk.encode(message.groundingChunks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.groundingSupports != null && message.groundingSupports.length)
                                for (var i = 0; i < message.groundingSupports.length; ++i)
                                    $root.google.ai.generativelanguage.v1.GroundingSupport.encode(message.groundingSupports[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.retrievalMetadata != null && Object.hasOwnProperty.call(message, "retrievalMetadata"))
                                $root.google.ai.generativelanguage.v1.RetrievalMetadata.encode(message.retrievalMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.webSearchQueries != null && message.webSearchQueries.length)
                                for (var i = 0; i < message.webSearchQueries.length; ++i)
                                    writer.uint32(/* id 5, wireType 2 =*/42).string(message.webSearchQueries[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.GroundingMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGroundingMetadata} message GroundingMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.GroundingMetadata} GroundingMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.GroundingMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.searchEntryPoint = $root.google.ai.generativelanguage.v1.SearchEntryPoint.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        if (!(message.groundingChunks && message.groundingChunks.length))
                                            message.groundingChunks = [];
                                        message.groundingChunks.push($root.google.ai.generativelanguage.v1.GroundingChunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.groundingSupports && message.groundingSupports.length))
                                            message.groundingSupports = [];
                                        message.groundingSupports.push($root.google.ai.generativelanguage.v1.GroundingSupport.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.retrievalMetadata = $root.google.ai.generativelanguage.v1.RetrievalMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        if (!(message.webSearchQueries && message.webSearchQueries.length))
                                            message.webSearchQueries = [];
                                        message.webSearchQueries.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.GroundingMetadata} GroundingMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.searchEntryPoint != null && message.hasOwnProperty("searchEntryPoint")) {
                                properties._searchEntryPoint = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1.SearchEntryPoint.verify(message.searchEntryPoint);
                                    if (error)
                                        return "searchEntryPoint." + error;
                                }
                            }
                            if (message.groundingChunks != null && message.hasOwnProperty("groundingChunks")) {
                                if (!Array.isArray(message.groundingChunks))
                                    return "groundingChunks: array expected";
                                for (var i = 0; i < message.groundingChunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.GroundingChunk.verify(message.groundingChunks[i]);
                                    if (error)
                                        return "groundingChunks." + error;
                                }
                            }
                            if (message.groundingSupports != null && message.hasOwnProperty("groundingSupports")) {
                                if (!Array.isArray(message.groundingSupports))
                                    return "groundingSupports: array expected";
                                for (var i = 0; i < message.groundingSupports.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.GroundingSupport.verify(message.groundingSupports[i]);
                                    if (error)
                                        return "groundingSupports." + error;
                                }
                            }
                            if (message.retrievalMetadata != null && message.hasOwnProperty("retrievalMetadata")) {
                                properties._retrievalMetadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1.RetrievalMetadata.verify(message.retrievalMetadata);
                                    if (error)
                                        return "retrievalMetadata." + error;
                                }
                            }
                            if (message.webSearchQueries != null && message.hasOwnProperty("webSearchQueries")) {
                                if (!Array.isArray(message.webSearchQueries))
                                    return "webSearchQueries: array expected";
                                for (var i = 0; i < message.webSearchQueries.length; ++i)
                                    if (!$util.isString(message.webSearchQueries[i]))
                                        return "webSearchQueries: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.GroundingMetadata} GroundingMetadata
                         */
                        GroundingMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.GroundingMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.GroundingMetadata();
                            if (object.searchEntryPoint != null) {
                                if (typeof object.searchEntryPoint !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.GroundingMetadata.searchEntryPoint: object expected");
                                message.searchEntryPoint = $root.google.ai.generativelanguage.v1.SearchEntryPoint.fromObject(object.searchEntryPoint);
                            }
                            if (object.groundingChunks) {
                                if (!Array.isArray(object.groundingChunks))
                                    throw TypeError(".google.ai.generativelanguage.v1.GroundingMetadata.groundingChunks: array expected");
                                message.groundingChunks = [];
                                for (var i = 0; i < object.groundingChunks.length; ++i) {
                                    if (typeof object.groundingChunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.GroundingMetadata.groundingChunks: object expected");
                                    message.groundingChunks[i] = $root.google.ai.generativelanguage.v1.GroundingChunk.fromObject(object.groundingChunks[i]);
                                }
                            }
                            if (object.groundingSupports) {
                                if (!Array.isArray(object.groundingSupports))
                                    throw TypeError(".google.ai.generativelanguage.v1.GroundingMetadata.groundingSupports: array expected");
                                message.groundingSupports = [];
                                for (var i = 0; i < object.groundingSupports.length; ++i) {
                                    if (typeof object.groundingSupports[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.GroundingMetadata.groundingSupports: object expected");
                                    message.groundingSupports[i] = $root.google.ai.generativelanguage.v1.GroundingSupport.fromObject(object.groundingSupports[i]);
                                }
                            }
                            if (object.retrievalMetadata != null) {
                                if (typeof object.retrievalMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.GroundingMetadata.retrievalMetadata: object expected");
                                message.retrievalMetadata = $root.google.ai.generativelanguage.v1.RetrievalMetadata.fromObject(object.retrievalMetadata);
                            }
                            if (object.webSearchQueries) {
                                if (!Array.isArray(object.webSearchQueries))
                                    throw TypeError(".google.ai.generativelanguage.v1.GroundingMetadata.webSearchQueries: array expected");
                                message.webSearchQueries = [];
                                for (var i = 0; i < object.webSearchQueries.length; ++i)
                                    message.webSearchQueries[i] = String(object.webSearchQueries[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1.GroundingMetadata} message GroundingMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.groundingChunks = [];
                                object.groundingSupports = [];
                                object.webSearchQueries = [];
                            }
                            if (message.searchEntryPoint != null && message.hasOwnProperty("searchEntryPoint")) {
                                object.searchEntryPoint = $root.google.ai.generativelanguage.v1.SearchEntryPoint.toObject(message.searchEntryPoint, options);
                                if (options.oneofs)
                                    object._searchEntryPoint = "searchEntryPoint";
                            }
                            if (message.groundingChunks && message.groundingChunks.length) {
                                object.groundingChunks = [];
                                for (var j = 0; j < message.groundingChunks.length; ++j)
                                    object.groundingChunks[j] = $root.google.ai.generativelanguage.v1.GroundingChunk.toObject(message.groundingChunks[j], options);
                            }
                            if (message.groundingSupports && message.groundingSupports.length) {
                                object.groundingSupports = [];
                                for (var j = 0; j < message.groundingSupports.length; ++j)
                                    object.groundingSupports[j] = $root.google.ai.generativelanguage.v1.GroundingSupport.toObject(message.groundingSupports[j], options);
                            }
                            if (message.retrievalMetadata != null && message.hasOwnProperty("retrievalMetadata")) {
                                object.retrievalMetadata = $root.google.ai.generativelanguage.v1.RetrievalMetadata.toObject(message.retrievalMetadata, options);
                                if (options.oneofs)
                                    object._retrievalMetadata = "retrievalMetadata";
                            }
                            if (message.webSearchQueries && message.webSearchQueries.length) {
                                object.webSearchQueries = [];
                                for (var j = 0; j < message.webSearchQueries.length; ++j)
                                    object.webSearchQueries[j] = message.webSearchQueries[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GroundingMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.GroundingMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.GroundingMetadata";
                        };
    
                        return GroundingMetadata;
                    })();
    
                    v1.SearchEntryPoint = (function() {
    
                        /**
                         * Properties of a SearchEntryPoint.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface ISearchEntryPoint
                         * @property {string|null} [renderedContent] SearchEntryPoint renderedContent
                         * @property {Uint8Array|null} [sdkBlob] SearchEntryPoint sdkBlob
                         */
    
                        /**
                         * Constructs a new SearchEntryPoint.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a SearchEntryPoint.
                         * @implements ISearchEntryPoint
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.ISearchEntryPoint=} [properties] Properties to set
                         */
                        function SearchEntryPoint(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SearchEntryPoint renderedContent.
                         * @member {string} renderedContent
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @instance
                         */
                        SearchEntryPoint.prototype.renderedContent = "";
    
                        /**
                         * SearchEntryPoint sdkBlob.
                         * @member {Uint8Array} sdkBlob
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @instance
                         */
                        SearchEntryPoint.prototype.sdkBlob = $util.newBuffer([]);
    
                        /**
                         * Creates a new SearchEntryPoint instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISearchEntryPoint=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.SearchEntryPoint} SearchEntryPoint instance
                         */
                        SearchEntryPoint.create = function create(properties) {
                            return new SearchEntryPoint(properties);
                        };
    
                        /**
                         * Encodes the specified SearchEntryPoint message. Does not implicitly {@link google.ai.generativelanguage.v1.SearchEntryPoint.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISearchEntryPoint} message SearchEntryPoint message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SearchEntryPoint.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.renderedContent != null && Object.hasOwnProperty.call(message, "renderedContent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderedContent);
                            if (message.sdkBlob != null && Object.hasOwnProperty.call(message, "sdkBlob"))
                                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.sdkBlob);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SearchEntryPoint message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.SearchEntryPoint.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISearchEntryPoint} message SearchEntryPoint message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SearchEntryPoint.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SearchEntryPoint message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.SearchEntryPoint} SearchEntryPoint
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SearchEntryPoint.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.SearchEntryPoint();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.renderedContent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.sdkBlob = reader.bytes();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SearchEntryPoint message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.SearchEntryPoint} SearchEntryPoint
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SearchEntryPoint.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SearchEntryPoint message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SearchEntryPoint.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.renderedContent != null && message.hasOwnProperty("renderedContent"))
                                if (!$util.isString(message.renderedContent))
                                    return "renderedContent: string expected";
                            if (message.sdkBlob != null && message.hasOwnProperty("sdkBlob"))
                                if (!(message.sdkBlob && typeof message.sdkBlob.length === "number" || $util.isString(message.sdkBlob)))
                                    return "sdkBlob: buffer expected";
                            return null;
                        };
    
                        /**
                         * Creates a SearchEntryPoint message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.SearchEntryPoint} SearchEntryPoint
                         */
                        SearchEntryPoint.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.SearchEntryPoint)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.SearchEntryPoint();
                            if (object.renderedContent != null)
                                message.renderedContent = String(object.renderedContent);
                            if (object.sdkBlob != null)
                                if (typeof object.sdkBlob === "string")
                                    $util.base64.decode(object.sdkBlob, message.sdkBlob = $util.newBuffer($util.base64.length(object.sdkBlob)), 0);
                                else if (object.sdkBlob.length >= 0)
                                    message.sdkBlob = object.sdkBlob;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SearchEntryPoint message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1.SearchEntryPoint} message SearchEntryPoint
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SearchEntryPoint.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.renderedContent = "";
                                if (options.bytes === String)
                                    object.sdkBlob = "";
                                else {
                                    object.sdkBlob = [];
                                    if (options.bytes !== Array)
                                        object.sdkBlob = $util.newBuffer(object.sdkBlob);
                                }
                            }
                            if (message.renderedContent != null && message.hasOwnProperty("renderedContent"))
                                object.renderedContent = message.renderedContent;
                            if (message.sdkBlob != null && message.hasOwnProperty("sdkBlob"))
                                object.sdkBlob = options.bytes === String ? $util.base64.encode(message.sdkBlob, 0, message.sdkBlob.length) : options.bytes === Array ? Array.prototype.slice.call(message.sdkBlob) : message.sdkBlob;
                            return object;
                        };
    
                        /**
                         * Converts this SearchEntryPoint to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SearchEntryPoint.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SearchEntryPoint
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.SearchEntryPoint
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SearchEntryPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.SearchEntryPoint";
                        };
    
                        return SearchEntryPoint;
                    })();
    
                    v1.GroundingChunk = (function() {
    
                        /**
                         * Properties of a GroundingChunk.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IGroundingChunk
                         * @property {google.ai.generativelanguage.v1.GroundingChunk.IWeb|null} [web] GroundingChunk web
                         */
    
                        /**
                         * Constructs a new GroundingChunk.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a GroundingChunk.
                         * @implements IGroundingChunk
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IGroundingChunk=} [properties] Properties to set
                         */
                        function GroundingChunk(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingChunk web.
                         * @member {google.ai.generativelanguage.v1.GroundingChunk.IWeb|null|undefined} web
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @instance
                         */
                        GroundingChunk.prototype.web = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GroundingChunk chunkType.
                         * @member {"web"|undefined} chunkType
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @instance
                         */
                        Object.defineProperty(GroundingChunk.prototype, "chunkType", {
                            get: $util.oneOfGetter($oneOfFields = ["web"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GroundingChunk instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGroundingChunk=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.GroundingChunk} GroundingChunk instance
                         */
                        GroundingChunk.create = function create(properties) {
                            return new GroundingChunk(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingChunk message. Does not implicitly {@link google.ai.generativelanguage.v1.GroundingChunk.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGroundingChunk} message GroundingChunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingChunk.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.web != null && Object.hasOwnProperty.call(message, "web"))
                                $root.google.ai.generativelanguage.v1.GroundingChunk.Web.encode(message.web, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.GroundingChunk.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGroundingChunk} message GroundingChunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingChunk.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingChunk message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.GroundingChunk} GroundingChunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingChunk.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.GroundingChunk();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.web = $root.google.ai.generativelanguage.v1.GroundingChunk.Web.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingChunk message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.GroundingChunk} GroundingChunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingChunk.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingChunk message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingChunk.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.web != null && message.hasOwnProperty("web")) {
                                properties.chunkType = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1.GroundingChunk.Web.verify(message.web);
                                    if (error)
                                        return "web." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingChunk message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.GroundingChunk} GroundingChunk
                         */
                        GroundingChunk.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.GroundingChunk)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.GroundingChunk();
                            if (object.web != null) {
                                if (typeof object.web !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.GroundingChunk.web: object expected");
                                message.web = $root.google.ai.generativelanguage.v1.GroundingChunk.Web.fromObject(object.web);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingChunk message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1.GroundingChunk} message GroundingChunk
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingChunk.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.web != null && message.hasOwnProperty("web")) {
                                object.web = $root.google.ai.generativelanguage.v1.GroundingChunk.Web.toObject(message.web, options);
                                if (options.oneofs)
                                    object.chunkType = "web";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GroundingChunk to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingChunk.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingChunk
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.GroundingChunk
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.GroundingChunk";
                        };
    
                        GroundingChunk.Web = (function() {
    
                            /**
                             * Properties of a Web.
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk
                             * @interface IWeb
                             * @property {string|null} [uri] Web uri
                             * @property {string|null} [title] Web title
                             */
    
                            /**
                             * Constructs a new Web.
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk
                             * @classdesc Represents a Web.
                             * @implements IWeb
                             * @constructor
                             * @param {google.ai.generativelanguage.v1.GroundingChunk.IWeb=} [properties] Properties to set
                             */
                            function Web(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * Web uri.
                             * @member {string|null|undefined} uri
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @instance
                             */
                            Web.prototype.uri = null;
    
                            /**
                             * Web title.
                             * @member {string|null|undefined} title
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @instance
                             */
                            Web.prototype.title = null;
    
                            // OneOf field names bound to virtual getters and setters
                            var $oneOfFields;
    
                            /**
                             * Web _uri.
                             * @member {"uri"|undefined} _uri
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @instance
                             */
                            Object.defineProperty(Web.prototype, "_uri", {
                                get: $util.oneOfGetter($oneOfFields = ["uri"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Web _title.
                             * @member {"title"|undefined} _title
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @instance
                             */
                            Object.defineProperty(Web.prototype, "_title", {
                                get: $util.oneOfGetter($oneOfFields = ["title"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Creates a new Web instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1.GroundingChunk.IWeb=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1.GroundingChunk.Web} Web instance
                             */
                            Web.create = function create(properties) {
                                return new Web(properties);
                            };
    
                            /**
                             * Encodes the specified Web message. Does not implicitly {@link google.ai.generativelanguage.v1.GroundingChunk.Web.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1.GroundingChunk.IWeb} message Web message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Web.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri);
                                if (message.title != null && Object.hasOwnProperty.call(message, "title"))
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.title);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified Web message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.GroundingChunk.Web.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1.GroundingChunk.IWeb} message Web message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Web.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a Web message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1.GroundingChunk.Web} Web
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Web.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.GroundingChunk.Web();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.uri = reader.string();
                                            break;
                                        }
                                    case 2: {
                                            message.title = reader.string();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a Web message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1.GroundingChunk.Web} Web
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Web.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a Web message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            Web.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                var properties = {};
                                if (message.uri != null && message.hasOwnProperty("uri")) {
                                    properties._uri = 1;
                                    if (!$util.isString(message.uri))
                                        return "uri: string expected";
                                }
                                if (message.title != null && message.hasOwnProperty("title")) {
                                    properties._title = 1;
                                    if (!$util.isString(message.title))
                                        return "title: string expected";
                                }
                                return null;
                            };
    
                            /**
                             * Creates a Web message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1.GroundingChunk.Web} Web
                             */
                            Web.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1.GroundingChunk.Web)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1.GroundingChunk.Web();
                                if (object.uri != null)
                                    message.uri = String(object.uri);
                                if (object.title != null)
                                    message.title = String(object.title);
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a Web message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1.GroundingChunk.Web} message Web
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            Web.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (message.uri != null && message.hasOwnProperty("uri")) {
                                    object.uri = message.uri;
                                    if (options.oneofs)
                                        object._uri = "uri";
                                }
                                if (message.title != null && message.hasOwnProperty("title")) {
                                    object.title = message.title;
                                    if (options.oneofs)
                                        object._title = "title";
                                }
                                return object;
                            };
    
                            /**
                             * Converts this Web to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            Web.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for Web
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1.GroundingChunk.Web
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            Web.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1.GroundingChunk.Web";
                            };
    
                            return Web;
                        })();
    
                        return GroundingChunk;
                    })();
    
                    v1.Segment = (function() {
    
                        /**
                         * Properties of a Segment.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface ISegment
                         * @property {number|null} [partIndex] Segment partIndex
                         * @property {number|null} [startIndex] Segment startIndex
                         * @property {number|null} [endIndex] Segment endIndex
                         * @property {string|null} [text] Segment text
                         */
    
                        /**
                         * Constructs a new Segment.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a Segment.
                         * @implements ISegment
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.ISegment=} [properties] Properties to set
                         */
                        function Segment(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Segment partIndex.
                         * @member {number} partIndex
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @instance
                         */
                        Segment.prototype.partIndex = 0;
    
                        /**
                         * Segment startIndex.
                         * @member {number} startIndex
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @instance
                         */
                        Segment.prototype.startIndex = 0;
    
                        /**
                         * Segment endIndex.
                         * @member {number} endIndex
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @instance
                         */
                        Segment.prototype.endIndex = 0;
    
                        /**
                         * Segment text.
                         * @member {string} text
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @instance
                         */
                        Segment.prototype.text = "";
    
                        /**
                         * Creates a new Segment instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISegment=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.Segment} Segment instance
                         */
                        Segment.create = function create(properties) {
                            return new Segment(properties);
                        };
    
                        /**
                         * Encodes the specified Segment message. Does not implicitly {@link google.ai.generativelanguage.v1.Segment.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISegment} message Segment message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Segment.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.partIndex != null && Object.hasOwnProperty.call(message, "partIndex"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.partIndex);
                            if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.startIndex);
                            if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.endIndex);
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Segment message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.Segment.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISegment} message Segment message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Segment.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Segment message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.Segment} Segment
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Segment.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.Segment();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.partIndex = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.startIndex = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.endIndex = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Segment message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.Segment} Segment
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Segment.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Segment message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Segment.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.partIndex != null && message.hasOwnProperty("partIndex"))
                                if (!$util.isInteger(message.partIndex))
                                    return "partIndex: integer expected";
                            if (message.startIndex != null && message.hasOwnProperty("startIndex"))
                                if (!$util.isInteger(message.startIndex))
                                    return "startIndex: integer expected";
                            if (message.endIndex != null && message.hasOwnProperty("endIndex"))
                                if (!$util.isInteger(message.endIndex))
                                    return "endIndex: integer expected";
                            if (message.text != null && message.hasOwnProperty("text"))
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a Segment message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.Segment} Segment
                         */
                        Segment.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.Segment)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.Segment();
                            if (object.partIndex != null)
                                message.partIndex = object.partIndex | 0;
                            if (object.startIndex != null)
                                message.startIndex = object.startIndex | 0;
                            if (object.endIndex != null)
                                message.endIndex = object.endIndex | 0;
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Segment message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1.Segment} message Segment
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Segment.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.partIndex = 0;
                                object.startIndex = 0;
                                object.endIndex = 0;
                                object.text = "";
                            }
                            if (message.partIndex != null && message.hasOwnProperty("partIndex"))
                                object.partIndex = message.partIndex;
                            if (message.startIndex != null && message.hasOwnProperty("startIndex"))
                                object.startIndex = message.startIndex;
                            if (message.endIndex != null && message.hasOwnProperty("endIndex"))
                                object.endIndex = message.endIndex;
                            if (message.text != null && message.hasOwnProperty("text"))
                                object.text = message.text;
                            return object;
                        };
    
                        /**
                         * Converts this Segment to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Segment.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Segment
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.Segment
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Segment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.Segment";
                        };
    
                        return Segment;
                    })();
    
                    v1.GroundingSupport = (function() {
    
                        /**
                         * Properties of a GroundingSupport.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IGroundingSupport
                         * @property {google.ai.generativelanguage.v1.ISegment|null} [segment] GroundingSupport segment
                         * @property {Array.<number>|null} [groundingChunkIndices] GroundingSupport groundingChunkIndices
                         * @property {Array.<number>|null} [confidenceScores] GroundingSupport confidenceScores
                         */
    
                        /**
                         * Constructs a new GroundingSupport.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a GroundingSupport.
                         * @implements IGroundingSupport
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IGroundingSupport=} [properties] Properties to set
                         */
                        function GroundingSupport(properties) {
                            this.groundingChunkIndices = [];
                            this.confidenceScores = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingSupport segment.
                         * @member {google.ai.generativelanguage.v1.ISegment|null|undefined} segment
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @instance
                         */
                        GroundingSupport.prototype.segment = null;
    
                        /**
                         * GroundingSupport groundingChunkIndices.
                         * @member {Array.<number>} groundingChunkIndices
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @instance
                         */
                        GroundingSupport.prototype.groundingChunkIndices = $util.emptyArray;
    
                        /**
                         * GroundingSupport confidenceScores.
                         * @member {Array.<number>} confidenceScores
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @instance
                         */
                        GroundingSupport.prototype.confidenceScores = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GroundingSupport _segment.
                         * @member {"segment"|undefined} _segment
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @instance
                         */
                        Object.defineProperty(GroundingSupport.prototype, "_segment", {
                            get: $util.oneOfGetter($oneOfFields = ["segment"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GroundingSupport instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGroundingSupport=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.GroundingSupport} GroundingSupport instance
                         */
                        GroundingSupport.create = function create(properties) {
                            return new GroundingSupport(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingSupport message. Does not implicitly {@link google.ai.generativelanguage.v1.GroundingSupport.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGroundingSupport} message GroundingSupport message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingSupport.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.segment != null && Object.hasOwnProperty.call(message, "segment"))
                                $root.google.ai.generativelanguage.v1.Segment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.groundingChunkIndices != null && message.groundingChunkIndices.length) {
                                writer.uint32(/* id 2, wireType 2 =*/18).fork();
                                for (var i = 0; i < message.groundingChunkIndices.length; ++i)
                                    writer.int32(message.groundingChunkIndices[i]);
                                writer.ldelim();
                            }
                            if (message.confidenceScores != null && message.confidenceScores.length) {
                                writer.uint32(/* id 3, wireType 2 =*/26).fork();
                                for (var i = 0; i < message.confidenceScores.length; ++i)
                                    writer.float(message.confidenceScores[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingSupport message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.GroundingSupport.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGroundingSupport} message GroundingSupport message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingSupport.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingSupport message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.GroundingSupport} GroundingSupport
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingSupport.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.GroundingSupport();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.segment = $root.google.ai.generativelanguage.v1.Segment.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        if (!(message.groundingChunkIndices && message.groundingChunkIndices.length))
                                            message.groundingChunkIndices = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.groundingChunkIndices.push(reader.int32());
                                        } else
                                            message.groundingChunkIndices.push(reader.int32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.confidenceScores && message.confidenceScores.length))
                                            message.confidenceScores = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.confidenceScores.push(reader.float());
                                        } else
                                            message.confidenceScores.push(reader.float());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingSupport message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.GroundingSupport} GroundingSupport
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingSupport.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingSupport message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingSupport.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.segment != null && message.hasOwnProperty("segment")) {
                                properties._segment = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1.Segment.verify(message.segment);
                                    if (error)
                                        return "segment." + error;
                                }
                            }
                            if (message.groundingChunkIndices != null && message.hasOwnProperty("groundingChunkIndices")) {
                                if (!Array.isArray(message.groundingChunkIndices))
                                    return "groundingChunkIndices: array expected";
                                for (var i = 0; i < message.groundingChunkIndices.length; ++i)
                                    if (!$util.isInteger(message.groundingChunkIndices[i]))
                                        return "groundingChunkIndices: integer[] expected";
                            }
                            if (message.confidenceScores != null && message.hasOwnProperty("confidenceScores")) {
                                if (!Array.isArray(message.confidenceScores))
                                    return "confidenceScores: array expected";
                                for (var i = 0; i < message.confidenceScores.length; ++i)
                                    if (typeof message.confidenceScores[i] !== "number")
                                        return "confidenceScores: number[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingSupport message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.GroundingSupport} GroundingSupport
                         */
                        GroundingSupport.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.GroundingSupport)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.GroundingSupport();
                            if (object.segment != null) {
                                if (typeof object.segment !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.GroundingSupport.segment: object expected");
                                message.segment = $root.google.ai.generativelanguage.v1.Segment.fromObject(object.segment);
                            }
                            if (object.groundingChunkIndices) {
                                if (!Array.isArray(object.groundingChunkIndices))
                                    throw TypeError(".google.ai.generativelanguage.v1.GroundingSupport.groundingChunkIndices: array expected");
                                message.groundingChunkIndices = [];
                                for (var i = 0; i < object.groundingChunkIndices.length; ++i)
                                    message.groundingChunkIndices[i] = object.groundingChunkIndices[i] | 0;
                            }
                            if (object.confidenceScores) {
                                if (!Array.isArray(object.confidenceScores))
                                    throw TypeError(".google.ai.generativelanguage.v1.GroundingSupport.confidenceScores: array expected");
                                message.confidenceScores = [];
                                for (var i = 0; i < object.confidenceScores.length; ++i)
                                    message.confidenceScores[i] = Number(object.confidenceScores[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingSupport message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1.GroundingSupport} message GroundingSupport
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingSupport.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.groundingChunkIndices = [];
                                object.confidenceScores = [];
                            }
                            if (message.segment != null && message.hasOwnProperty("segment")) {
                                object.segment = $root.google.ai.generativelanguage.v1.Segment.toObject(message.segment, options);
                                if (options.oneofs)
                                    object._segment = "segment";
                            }
                            if (message.groundingChunkIndices && message.groundingChunkIndices.length) {
                                object.groundingChunkIndices = [];
                                for (var j = 0; j < message.groundingChunkIndices.length; ++j)
                                    object.groundingChunkIndices[j] = message.groundingChunkIndices[j];
                            }
                            if (message.confidenceScores && message.confidenceScores.length) {
                                object.confidenceScores = [];
                                for (var j = 0; j < message.confidenceScores.length; ++j)
                                    object.confidenceScores[j] = options.json && !isFinite(message.confidenceScores[j]) ? String(message.confidenceScores[j]) : message.confidenceScores[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GroundingSupport to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingSupport.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingSupport
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.GroundingSupport
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.GroundingSupport";
                        };
    
                        return GroundingSupport;
                    })();
    
                    v1.EmbedContentRequest = (function() {
    
                        /**
                         * Properties of an EmbedContentRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IEmbedContentRequest
                         * @property {string|null} [model] EmbedContentRequest model
                         * @property {google.ai.generativelanguage.v1.IContent|null} [content] EmbedContentRequest content
                         * @property {google.ai.generativelanguage.v1.TaskType|null} [taskType] EmbedContentRequest taskType
                         * @property {string|null} [title] EmbedContentRequest title
                         * @property {number|null} [outputDimensionality] EmbedContentRequest outputDimensionality
                         */
    
                        /**
                         * Constructs a new EmbedContentRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents an EmbedContentRequest.
                         * @implements IEmbedContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IEmbedContentRequest=} [properties] Properties to set
                         */
                        function EmbedContentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedContentRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.model = "";
    
                        /**
                         * EmbedContentRequest content.
                         * @member {google.ai.generativelanguage.v1.IContent|null|undefined} content
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.content = null;
    
                        /**
                         * EmbedContentRequest taskType.
                         * @member {google.ai.generativelanguage.v1.TaskType|null|undefined} taskType
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.taskType = null;
    
                        /**
                         * EmbedContentRequest title.
                         * @member {string|null|undefined} title
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.title = null;
    
                        /**
                         * EmbedContentRequest outputDimensionality.
                         * @member {number|null|undefined} outputDimensionality
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.outputDimensionality = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * EmbedContentRequest _taskType.
                         * @member {"taskType"|undefined} _taskType
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @instance
                         */
                        Object.defineProperty(EmbedContentRequest.prototype, "_taskType", {
                            get: $util.oneOfGetter($oneOfFields = ["taskType"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * EmbedContentRequest _title.
                         * @member {"title"|undefined} _title
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @instance
                         */
                        Object.defineProperty(EmbedContentRequest.prototype, "_title", {
                            get: $util.oneOfGetter($oneOfFields = ["title"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * EmbedContentRequest _outputDimensionality.
                         * @member {"outputDimensionality"|undefined} _outputDimensionality
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @instance
                         */
                        Object.defineProperty(EmbedContentRequest.prototype, "_outputDimensionality", {
                            get: $util.oneOfGetter($oneOfFields = ["outputDimensionality"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new EmbedContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IEmbedContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.EmbedContentRequest} EmbedContentRequest instance
                         */
                        EmbedContentRequest.create = function create(properties) {
                            return new EmbedContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1.EmbedContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IEmbedContentRequest} message EmbedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                $root.google.ai.generativelanguage.v1.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.taskType != null && Object.hasOwnProperty.call(message, "taskType"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.taskType);
                            if (message.title != null && Object.hasOwnProperty.call(message, "title"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.title);
                            if (message.outputDimensionality != null && Object.hasOwnProperty.call(message, "outputDimensionality"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.outputDimensionality);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.EmbedContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IEmbedContentRequest} message EmbedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.EmbedContentRequest} EmbedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.EmbedContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.content = $root.google.ai.generativelanguage.v1.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.taskType = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.title = reader.string();
                                        break;
                                    }
                                case 5: {
                                        message.outputDimensionality = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.EmbedContentRequest} EmbedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.content != null && message.hasOwnProperty("content")) {
                                var error = $root.google.ai.generativelanguage.v1.Content.verify(message.content);
                                if (error)
                                    return "content." + error;
                            }
                            if (message.taskType != null && message.hasOwnProperty("taskType")) {
                                properties._taskType = 1;
                                switch (message.taskType) {
                                default:
                                    return "taskType: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                    break;
                                }
                            }
                            if (message.title != null && message.hasOwnProperty("title")) {
                                properties._title = 1;
                                if (!$util.isString(message.title))
                                    return "title: string expected";
                            }
                            if (message.outputDimensionality != null && message.hasOwnProperty("outputDimensionality")) {
                                properties._outputDimensionality = 1;
                                if (!$util.isInteger(message.outputDimensionality))
                                    return "outputDimensionality: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates an EmbedContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.EmbedContentRequest} EmbedContentRequest
                         */
                        EmbedContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.EmbedContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.EmbedContentRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.content != null) {
                                if (typeof object.content !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.EmbedContentRequest.content: object expected");
                                message.content = $root.google.ai.generativelanguage.v1.Content.fromObject(object.content);
                            }
                            switch (object.taskType) {
                            default:
                                if (typeof object.taskType === "number") {
                                    message.taskType = object.taskType;
                                    break;
                                }
                                break;
                            case "TASK_TYPE_UNSPECIFIED":
                            case 0:
                                message.taskType = 0;
                                break;
                            case "RETRIEVAL_QUERY":
                            case 1:
                                message.taskType = 1;
                                break;
                            case "RETRIEVAL_DOCUMENT":
                            case 2:
                                message.taskType = 2;
                                break;
                            case "SEMANTIC_SIMILARITY":
                            case 3:
                                message.taskType = 3;
                                break;
                            case "CLASSIFICATION":
                            case 4:
                                message.taskType = 4;
                                break;
                            case "CLUSTERING":
                            case 5:
                                message.taskType = 5;
                                break;
                            case "QUESTION_ANSWERING":
                            case 6:
                                message.taskType = 6;
                                break;
                            case "FACT_VERIFICATION":
                            case 7:
                                message.taskType = 7;
                                break;
                            }
                            if (object.title != null)
                                message.title = String(object.title);
                            if (object.outputDimensionality != null)
                                message.outputDimensionality = object.outputDimensionality | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.EmbedContentRequest} message EmbedContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.content = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = $root.google.ai.generativelanguage.v1.Content.toObject(message.content, options);
                            if (message.taskType != null && message.hasOwnProperty("taskType")) {
                                object.taskType = options.enums === String ? $root.google.ai.generativelanguage.v1.TaskType[message.taskType] === undefined ? message.taskType : $root.google.ai.generativelanguage.v1.TaskType[message.taskType] : message.taskType;
                                if (options.oneofs)
                                    object._taskType = "taskType";
                            }
                            if (message.title != null && message.hasOwnProperty("title")) {
                                object.title = message.title;
                                if (options.oneofs)
                                    object._title = "title";
                            }
                            if (message.outputDimensionality != null && message.hasOwnProperty("outputDimensionality")) {
                                object.outputDimensionality = message.outputDimensionality;
                                if (options.oneofs)
                                    object._outputDimensionality = "outputDimensionality";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this EmbedContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.EmbedContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.EmbedContentRequest";
                        };
    
                        return EmbedContentRequest;
                    })();
    
                    v1.ContentEmbedding = (function() {
    
                        /**
                         * Properties of a ContentEmbedding.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IContentEmbedding
                         * @property {Array.<number>|null} [values] ContentEmbedding values
                         */
    
                        /**
                         * Constructs a new ContentEmbedding.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a ContentEmbedding.
                         * @implements IContentEmbedding
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IContentEmbedding=} [properties] Properties to set
                         */
                        function ContentEmbedding(properties) {
                            this.values = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ContentEmbedding values.
                         * @member {Array.<number>} values
                         * @memberof google.ai.generativelanguage.v1.ContentEmbedding
                         * @instance
                         */
                        ContentEmbedding.prototype.values = $util.emptyArray;
    
                        /**
                         * Creates a new ContentEmbedding instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1.IContentEmbedding=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.ContentEmbedding} ContentEmbedding instance
                         */
                        ContentEmbedding.create = function create(properties) {
                            return new ContentEmbedding(properties);
                        };
    
                        /**
                         * Encodes the specified ContentEmbedding message. Does not implicitly {@link google.ai.generativelanguage.v1.ContentEmbedding.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1.IContentEmbedding} message ContentEmbedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentEmbedding.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.values != null && message.values.length) {
                                writer.uint32(/* id 1, wireType 2 =*/10).fork();
                                for (var i = 0; i < message.values.length; ++i)
                                    writer.float(message.values[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ContentEmbedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.ContentEmbedding.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1.IContentEmbedding} message ContentEmbedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentEmbedding.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ContentEmbedding message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.ContentEmbedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.ContentEmbedding} ContentEmbedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentEmbedding.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.ContentEmbedding();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.values && message.values.length))
                                            message.values = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.values.push(reader.float());
                                        } else
                                            message.values.push(reader.float());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ContentEmbedding message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.ContentEmbedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.ContentEmbedding} ContentEmbedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentEmbedding.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ContentEmbedding message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.ContentEmbedding
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ContentEmbedding.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.values != null && message.hasOwnProperty("values")) {
                                if (!Array.isArray(message.values))
                                    return "values: array expected";
                                for (var i = 0; i < message.values.length; ++i)
                                    if (typeof message.values[i] !== "number")
                                        return "values: number[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a ContentEmbedding message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.ContentEmbedding
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.ContentEmbedding} ContentEmbedding
                         */
                        ContentEmbedding.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.ContentEmbedding)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.ContentEmbedding();
                            if (object.values) {
                                if (!Array.isArray(object.values))
                                    throw TypeError(".google.ai.generativelanguage.v1.ContentEmbedding.values: array expected");
                                message.values = [];
                                for (var i = 0; i < object.values.length; ++i)
                                    message.values[i] = Number(object.values[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ContentEmbedding message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1.ContentEmbedding} message ContentEmbedding
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ContentEmbedding.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.values = [];
                            if (message.values && message.values.length) {
                                object.values = [];
                                for (var j = 0; j < message.values.length; ++j)
                                    object.values[j] = options.json && !isFinite(message.values[j]) ? String(message.values[j]) : message.values[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this ContentEmbedding to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.ContentEmbedding
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ContentEmbedding.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ContentEmbedding
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.ContentEmbedding
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ContentEmbedding.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.ContentEmbedding";
                        };
    
                        return ContentEmbedding;
                    })();
    
                    v1.EmbedContentResponse = (function() {
    
                        /**
                         * Properties of an EmbedContentResponse.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IEmbedContentResponse
                         * @property {google.ai.generativelanguage.v1.IContentEmbedding|null} [embedding] EmbedContentResponse embedding
                         */
    
                        /**
                         * Constructs a new EmbedContentResponse.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents an EmbedContentResponse.
                         * @implements IEmbedContentResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IEmbedContentResponse=} [properties] Properties to set
                         */
                        function EmbedContentResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedContentResponse embedding.
                         * @member {google.ai.generativelanguage.v1.IContentEmbedding|null|undefined} embedding
                         * @memberof google.ai.generativelanguage.v1.EmbedContentResponse
                         * @instance
                         */
                        EmbedContentResponse.prototype.embedding = null;
    
                        /**
                         * Creates a new EmbedContentResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IEmbedContentResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.EmbedContentResponse} EmbedContentResponse instance
                         */
                        EmbedContentResponse.create = function create(properties) {
                            return new EmbedContentResponse(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedContentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1.EmbedContentResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IEmbedContentResponse} message EmbedContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embedding != null && Object.hasOwnProperty.call(message, "embedding"))
                                $root.google.ai.generativelanguage.v1.ContentEmbedding.encode(message.embedding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedContentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.EmbedContentResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IEmbedContentResponse} message EmbedContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedContentResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.EmbedContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.EmbedContentResponse} EmbedContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.EmbedContentResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.embedding = $root.google.ai.generativelanguage.v1.ContentEmbedding.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedContentResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.EmbedContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.EmbedContentResponse} EmbedContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedContentResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.EmbedContentResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedContentResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.embedding != null && message.hasOwnProperty("embedding")) {
                                var error = $root.google.ai.generativelanguage.v1.ContentEmbedding.verify(message.embedding);
                                if (error)
                                    return "embedding." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an EmbedContentResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.EmbedContentResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.EmbedContentResponse} EmbedContentResponse
                         */
                        EmbedContentResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.EmbedContentResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.EmbedContentResponse();
                            if (object.embedding != null) {
                                if (typeof object.embedding !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.EmbedContentResponse.embedding: object expected");
                                message.embedding = $root.google.ai.generativelanguage.v1.ContentEmbedding.fromObject(object.embedding);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedContentResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.EmbedContentResponse} message EmbedContentResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedContentResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.embedding = null;
                            if (message.embedding != null && message.hasOwnProperty("embedding"))
                                object.embedding = $root.google.ai.generativelanguage.v1.ContentEmbedding.toObject(message.embedding, options);
                            return object;
                        };
    
                        /**
                         * Converts this EmbedContentResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.EmbedContentResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedContentResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedContentResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.EmbedContentResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedContentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.EmbedContentResponse";
                        };
    
                        return EmbedContentResponse;
                    })();
    
                    v1.BatchEmbedContentsRequest = (function() {
    
                        /**
                         * Properties of a BatchEmbedContentsRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IBatchEmbedContentsRequest
                         * @property {string|null} [model] BatchEmbedContentsRequest model
                         * @property {Array.<google.ai.generativelanguage.v1.IEmbedContentRequest>|null} [requests] BatchEmbedContentsRequest requests
                         */
    
                        /**
                         * Constructs a new BatchEmbedContentsRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a BatchEmbedContentsRequest.
                         * @implements IBatchEmbedContentsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IBatchEmbedContentsRequest=} [properties] Properties to set
                         */
                        function BatchEmbedContentsRequest(properties) {
                            this.requests = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedContentsRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @instance
                         */
                        BatchEmbedContentsRequest.prototype.model = "";
    
                        /**
                         * BatchEmbedContentsRequest requests.
                         * @member {Array.<google.ai.generativelanguage.v1.IEmbedContentRequest>} requests
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @instance
                         */
                        BatchEmbedContentsRequest.prototype.requests = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedContentsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IBatchEmbedContentsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.BatchEmbedContentsRequest} BatchEmbedContentsRequest instance
                         */
                        BatchEmbedContentsRequest.create = function create(properties) {
                            return new BatchEmbedContentsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1.BatchEmbedContentsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IBatchEmbedContentsRequest} message BatchEmbedContentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.requests != null && message.requests.length)
                                for (var i = 0; i < message.requests.length; ++i)
                                    $root.google.ai.generativelanguage.v1.EmbedContentRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.BatchEmbedContentsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IBatchEmbedContentsRequest} message BatchEmbedContentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.BatchEmbedContentsRequest} BatchEmbedContentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.BatchEmbedContentsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.requests && message.requests.length))
                                            message.requests = [];
                                        message.requests.push($root.google.ai.generativelanguage.v1.EmbedContentRequest.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.BatchEmbedContentsRequest} BatchEmbedContentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedContentsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedContentsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.requests != null && message.hasOwnProperty("requests")) {
                                if (!Array.isArray(message.requests))
                                    return "requests: array expected";
                                for (var i = 0; i < message.requests.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.EmbedContentRequest.verify(message.requests[i]);
                                    if (error)
                                        return "requests." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedContentsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.BatchEmbedContentsRequest} BatchEmbedContentsRequest
                         */
                        BatchEmbedContentsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.BatchEmbedContentsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.BatchEmbedContentsRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.requests) {
                                if (!Array.isArray(object.requests))
                                    throw TypeError(".google.ai.generativelanguage.v1.BatchEmbedContentsRequest.requests: array expected");
                                message.requests = [];
                                for (var i = 0; i < object.requests.length; ++i) {
                                    if (typeof object.requests[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.BatchEmbedContentsRequest.requests: object expected");
                                    message.requests[i] = $root.google.ai.generativelanguage.v1.EmbedContentRequest.fromObject(object.requests[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedContentsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.BatchEmbedContentsRequest} message BatchEmbedContentsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedContentsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.requests = [];
                            if (options.defaults)
                                object.model = "";
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.requests && message.requests.length) {
                                object.requests = [];
                                for (var j = 0; j < message.requests.length; ++j)
                                    object.requests[j] = $root.google.ai.generativelanguage.v1.EmbedContentRequest.toObject(message.requests[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedContentsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedContentsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedContentsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.BatchEmbedContentsRequest";
                        };
    
                        return BatchEmbedContentsRequest;
                    })();
    
                    v1.BatchEmbedContentsResponse = (function() {
    
                        /**
                         * Properties of a BatchEmbedContentsResponse.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IBatchEmbedContentsResponse
                         * @property {Array.<google.ai.generativelanguage.v1.IContentEmbedding>|null} [embeddings] BatchEmbedContentsResponse embeddings
                         */
    
                        /**
                         * Constructs a new BatchEmbedContentsResponse.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a BatchEmbedContentsResponse.
                         * @implements IBatchEmbedContentsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IBatchEmbedContentsResponse=} [properties] Properties to set
                         */
                        function BatchEmbedContentsResponse(properties) {
                            this.embeddings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedContentsResponse embeddings.
                         * @member {Array.<google.ai.generativelanguage.v1.IContentEmbedding>} embeddings
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsResponse
                         * @instance
                         */
                        BatchEmbedContentsResponse.prototype.embeddings = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedContentsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IBatchEmbedContentsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.BatchEmbedContentsResponse} BatchEmbedContentsResponse instance
                         */
                        BatchEmbedContentsResponse.create = function create(properties) {
                            return new BatchEmbedContentsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1.BatchEmbedContentsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IBatchEmbedContentsResponse} message BatchEmbedContentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embeddings != null && message.embeddings.length)
                                for (var i = 0; i < message.embeddings.length; ++i)
                                    $root.google.ai.generativelanguage.v1.ContentEmbedding.encode(message.embeddings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.BatchEmbedContentsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IBatchEmbedContentsResponse} message BatchEmbedContentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.BatchEmbedContentsResponse} BatchEmbedContentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.BatchEmbedContentsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.embeddings && message.embeddings.length))
                                            message.embeddings = [];
                                        message.embeddings.push($root.google.ai.generativelanguage.v1.ContentEmbedding.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.BatchEmbedContentsResponse} BatchEmbedContentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedContentsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedContentsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.embeddings != null && message.hasOwnProperty("embeddings")) {
                                if (!Array.isArray(message.embeddings))
                                    return "embeddings: array expected";
                                for (var i = 0; i < message.embeddings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.ContentEmbedding.verify(message.embeddings[i]);
                                    if (error)
                                        return "embeddings." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedContentsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.BatchEmbedContentsResponse} BatchEmbedContentsResponse
                         */
                        BatchEmbedContentsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.BatchEmbedContentsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.BatchEmbedContentsResponse();
                            if (object.embeddings) {
                                if (!Array.isArray(object.embeddings))
                                    throw TypeError(".google.ai.generativelanguage.v1.BatchEmbedContentsResponse.embeddings: array expected");
                                message.embeddings = [];
                                for (var i = 0; i < object.embeddings.length; ++i) {
                                    if (typeof object.embeddings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.BatchEmbedContentsResponse.embeddings: object expected");
                                    message.embeddings[i] = $root.google.ai.generativelanguage.v1.ContentEmbedding.fromObject(object.embeddings[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedContentsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.BatchEmbedContentsResponse} message BatchEmbedContentsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedContentsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.embeddings = [];
                            if (message.embeddings && message.embeddings.length) {
                                object.embeddings = [];
                                for (var j = 0; j < message.embeddings.length; ++j)
                                    object.embeddings[j] = $root.google.ai.generativelanguage.v1.ContentEmbedding.toObject(message.embeddings[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedContentsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedContentsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedContentsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.BatchEmbedContentsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedContentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.BatchEmbedContentsResponse";
                        };
    
                        return BatchEmbedContentsResponse;
                    })();
    
                    v1.CountTokensRequest = (function() {
    
                        /**
                         * Properties of a CountTokensRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface ICountTokensRequest
                         * @property {string|null} [model] CountTokensRequest model
                         * @property {Array.<google.ai.generativelanguage.v1.IContent>|null} [contents] CountTokensRequest contents
                         * @property {google.ai.generativelanguage.v1.IGenerateContentRequest|null} [generateContentRequest] CountTokensRequest generateContentRequest
                         */
    
                        /**
                         * Constructs a new CountTokensRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a CountTokensRequest.
                         * @implements ICountTokensRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.ICountTokensRequest=} [properties] Properties to set
                         */
                        function CountTokensRequest(properties) {
                            this.contents = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTokensRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @instance
                         */
                        CountTokensRequest.prototype.model = "";
    
                        /**
                         * CountTokensRequest contents.
                         * @member {Array.<google.ai.generativelanguage.v1.IContent>} contents
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @instance
                         */
                        CountTokensRequest.prototype.contents = $util.emptyArray;
    
                        /**
                         * CountTokensRequest generateContentRequest.
                         * @member {google.ai.generativelanguage.v1.IGenerateContentRequest|null|undefined} generateContentRequest
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @instance
                         */
                        CountTokensRequest.prototype.generateContentRequest = null;
    
                        /**
                         * Creates a new CountTokensRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICountTokensRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.CountTokensRequest} CountTokensRequest instance
                         */
                        CountTokensRequest.create = function create(properties) {
                            return new CountTokensRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CountTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1.CountTokensRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICountTokensRequest} message CountTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.contents != null && message.contents.length)
                                for (var i = 0; i < message.contents.length; ++i)
                                    $root.google.ai.generativelanguage.v1.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.generateContentRequest != null && Object.hasOwnProperty.call(message, "generateContentRequest"))
                                $root.google.ai.generativelanguage.v1.GenerateContentRequest.encode(message.generateContentRequest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.CountTokensRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICountTokensRequest} message CountTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTokensRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.CountTokensRequest} CountTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.CountTokensRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.contents && message.contents.length))
                                            message.contents = [];
                                        message.contents.push($root.google.ai.generativelanguage.v1.Content.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        message.generateContentRequest = $root.google.ai.generativelanguage.v1.GenerateContentRequest.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTokensRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.CountTokensRequest} CountTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTokensRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTokensRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.contents != null && message.hasOwnProperty("contents")) {
                                if (!Array.isArray(message.contents))
                                    return "contents: array expected";
                                for (var i = 0; i < message.contents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.Content.verify(message.contents[i]);
                                    if (error)
                                        return "contents." + error;
                                }
                            }
                            if (message.generateContentRequest != null && message.hasOwnProperty("generateContentRequest")) {
                                var error = $root.google.ai.generativelanguage.v1.GenerateContentRequest.verify(message.generateContentRequest);
                                if (error)
                                    return "generateContentRequest." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CountTokensRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.CountTokensRequest} CountTokensRequest
                         */
                        CountTokensRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.CountTokensRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.CountTokensRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.contents) {
                                if (!Array.isArray(object.contents))
                                    throw TypeError(".google.ai.generativelanguage.v1.CountTokensRequest.contents: array expected");
                                message.contents = [];
                                for (var i = 0; i < object.contents.length; ++i) {
                                    if (typeof object.contents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.CountTokensRequest.contents: object expected");
                                    message.contents[i] = $root.google.ai.generativelanguage.v1.Content.fromObject(object.contents[i]);
                                }
                            }
                            if (object.generateContentRequest != null) {
                                if (typeof object.generateContentRequest !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1.CountTokensRequest.generateContentRequest: object expected");
                                message.generateContentRequest = $root.google.ai.generativelanguage.v1.GenerateContentRequest.fromObject(object.generateContentRequest);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTokensRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.CountTokensRequest} message CountTokensRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTokensRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.contents = [];
                            if (options.defaults) {
                                object.model = "";
                                object.generateContentRequest = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.contents && message.contents.length) {
                                object.contents = [];
                                for (var j = 0; j < message.contents.length; ++j)
                                    object.contents[j] = $root.google.ai.generativelanguage.v1.Content.toObject(message.contents[j], options);
                            }
                            if (message.generateContentRequest != null && message.hasOwnProperty("generateContentRequest"))
                                object.generateContentRequest = $root.google.ai.generativelanguage.v1.GenerateContentRequest.toObject(message.generateContentRequest, options);
                            return object;
                        };
    
                        /**
                         * Converts this CountTokensRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTokensRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTokensRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.CountTokensRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.CountTokensRequest";
                        };
    
                        return CountTokensRequest;
                    })();
    
                    v1.CountTokensResponse = (function() {
    
                        /**
                         * Properties of a CountTokensResponse.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface ICountTokensResponse
                         * @property {number|null} [totalTokens] CountTokensResponse totalTokens
                         */
    
                        /**
                         * Constructs a new CountTokensResponse.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a CountTokensResponse.
                         * @implements ICountTokensResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.ICountTokensResponse=} [properties] Properties to set
                         */
                        function CountTokensResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTokensResponse totalTokens.
                         * @member {number} totalTokens
                         * @memberof google.ai.generativelanguage.v1.CountTokensResponse
                         * @instance
                         */
                        CountTokensResponse.prototype.totalTokens = 0;
    
                        /**
                         * Creates a new CountTokensResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICountTokensResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.CountTokensResponse} CountTokensResponse instance
                         */
                        CountTokensResponse.create = function create(properties) {
                            return new CountTokensResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CountTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1.CountTokensResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICountTokensResponse} message CountTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.totalTokens != null && Object.hasOwnProperty.call(message, "totalTokens"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalTokens);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.CountTokensResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.ICountTokensResponse} message CountTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTokensResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.CountTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.CountTokensResponse} CountTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.CountTokensResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.totalTokens = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTokensResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.CountTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.CountTokensResponse} CountTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTokensResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.CountTokensResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTokensResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.totalTokens != null && message.hasOwnProperty("totalTokens"))
                                if (!$util.isInteger(message.totalTokens))
                                    return "totalTokens: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a CountTokensResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.CountTokensResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.CountTokensResponse} CountTokensResponse
                         */
                        CountTokensResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.CountTokensResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.CountTokensResponse();
                            if (object.totalTokens != null)
                                message.totalTokens = object.totalTokens | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTokensResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.CountTokensResponse} message CountTokensResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTokensResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.totalTokens = 0;
                            if (message.totalTokens != null && message.hasOwnProperty("totalTokens"))
                                object.totalTokens = message.totalTokens;
                            return object;
                        };
    
                        /**
                         * Converts this CountTokensResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.CountTokensResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTokensResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTokensResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.CountTokensResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.CountTokensResponse";
                        };
    
                        return CountTokensResponse;
                    })();
    
                    /**
                     * HarmCategory enum.
                     * @name google.ai.generativelanguage.v1.HarmCategory
                     * @enum {number}
                     * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value
                     * @property {number} HARM_CATEGORY_DEROGATORY=1 HARM_CATEGORY_DEROGATORY value
                     * @property {number} HARM_CATEGORY_TOXICITY=2 HARM_CATEGORY_TOXICITY value
                     * @property {number} HARM_CATEGORY_VIOLENCE=3 HARM_CATEGORY_VIOLENCE value
                     * @property {number} HARM_CATEGORY_SEXUAL=4 HARM_CATEGORY_SEXUAL value
                     * @property {number} HARM_CATEGORY_MEDICAL=5 HARM_CATEGORY_MEDICAL value
                     * @property {number} HARM_CATEGORY_DANGEROUS=6 HARM_CATEGORY_DANGEROUS value
                     * @property {number} HARM_CATEGORY_HARASSMENT=7 HARM_CATEGORY_HARASSMENT value
                     * @property {number} HARM_CATEGORY_HATE_SPEECH=8 HARM_CATEGORY_HATE_SPEECH value
                     * @property {number} HARM_CATEGORY_SEXUALLY_EXPLICIT=9 HARM_CATEGORY_SEXUALLY_EXPLICIT value
                     * @property {number} HARM_CATEGORY_DANGEROUS_CONTENT=10 HARM_CATEGORY_DANGEROUS_CONTENT value
                     * @property {number} HARM_CATEGORY_CIVIC_INTEGRITY=11 HARM_CATEGORY_CIVIC_INTEGRITY value
                     */
                    v1.HarmCategory = (function() {
                        var valuesById = {}, values = Object.create(valuesById);
                        values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0;
                        values[valuesById[1] = "HARM_CATEGORY_DEROGATORY"] = 1;
                        values[valuesById[2] = "HARM_CATEGORY_TOXICITY"] = 2;
                        values[valuesById[3] = "HARM_CATEGORY_VIOLENCE"] = 3;
                        values[valuesById[4] = "HARM_CATEGORY_SEXUAL"] = 4;
                        values[valuesById[5] = "HARM_CATEGORY_MEDICAL"] = 5;
                        values[valuesById[6] = "HARM_CATEGORY_DANGEROUS"] = 6;
                        values[valuesById[7] = "HARM_CATEGORY_HARASSMENT"] = 7;
                        values[valuesById[8] = "HARM_CATEGORY_HATE_SPEECH"] = 8;
                        values[valuesById[9] = "HARM_CATEGORY_SEXUALLY_EXPLICIT"] = 9;
                        values[valuesById[10] = "HARM_CATEGORY_DANGEROUS_CONTENT"] = 10;
                        values[valuesById[11] = "HARM_CATEGORY_CIVIC_INTEGRITY"] = 11;
                        return values;
                    })();
    
                    v1.SafetyRating = (function() {
    
                        /**
                         * Properties of a SafetyRating.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface ISafetyRating
                         * @property {google.ai.generativelanguage.v1.HarmCategory|null} [category] SafetyRating category
                         * @property {google.ai.generativelanguage.v1.SafetyRating.HarmProbability|null} [probability] SafetyRating probability
                         * @property {boolean|null} [blocked] SafetyRating blocked
                         */
    
                        /**
                         * Constructs a new SafetyRating.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a SafetyRating.
                         * @implements ISafetyRating
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.ISafetyRating=} [properties] Properties to set
                         */
                        function SafetyRating(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetyRating category.
                         * @member {google.ai.generativelanguage.v1.HarmCategory} category
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.category = 0;
    
                        /**
                         * SafetyRating probability.
                         * @member {google.ai.generativelanguage.v1.SafetyRating.HarmProbability} probability
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.probability = 0;
    
                        /**
                         * SafetyRating blocked.
                         * @member {boolean} blocked
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.blocked = false;
    
                        /**
                         * Creates a new SafetyRating instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISafetyRating=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.SafetyRating} SafetyRating instance
                         */
                        SafetyRating.create = function create(properties) {
                            return new SafetyRating(properties);
                        };
    
                        /**
                         * Encodes the specified SafetyRating message. Does not implicitly {@link google.ai.generativelanguage.v1.SafetyRating.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISafetyRating} message SafetyRating message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyRating.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.category != null && Object.hasOwnProperty.call(message, "category"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category);
                            if (message.probability != null && Object.hasOwnProperty.call(message, "probability"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.probability);
                            if (message.blocked != null && Object.hasOwnProperty.call(message, "blocked"))
                                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blocked);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetyRating message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.SafetyRating.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISafetyRating} message SafetyRating message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyRating.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetyRating message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.SafetyRating} SafetyRating
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyRating.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.SafetyRating();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.category = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.probability = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.blocked = reader.bool();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetyRating message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.SafetyRating} SafetyRating
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyRating.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetyRating message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetyRating.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.category != null && message.hasOwnProperty("category"))
                                switch (message.category) {
                                default:
                                    return "category: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                case 8:
                                case 9:
                                case 10:
                                case 11:
                                    break;
                                }
                            if (message.probability != null && message.hasOwnProperty("probability"))
                                switch (message.probability) {
                                default:
                                    return "probability: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                    break;
                                }
                            if (message.blocked != null && message.hasOwnProperty("blocked"))
                                if (typeof message.blocked !== "boolean")
                                    return "blocked: boolean expected";
                            return null;
                        };
    
                        /**
                         * Creates a SafetyRating message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.SafetyRating} SafetyRating
                         */
                        SafetyRating.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.SafetyRating)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.SafetyRating();
                            switch (object.category) {
                            default:
                                if (typeof object.category === "number") {
                                    message.category = object.category;
                                    break;
                                }
                                break;
                            case "HARM_CATEGORY_UNSPECIFIED":
                            case 0:
                                message.category = 0;
                                break;
                            case "HARM_CATEGORY_DEROGATORY":
                            case 1:
                                message.category = 1;
                                break;
                            case "HARM_CATEGORY_TOXICITY":
                            case 2:
                                message.category = 2;
                                break;
                            case "HARM_CATEGORY_VIOLENCE":
                            case 3:
                                message.category = 3;
                                break;
                            case "HARM_CATEGORY_SEXUAL":
                            case 4:
                                message.category = 4;
                                break;
                            case "HARM_CATEGORY_MEDICAL":
                            case 5:
                                message.category = 5;
                                break;
                            case "HARM_CATEGORY_DANGEROUS":
                            case 6:
                                message.category = 6;
                                break;
                            case "HARM_CATEGORY_HARASSMENT":
                            case 7:
                                message.category = 7;
                                break;
                            case "HARM_CATEGORY_HATE_SPEECH":
                            case 8:
                                message.category = 8;
                                break;
                            case "HARM_CATEGORY_SEXUALLY_EXPLICIT":
                            case 9:
                                message.category = 9;
                                break;
                            case "HARM_CATEGORY_DANGEROUS_CONTENT":
                            case 10:
                                message.category = 10;
                                break;
                            case "HARM_CATEGORY_CIVIC_INTEGRITY":
                            case 11:
                                message.category = 11;
                                break;
                            }
                            switch (object.probability) {
                            default:
                                if (typeof object.probability === "number") {
                                    message.probability = object.probability;
                                    break;
                                }
                                break;
                            case "HARM_PROBABILITY_UNSPECIFIED":
                            case 0:
                                message.probability = 0;
                                break;
                            case "NEGLIGIBLE":
                            case 1:
                                message.probability = 1;
                                break;
                            case "LOW":
                            case 2:
                                message.probability = 2;
                                break;
                            case "MEDIUM":
                            case 3:
                                message.probability = 3;
                                break;
                            case "HIGH":
                            case 4:
                                message.probability = 4;
                                break;
                            }
                            if (object.blocked != null)
                                message.blocked = Boolean(object.blocked);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetyRating message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1.SafetyRating} message SafetyRating
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetyRating.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0;
                                object.probability = options.enums === String ? "HARM_PROBABILITY_UNSPECIFIED" : 0;
                                object.blocked = false;
                            }
                            if (message.category != null && message.hasOwnProperty("category"))
                                object.category = options.enums === String ? $root.google.ai.generativelanguage.v1.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1.HarmCategory[message.category] : message.category;
                            if (message.probability != null && message.hasOwnProperty("probability"))
                                object.probability = options.enums === String ? $root.google.ai.generativelanguage.v1.SafetyRating.HarmProbability[message.probability] === undefined ? message.probability : $root.google.ai.generativelanguage.v1.SafetyRating.HarmProbability[message.probability] : message.probability;
                            if (message.blocked != null && message.hasOwnProperty("blocked"))
                                object.blocked = message.blocked;
                            return object;
                        };
    
                        /**
                         * Converts this SafetyRating to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetyRating.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetyRating
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.SafetyRating
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetyRating.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.SafetyRating";
                        };
    
                        /**
                         * HarmProbability enum.
                         * @name google.ai.generativelanguage.v1.SafetyRating.HarmProbability
                         * @enum {number}
                         * @property {number} HARM_PROBABILITY_UNSPECIFIED=0 HARM_PROBABILITY_UNSPECIFIED value
                         * @property {number} NEGLIGIBLE=1 NEGLIGIBLE value
                         * @property {number} LOW=2 LOW value
                         * @property {number} MEDIUM=3 MEDIUM value
                         * @property {number} HIGH=4 HIGH value
                         */
                        SafetyRating.HarmProbability = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "HARM_PROBABILITY_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "NEGLIGIBLE"] = 1;
                            values[valuesById[2] = "LOW"] = 2;
                            values[valuesById[3] = "MEDIUM"] = 3;
                            values[valuesById[4] = "HIGH"] = 4;
                            return values;
                        })();
    
                        return SafetyRating;
                    })();
    
                    v1.SafetySetting = (function() {
    
                        /**
                         * Properties of a SafetySetting.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface ISafetySetting
                         * @property {google.ai.generativelanguage.v1.HarmCategory|null} [category] SafetySetting category
                         * @property {google.ai.generativelanguage.v1.SafetySetting.HarmBlockThreshold|null} [threshold] SafetySetting threshold
                         */
    
                        /**
                         * Constructs a new SafetySetting.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a SafetySetting.
                         * @implements ISafetySetting
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.ISafetySetting=} [properties] Properties to set
                         */
                        function SafetySetting(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetySetting category.
                         * @member {google.ai.generativelanguage.v1.HarmCategory} category
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @instance
                         */
                        SafetySetting.prototype.category = 0;
    
                        /**
                         * SafetySetting threshold.
                         * @member {google.ai.generativelanguage.v1.SafetySetting.HarmBlockThreshold} threshold
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @instance
                         */
                        SafetySetting.prototype.threshold = 0;
    
                        /**
                         * Creates a new SafetySetting instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISafetySetting=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.SafetySetting} SafetySetting instance
                         */
                        SafetySetting.create = function create(properties) {
                            return new SafetySetting(properties);
                        };
    
                        /**
                         * Encodes the specified SafetySetting message. Does not implicitly {@link google.ai.generativelanguage.v1.SafetySetting.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISafetySetting} message SafetySetting message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetySetting.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.category != null && Object.hasOwnProperty.call(message, "category"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category);
                            if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.threshold);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.SafetySetting.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1.ISafetySetting} message SafetySetting message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetySetting.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetySetting message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.SafetySetting} SafetySetting
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetySetting.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.SafetySetting();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.category = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.threshold = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetySetting message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.SafetySetting} SafetySetting
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetySetting.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetySetting message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetySetting.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.category != null && message.hasOwnProperty("category"))
                                switch (message.category) {
                                default:
                                    return "category: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                case 8:
                                case 9:
                                case 10:
                                case 11:
                                    break;
                                }
                            if (message.threshold != null && message.hasOwnProperty("threshold"))
                                switch (message.threshold) {
                                default:
                                    return "threshold: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                    break;
                                }
                            return null;
                        };
    
                        /**
                         * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.SafetySetting} SafetySetting
                         */
                        SafetySetting.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.SafetySetting)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.SafetySetting();
                            switch (object.category) {
                            default:
                                if (typeof object.category === "number") {
                                    message.category = object.category;
                                    break;
                                }
                                break;
                            case "HARM_CATEGORY_UNSPECIFIED":
                            case 0:
                                message.category = 0;
                                break;
                            case "HARM_CATEGORY_DEROGATORY":
                            case 1:
                                message.category = 1;
                                break;
                            case "HARM_CATEGORY_TOXICITY":
                            case 2:
                                message.category = 2;
                                break;
                            case "HARM_CATEGORY_VIOLENCE":
                            case 3:
                                message.category = 3;
                                break;
                            case "HARM_CATEGORY_SEXUAL":
                            case 4:
                                message.category = 4;
                                break;
                            case "HARM_CATEGORY_MEDICAL":
                            case 5:
                                message.category = 5;
                                break;
                            case "HARM_CATEGORY_DANGEROUS":
                            case 6:
                                message.category = 6;
                                break;
                            case "HARM_CATEGORY_HARASSMENT":
                            case 7:
                                message.category = 7;
                                break;
                            case "HARM_CATEGORY_HATE_SPEECH":
                            case 8:
                                message.category = 8;
                                break;
                            case "HARM_CATEGORY_SEXUALLY_EXPLICIT":
                            case 9:
                                message.category = 9;
                                break;
                            case "HARM_CATEGORY_DANGEROUS_CONTENT":
                            case 10:
                                message.category = 10;
                                break;
                            case "HARM_CATEGORY_CIVIC_INTEGRITY":
                            case 11:
                                message.category = 11;
                                break;
                            }
                            switch (object.threshold) {
                            default:
                                if (typeof object.threshold === "number") {
                                    message.threshold = object.threshold;
                                    break;
                                }
                                break;
                            case "HARM_BLOCK_THRESHOLD_UNSPECIFIED":
                            case 0:
                                message.threshold = 0;
                                break;
                            case "BLOCK_LOW_AND_ABOVE":
                            case 1:
                                message.threshold = 1;
                                break;
                            case "BLOCK_MEDIUM_AND_ABOVE":
                            case 2:
                                message.threshold = 2;
                                break;
                            case "BLOCK_ONLY_HIGH":
                            case 3:
                                message.threshold = 3;
                                break;
                            case "BLOCK_NONE":
                            case 4:
                                message.threshold = 4;
                                break;
                            case "OFF":
                            case 5:
                                message.threshold = 5;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetySetting message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1.SafetySetting} message SafetySetting
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetySetting.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0;
                                object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0;
                            }
                            if (message.category != null && message.hasOwnProperty("category"))
                                object.category = options.enums === String ? $root.google.ai.generativelanguage.v1.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1.HarmCategory[message.category] : message.category;
                            if (message.threshold != null && message.hasOwnProperty("threshold"))
                                object.threshold = options.enums === String ? $root.google.ai.generativelanguage.v1.SafetySetting.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.ai.generativelanguage.v1.SafetySetting.HarmBlockThreshold[message.threshold] : message.threshold;
                            return object;
                        };
    
                        /**
                         * Converts this SafetySetting to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetySetting.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetySetting
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.SafetySetting
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.SafetySetting";
                        };
    
                        /**
                         * HarmBlockThreshold enum.
                         * @name google.ai.generativelanguage.v1.SafetySetting.HarmBlockThreshold
                         * @enum {number}
                         * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value
                         * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value
                         * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value
                         * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value
                         * @property {number} BLOCK_NONE=4 BLOCK_NONE value
                         * @property {number} OFF=5 OFF value
                         */
                        SafetySetting.HarmBlockThreshold = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1;
                            values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2;
                            values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3;
                            values[valuesById[4] = "BLOCK_NONE"] = 4;
                            values[valuesById[5] = "OFF"] = 5;
                            return values;
                        })();
    
                        return SafetySetting;
                    })();
    
                    v1.Model = (function() {
    
                        /**
                         * Properties of a Model.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IModel
                         * @property {string|null} [name] Model name
                         * @property {string|null} [baseModelId] Model baseModelId
                         * @property {string|null} [version] Model version
                         * @property {string|null} [displayName] Model displayName
                         * @property {string|null} [description] Model description
                         * @property {number|null} [inputTokenLimit] Model inputTokenLimit
                         * @property {number|null} [outputTokenLimit] Model outputTokenLimit
                         * @property {Array.<string>|null} [supportedGenerationMethods] Model supportedGenerationMethods
                         * @property {number|null} [temperature] Model temperature
                         * @property {number|null} [maxTemperature] Model maxTemperature
                         * @property {number|null} [topP] Model topP
                         * @property {number|null} [topK] Model topK
                         */
    
                        /**
                         * Constructs a new Model.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a Model.
                         * @implements IModel
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IModel=} [properties] Properties to set
                         */
                        function Model(properties) {
                            this.supportedGenerationMethods = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Model name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.name = "";
    
                        /**
                         * Model baseModelId.
                         * @member {string} baseModelId
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.baseModelId = "";
    
                        /**
                         * Model version.
                         * @member {string} version
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.version = "";
    
                        /**
                         * Model displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.displayName = "";
    
                        /**
                         * Model description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.description = "";
    
                        /**
                         * Model inputTokenLimit.
                         * @member {number} inputTokenLimit
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.inputTokenLimit = 0;
    
                        /**
                         * Model outputTokenLimit.
                         * @member {number} outputTokenLimit
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.outputTokenLimit = 0;
    
                        /**
                         * Model supportedGenerationMethods.
                         * @member {Array.<string>} supportedGenerationMethods
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.supportedGenerationMethods = $util.emptyArray;
    
                        /**
                         * Model temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.temperature = null;
    
                        /**
                         * Model maxTemperature.
                         * @member {number|null|undefined} maxTemperature
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.maxTemperature = null;
    
                        /**
                         * Model topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.topP = null;
    
                        /**
                         * Model topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Model.prototype.topK = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Model _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _maxTemperature.
                         * @member {"maxTemperature"|undefined} _maxTemperature
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_maxTemperature", {
                            get: $util.oneOfGetter($oneOfFields = ["maxTemperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Model instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1.IModel=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.Model} Model instance
                         */
                        Model.create = function create(properties) {
                            return new Model(properties);
                        };
    
                        /**
                         * Encodes the specified Model message. Does not implicitly {@link google.ai.generativelanguage.v1.Model.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1.IModel} message Model message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Model.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.baseModelId != null && Object.hasOwnProperty.call(message, "baseModelId"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModelId);
                            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.version);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 5, wireType 2 =*/42).string(message.description);
                            if (message.inputTokenLimit != null && Object.hasOwnProperty.call(message, "inputTokenLimit"))
                                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.inputTokenLimit);
                            if (message.outputTokenLimit != null && Object.hasOwnProperty.call(message, "outputTokenLimit"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.outputTokenLimit);
                            if (message.supportedGenerationMethods != null && message.supportedGenerationMethods.length)
                                for (var i = 0; i < message.supportedGenerationMethods.length; ++i)
                                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.supportedGenerationMethods[i]);
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 9, wireType 5 =*/77).float(message.temperature);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 10, wireType 5 =*/85).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 11, wireType 0 =*/88).int32(message.topK);
                            if (message.maxTemperature != null && Object.hasOwnProperty.call(message, "maxTemperature"))
                                writer.uint32(/* id 13, wireType 5 =*/109).float(message.maxTemperature);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Model message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.Model.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1.IModel} message Model message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Model.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Model message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.Model} Model
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Model.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.Model();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.baseModelId = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.version = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 5: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.inputTokenLimit = reader.int32();
                                        break;
                                    }
                                case 7: {
                                        message.outputTokenLimit = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        if (!(message.supportedGenerationMethods && message.supportedGenerationMethods.length))
                                            message.supportedGenerationMethods = [];
                                        message.supportedGenerationMethods.push(reader.string());
                                        break;
                                    }
                                case 9: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 13: {
                                        message.maxTemperature = reader.float();
                                        break;
                                    }
                                case 10: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 11: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Model message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.Model} Model
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Model.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Model message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Model.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.baseModelId != null && message.hasOwnProperty("baseModelId"))
                                if (!$util.isString(message.baseModelId))
                                    return "baseModelId: string expected";
                            if (message.version != null && message.hasOwnProperty("version"))
                                if (!$util.isString(message.version))
                                    return "version: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit"))
                                if (!$util.isInteger(message.inputTokenLimit))
                                    return "inputTokenLimit: integer expected";
                            if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit"))
                                if (!$util.isInteger(message.outputTokenLimit))
                                    return "outputTokenLimit: integer expected";
                            if (message.supportedGenerationMethods != null && message.hasOwnProperty("supportedGenerationMethods")) {
                                if (!Array.isArray(message.supportedGenerationMethods))
                                    return "supportedGenerationMethods: array expected";
                                for (var i = 0; i < message.supportedGenerationMethods.length; ++i)
                                    if (!$util.isString(message.supportedGenerationMethods[i]))
                                        return "supportedGenerationMethods: string[] expected";
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.maxTemperature != null && message.hasOwnProperty("maxTemperature")) {
                                properties._maxTemperature = 1;
                                if (typeof message.maxTemperature !== "number")
                                    return "maxTemperature: number expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Model message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.Model} Model
                         */
                        Model.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.Model)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.Model();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.baseModelId != null)
                                message.baseModelId = String(object.baseModelId);
                            if (object.version != null)
                                message.version = String(object.version);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.inputTokenLimit != null)
                                message.inputTokenLimit = object.inputTokenLimit | 0;
                            if (object.outputTokenLimit != null)
                                message.outputTokenLimit = object.outputTokenLimit | 0;
                            if (object.supportedGenerationMethods) {
                                if (!Array.isArray(object.supportedGenerationMethods))
                                    throw TypeError(".google.ai.generativelanguage.v1.Model.supportedGenerationMethods: array expected");
                                message.supportedGenerationMethods = [];
                                for (var i = 0; i < object.supportedGenerationMethods.length; ++i)
                                    message.supportedGenerationMethods[i] = String(object.supportedGenerationMethods[i]);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.maxTemperature != null)
                                message.maxTemperature = Number(object.maxTemperature);
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Model message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1.Model} message Model
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Model.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.supportedGenerationMethods = [];
                            if (options.defaults) {
                                object.name = "";
                                object.baseModelId = "";
                                object.version = "";
                                object.displayName = "";
                                object.description = "";
                                object.inputTokenLimit = 0;
                                object.outputTokenLimit = 0;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.baseModelId != null && message.hasOwnProperty("baseModelId"))
                                object.baseModelId = message.baseModelId;
                            if (message.version != null && message.hasOwnProperty("version"))
                                object.version = message.version;
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit"))
                                object.inputTokenLimit = message.inputTokenLimit;
                            if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit"))
                                object.outputTokenLimit = message.outputTokenLimit;
                            if (message.supportedGenerationMethods && message.supportedGenerationMethods.length) {
                                object.supportedGenerationMethods = [];
                                for (var j = 0; j < message.supportedGenerationMethods.length; ++j)
                                    object.supportedGenerationMethods[j] = message.supportedGenerationMethods[j];
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.maxTemperature != null && message.hasOwnProperty("maxTemperature")) {
                                object.maxTemperature = options.json && !isFinite(message.maxTemperature) ? String(message.maxTemperature) : message.maxTemperature;
                                if (options.oneofs)
                                    object._maxTemperature = "maxTemperature";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Model to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Model.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Model
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.Model
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.Model";
                        };
    
                        return Model;
                    })();
    
                    v1.ModelService = (function() {
    
                        /**
                         * Constructs a new ModelService service.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a ModelService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function ModelService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (ModelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ModelService;
    
                        /**
                         * Creates new ModelService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.ModelService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {ModelService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        ModelService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1.ModelService|getModel}.
                         * @memberof google.ai.generativelanguage.v1.ModelService
                         * @typedef GetModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1.Model} [response] Model
                         */
    
                        /**
                         * Calls GetModel.
                         * @function getModel
                         * @memberof google.ai.generativelanguage.v1.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IGetModelRequest} request GetModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1.ModelService.GetModelCallback} callback Node-style callback called with the error, if any, and Model
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.getModel = function getModel(request, callback) {
                            return this.rpcCall(getModel, $root.google.ai.generativelanguage.v1.GetModelRequest, $root.google.ai.generativelanguage.v1.Model, request, callback);
                        }, "name", { value: "GetModel" });
    
                        /**
                         * Calls GetModel.
                         * @function getModel
                         * @memberof google.ai.generativelanguage.v1.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IGetModelRequest} request GetModelRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1.Model>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1.ModelService|listModels}.
                         * @memberof google.ai.generativelanguage.v1.ModelService
                         * @typedef ListModelsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1.ListModelsResponse} [response] ListModelsResponse
                         */
    
                        /**
                         * Calls ListModels.
                         * @function listModels
                         * @memberof google.ai.generativelanguage.v1.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IListModelsRequest} request ListModelsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1.ModelService.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.listModels = function listModels(request, callback) {
                            return this.rpcCall(listModels, $root.google.ai.generativelanguage.v1.ListModelsRequest, $root.google.ai.generativelanguage.v1.ListModelsResponse, request, callback);
                        }, "name", { value: "ListModels" });
    
                        /**
                         * Calls ListModels.
                         * @function listModels
                         * @memberof google.ai.generativelanguage.v1.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1.IListModelsRequest} request ListModelsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1.ListModelsResponse>} Promise
                         * @variation 2
                         */
    
                        return ModelService;
                    })();
    
                    v1.GetModelRequest = (function() {
    
                        /**
                         * Properties of a GetModelRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IGetModelRequest
                         * @property {string|null} [name] GetModelRequest name
                         */
    
                        /**
                         * Constructs a new GetModelRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a GetModelRequest.
                         * @implements IGetModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IGetModelRequest=} [properties] Properties to set
                         */
                        function GetModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetModelRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1.GetModelRequest
                         * @instance
                         */
                        GetModelRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGetModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.GetModelRequest} GetModelRequest instance
                         */
                        GetModelRequest.create = function create(properties) {
                            return new GetModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1.GetModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGetModelRequest} message GetModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.GetModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IGetModelRequest} message GetModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.GetModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.GetModelRequest} GetModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.GetModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.GetModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.GetModelRequest} GetModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.GetModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.GetModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.GetModelRequest} GetModelRequest
                         */
                        GetModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.GetModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.GetModelRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.GetModelRequest} message GetModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.GetModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.GetModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.GetModelRequest";
                        };
    
                        return GetModelRequest;
                    })();
    
                    v1.ListModelsRequest = (function() {
    
                        /**
                         * Properties of a ListModelsRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IListModelsRequest
                         * @property {number|null} [pageSize] ListModelsRequest pageSize
                         * @property {string|null} [pageToken] ListModelsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListModelsRequest.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a ListModelsRequest.
                         * @implements IListModelsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IListModelsRequest=} [properties] Properties to set
                         */
                        function ListModelsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListModelsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @instance
                         */
                        ListModelsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListModelsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @instance
                         */
                        ListModelsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListModelsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IListModelsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.ListModelsRequest} ListModelsRequest instance
                         */
                        ListModelsRequest.create = function create(properties) {
                            return new ListModelsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1.ListModelsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IListModelsRequest} message ListModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.ListModelsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.IListModelsRequest} message ListModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListModelsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.ListModelsRequest} ListModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.ListModelsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.ListModelsRequest} ListModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListModelsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListModelsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.ListModelsRequest} ListModelsRequest
                         */
                        ListModelsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.ListModelsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.ListModelsRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1.ListModelsRequest} message ListModelsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListModelsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListModelsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListModelsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListModelsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.ListModelsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.ListModelsRequest";
                        };
    
                        return ListModelsRequest;
                    })();
    
                    v1.ListModelsResponse = (function() {
    
                        /**
                         * Properties of a ListModelsResponse.
                         * @memberof google.ai.generativelanguage.v1
                         * @interface IListModelsResponse
                         * @property {Array.<google.ai.generativelanguage.v1.IModel>|null} [models] ListModelsResponse models
                         * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListModelsResponse.
                         * @memberof google.ai.generativelanguage.v1
                         * @classdesc Represents a ListModelsResponse.
                         * @implements IListModelsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1.IListModelsResponse=} [properties] Properties to set
                         */
                        function ListModelsResponse(properties) {
                            this.models = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListModelsResponse models.
                         * @member {Array.<google.ai.generativelanguage.v1.IModel>} models
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @instance
                         */
                        ListModelsResponse.prototype.models = $util.emptyArray;
    
                        /**
                         * ListModelsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @instance
                         */
                        ListModelsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListModelsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IListModelsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1.ListModelsResponse} ListModelsResponse instance
                         */
                        ListModelsResponse.create = function create(properties) {
                            return new ListModelsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1.ListModelsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IListModelsResponse} message ListModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.models != null && message.models.length)
                                for (var i = 0; i < message.models.length; ++i)
                                    $root.google.ai.generativelanguage.v1.Model.encode(message.models[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1.ListModelsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.IListModelsResponse} message ListModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListModelsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1.ListModelsResponse} ListModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1.ListModelsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.models && message.models.length))
                                            message.models = [];
                                        message.models.push($root.google.ai.generativelanguage.v1.Model.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1.ListModelsResponse} ListModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListModelsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListModelsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.models != null && message.hasOwnProperty("models")) {
                                if (!Array.isArray(message.models))
                                    return "models: array expected";
                                for (var i = 0; i < message.models.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1.Model.verify(message.models[i]);
                                    if (error)
                                        return "models." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1.ListModelsResponse} ListModelsResponse
                         */
                        ListModelsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1.ListModelsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1.ListModelsResponse();
                            if (object.models) {
                                if (!Array.isArray(object.models))
                                    throw TypeError(".google.ai.generativelanguage.v1.ListModelsResponse.models: array expected");
                                message.models = [];
                                for (var i = 0; i < object.models.length; ++i) {
                                    if (typeof object.models[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1.ListModelsResponse.models: object expected");
                                    message.models[i] = $root.google.ai.generativelanguage.v1.Model.fromObject(object.models[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1.ListModelsResponse} message ListModelsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListModelsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.models = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.models && message.models.length) {
                                object.models = [];
                                for (var j = 0; j < message.models.length; ++j)
                                    object.models[j] = $root.google.ai.generativelanguage.v1.Model.toObject(message.models[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListModelsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListModelsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListModelsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1.ListModelsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1.ListModelsResponse";
                        };
    
                        return ListModelsResponse;
                    })();
    
                    return v1;
                })();
    
                generativelanguage.v1alpha = (function() {
    
                    /**
                     * Namespace v1alpha.
                     * @memberof google.ai.generativelanguage
                     * @namespace
                     */
                    var v1alpha = {};
    
                    v1alpha.CacheService = (function() {
    
                        /**
                         * Constructs a new CacheService service.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CacheService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function CacheService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (CacheService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CacheService;
    
                        /**
                         * Creates new CacheService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {CacheService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        CacheService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|listCachedContents}.
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @typedef ListCachedContentsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.ListCachedContentsResponse} [response] ListCachedContentsResponse
                         */
    
                        /**
                         * Calls ListCachedContents.
                         * @function listCachedContents
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsRequest} request ListCachedContentsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.CacheService.ListCachedContentsCallback} callback Node-style callback called with the error, if any, and ListCachedContentsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(CacheService.prototype.listCachedContents = function listCachedContents(request, callback) {
                            return this.rpcCall(listCachedContents, $root.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest, $root.google.ai.generativelanguage.v1alpha.ListCachedContentsResponse, request, callback);
                        }, "name", { value: "ListCachedContents" });
    
                        /**
                         * Calls ListCachedContents.
                         * @function listCachedContents
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsRequest} request ListCachedContentsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.ListCachedContentsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|createCachedContent}.
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @typedef CreateCachedContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.CachedContent} [response] CachedContent
                         */
    
                        /**
                         * Calls CreateCachedContent.
                         * @function createCachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest} request CreateCachedContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.CacheService.CreateCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(CacheService.prototype.createCachedContent = function createCachedContent(request, callback) {
                            return this.rpcCall(createCachedContent, $root.google.ai.generativelanguage.v1alpha.CreateCachedContentRequest, $root.google.ai.generativelanguage.v1alpha.CachedContent, request, callback);
                        }, "name", { value: "CreateCachedContent" });
    
                        /**
                         * Calls CreateCachedContent.
                         * @function createCachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest} request CreateCachedContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.CachedContent>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|getCachedContent}.
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @typedef GetCachedContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.CachedContent} [response] CachedContent
                         */
    
                        /**
                         * Calls GetCachedContent.
                         * @function getCachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetCachedContentRequest} request GetCachedContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.CacheService.GetCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(CacheService.prototype.getCachedContent = function getCachedContent(request, callback) {
                            return this.rpcCall(getCachedContent, $root.google.ai.generativelanguage.v1alpha.GetCachedContentRequest, $root.google.ai.generativelanguage.v1alpha.CachedContent, request, callback);
                        }, "name", { value: "GetCachedContent" });
    
                        /**
                         * Calls GetCachedContent.
                         * @function getCachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetCachedContentRequest} request GetCachedContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.CachedContent>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|updateCachedContent}.
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @typedef UpdateCachedContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.CachedContent} [response] CachedContent
                         */
    
                        /**
                         * Calls UpdateCachedContent.
                         * @function updateCachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest} request UpdateCachedContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.CacheService.UpdateCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(CacheService.prototype.updateCachedContent = function updateCachedContent(request, callback) {
                            return this.rpcCall(updateCachedContent, $root.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest, $root.google.ai.generativelanguage.v1alpha.CachedContent, request, callback);
                        }, "name", { value: "UpdateCachedContent" });
    
                        /**
                         * Calls UpdateCachedContent.
                         * @function updateCachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest} request UpdateCachedContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.CachedContent>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|deleteCachedContent}.
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @typedef DeleteCachedContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteCachedContent.
                         * @function deleteCachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest} request DeleteCachedContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.CacheService.DeleteCachedContentCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(CacheService.prototype.deleteCachedContent = function deleteCachedContent(request, callback) {
                            return this.rpcCall(deleteCachedContent, $root.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteCachedContent" });
    
                        /**
                         * Calls DeleteCachedContent.
                         * @function deleteCachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest} request DeleteCachedContentRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        return CacheService;
                    })();
    
                    v1alpha.ListCachedContentsRequest = (function() {
    
                        /**
                         * Properties of a ListCachedContentsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListCachedContentsRequest
                         * @property {number|null} [pageSize] ListCachedContentsRequest pageSize
                         * @property {string|null} [pageToken] ListCachedContentsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListCachedContentsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListCachedContentsRequest.
                         * @implements IListCachedContentsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsRequest=} [properties] Properties to set
                         */
                        function ListCachedContentsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListCachedContentsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @instance
                         */
                        ListCachedContentsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListCachedContentsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @instance
                         */
                        ListCachedContentsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListCachedContentsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsRequest} ListCachedContentsRequest instance
                         */
                        ListCachedContentsRequest.create = function create(properties) {
                            return new ListCachedContentsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListCachedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCachedContentsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCachedContentsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListCachedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCachedContentsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCachedContentsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListCachedContentsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsRequest} ListCachedContentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCachedContentsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListCachedContentsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsRequest} ListCachedContentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCachedContentsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListCachedContentsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListCachedContentsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListCachedContentsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsRequest} ListCachedContentsRequest
                         */
                        ListCachedContentsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListCachedContentsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListCachedContentsRequest} message ListCachedContentsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListCachedContentsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListCachedContentsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListCachedContentsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListCachedContentsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListCachedContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListCachedContentsRequest";
                        };
    
                        return ListCachedContentsRequest;
                    })();
    
                    v1alpha.ListCachedContentsResponse = (function() {
    
                        /**
                         * Properties of a ListCachedContentsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListCachedContentsResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ICachedContent>|null} [cachedContents] ListCachedContentsResponse cachedContents
                         * @property {string|null} [nextPageToken] ListCachedContentsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListCachedContentsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListCachedContentsResponse.
                         * @implements IListCachedContentsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsResponse=} [properties] Properties to set
                         */
                        function ListCachedContentsResponse(properties) {
                            this.cachedContents = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListCachedContentsResponse cachedContents.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ICachedContent>} cachedContents
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @instance
                         */
                        ListCachedContentsResponse.prototype.cachedContents = $util.emptyArray;
    
                        /**
                         * ListCachedContentsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @instance
                         */
                        ListCachedContentsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListCachedContentsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsResponse} ListCachedContentsResponse instance
                         */
                        ListCachedContentsResponse.create = function create(properties) {
                            return new ListCachedContentsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListCachedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCachedContentsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsResponse} message ListCachedContentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCachedContentsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.cachedContents != null && message.cachedContents.length)
                                for (var i = 0; i < message.cachedContents.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.CachedContent.encode(message.cachedContents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListCachedContentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCachedContentsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsResponse} message ListCachedContentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCachedContentsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListCachedContentsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsResponse} ListCachedContentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCachedContentsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListCachedContentsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.cachedContents && message.cachedContents.length))
                                            message.cachedContents = [];
                                        message.cachedContents.push($root.google.ai.generativelanguage.v1alpha.CachedContent.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListCachedContentsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsResponse} ListCachedContentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCachedContentsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListCachedContentsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListCachedContentsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.cachedContents != null && message.hasOwnProperty("cachedContents")) {
                                if (!Array.isArray(message.cachedContents))
                                    return "cachedContents: array expected";
                                for (var i = 0; i < message.cachedContents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.CachedContent.verify(message.cachedContents[i]);
                                    if (error)
                                        return "cachedContents." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListCachedContentsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsResponse} ListCachedContentsResponse
                         */
                        ListCachedContentsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListCachedContentsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListCachedContentsResponse();
                            if (object.cachedContents) {
                                if (!Array.isArray(object.cachedContents))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.ListCachedContentsResponse.cachedContents: array expected");
                                message.cachedContents = [];
                                for (var i = 0; i < object.cachedContents.length; ++i) {
                                    if (typeof object.cachedContents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.ListCachedContentsResponse.cachedContents: object expected");
                                    message.cachedContents[i] = $root.google.ai.generativelanguage.v1alpha.CachedContent.fromObject(object.cachedContents[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListCachedContentsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListCachedContentsResponse} message ListCachedContentsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListCachedContentsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.cachedContents = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.cachedContents && message.cachedContents.length) {
                                object.cachedContents = [];
                                for (var j = 0; j < message.cachedContents.length; ++j)
                                    object.cachedContents[j] = $root.google.ai.generativelanguage.v1alpha.CachedContent.toObject(message.cachedContents[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListCachedContentsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListCachedContentsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListCachedContentsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListCachedContentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListCachedContentsResponse";
                        };
    
                        return ListCachedContentsResponse;
                    })();
    
                    v1alpha.CreateCachedContentRequest = (function() {
    
                        /**
                         * Properties of a CreateCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICreateCachedContentRequest
                         * @property {google.ai.generativelanguage.v1alpha.ICachedContent|null} [cachedContent] CreateCachedContentRequest cachedContent
                         */
    
                        /**
                         * Constructs a new CreateCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CreateCachedContentRequest.
                         * @implements ICreateCachedContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest=} [properties] Properties to set
                         */
                        function CreateCachedContentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateCachedContentRequest cachedContent.
                         * @member {google.ai.generativelanguage.v1alpha.ICachedContent|null|undefined} cachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest
                         * @instance
                         */
                        CreateCachedContentRequest.prototype.cachedContent = null;
    
                        /**
                         * Creates a new CreateCachedContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CreateCachedContentRequest} CreateCachedContentRequest instance
                         */
                        CreateCachedContentRequest.create = function create(properties) {
                            return new CreateCachedContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateCachedContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest} message CreateCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateCachedContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.cachedContent != null && Object.hasOwnProperty.call(message, "cachedContent"))
                                $root.google.ai.generativelanguage.v1alpha.CachedContent.encode(message.cachedContent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateCachedContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest} message CreateCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateCachedContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CreateCachedContentRequest} CreateCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateCachedContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateCachedContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateCachedContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CreateCachedContentRequest} CreateCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateCachedContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateCachedContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateCachedContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.CachedContent.verify(message.cachedContent);
                                if (error)
                                    return "cachedContent." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateCachedContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CreateCachedContentRequest} CreateCachedContentRequest
                         */
                        CreateCachedContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateCachedContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CreateCachedContentRequest();
                            if (object.cachedContent != null) {
                                if (typeof object.cachedContent !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CreateCachedContentRequest.cachedContent: object expected");
                                message.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.fromObject(object.cachedContent);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateCachedContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CreateCachedContentRequest} message CreateCachedContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateCachedContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.cachedContent = null;
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent"))
                                object.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.toObject(message.cachedContent, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateCachedContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateCachedContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateCachedContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateCachedContentRequest";
                        };
    
                        return CreateCachedContentRequest;
                    })();
    
                    v1alpha.GetCachedContentRequest = (function() {
    
                        /**
                         * Properties of a GetCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGetCachedContentRequest
                         * @property {string|null} [name] GetCachedContentRequest name
                         */
    
                        /**
                         * Constructs a new GetCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GetCachedContentRequest.
                         * @implements IGetCachedContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGetCachedContentRequest=} [properties] Properties to set
                         */
                        function GetCachedContentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetCachedContentRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest
                         * @instance
                         */
                        GetCachedContentRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetCachedContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetCachedContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GetCachedContentRequest} GetCachedContentRequest instance
                         */
                        GetCachedContentRequest.create = function create(properties) {
                            return new GetCachedContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetCachedContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetCachedContentRequest} message GetCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetCachedContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetCachedContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetCachedContentRequest} message GetCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetCachedContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GetCachedContentRequest} GetCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetCachedContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetCachedContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetCachedContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GetCachedContentRequest} GetCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetCachedContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetCachedContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetCachedContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetCachedContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GetCachedContentRequest} GetCachedContentRequest
                         */
                        GetCachedContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetCachedContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GetCachedContentRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetCachedContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GetCachedContentRequest} message GetCachedContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetCachedContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetCachedContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetCachedContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetCachedContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetCachedContentRequest";
                        };
    
                        return GetCachedContentRequest;
                    })();
    
                    v1alpha.UpdateCachedContentRequest = (function() {
    
                        /**
                         * Properties of an UpdateCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IUpdateCachedContentRequest
                         * @property {google.ai.generativelanguage.v1alpha.ICachedContent|null} [cachedContent] UpdateCachedContentRequest cachedContent
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCachedContentRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdateCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an UpdateCachedContentRequest.
                         * @implements IUpdateCachedContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest=} [properties] Properties to set
                         */
                        function UpdateCachedContentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdateCachedContentRequest cachedContent.
                         * @member {google.ai.generativelanguage.v1alpha.ICachedContent|null|undefined} cachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @instance
                         */
                        UpdateCachedContentRequest.prototype.cachedContent = null;
    
                        /**
                         * UpdateCachedContentRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @instance
                         */
                        UpdateCachedContentRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdateCachedContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest} UpdateCachedContentRequest instance
                         */
                        UpdateCachedContentRequest.create = function create(properties) {
                            return new UpdateCachedContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest} message UpdateCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateCachedContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.cachedContent != null && Object.hasOwnProperty.call(message, "cachedContent"))
                                $root.google.ai.generativelanguage.v1alpha.CachedContent.encode(message.cachedContent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest} message UpdateCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdateCachedContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest} UpdateCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateCachedContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdateCachedContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest} UpdateCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateCachedContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdateCachedContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdateCachedContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.CachedContent.verify(message.cachedContent);
                                if (error)
                                    return "cachedContent." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdateCachedContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest} UpdateCachedContentRequest
                         */
                        UpdateCachedContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest();
                            if (object.cachedContent != null) {
                                if (typeof object.cachedContent !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest.cachedContent: object expected");
                                message.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.fromObject(object.cachedContent);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdateCachedContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest} message UpdateCachedContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdateCachedContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.cachedContent = null;
                                object.updateMask = null;
                            }
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent"))
                                object.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.toObject(message.cachedContent, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdateCachedContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdateCachedContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdateCachedContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdateCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest";
                        };
    
                        return UpdateCachedContentRequest;
                    })();
    
                    v1alpha.DeleteCachedContentRequest = (function() {
    
                        /**
                         * Properties of a DeleteCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IDeleteCachedContentRequest
                         * @property {string|null} [name] DeleteCachedContentRequest name
                         */
    
                        /**
                         * Constructs a new DeleteCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a DeleteCachedContentRequest.
                         * @implements IDeleteCachedContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest=} [properties] Properties to set
                         */
                        function DeleteCachedContentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteCachedContentRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest
                         * @instance
                         */
                        DeleteCachedContentRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeleteCachedContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest} DeleteCachedContentRequest instance
                         */
                        DeleteCachedContentRequest.create = function create(properties) {
                            return new DeleteCachedContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest} message DeleteCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteCachedContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest} message DeleteCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteCachedContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest} DeleteCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteCachedContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteCachedContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest} DeleteCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteCachedContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteCachedContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteCachedContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteCachedContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest} DeleteCachedContentRequest
                         */
                        DeleteCachedContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteCachedContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest} message DeleteCachedContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteCachedContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteCachedContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteCachedContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteCachedContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest";
                        };
    
                        return DeleteCachedContentRequest;
                    })();
    
                    v1alpha.CachedContent = (function() {
    
                        /**
                         * Properties of a CachedContent.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICachedContent
                         * @property {google.protobuf.ITimestamp|null} [expireTime] CachedContent expireTime
                         * @property {google.protobuf.IDuration|null} [ttl] CachedContent ttl
                         * @property {string|null} [name] CachedContent name
                         * @property {string|null} [displayName] CachedContent displayName
                         * @property {string|null} [model] CachedContent model
                         * @property {google.ai.generativelanguage.v1alpha.IContent|null} [systemInstruction] CachedContent systemInstruction
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IContent>|null} [contents] CachedContent contents
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ITool>|null} [tools] CachedContent tools
                         * @property {google.ai.generativelanguage.v1alpha.IToolConfig|null} [toolConfig] CachedContent toolConfig
                         * @property {google.protobuf.ITimestamp|null} [createTime] CachedContent createTime
                         * @property {google.protobuf.ITimestamp|null} [updateTime] CachedContent updateTime
                         * @property {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata|null} [usageMetadata] CachedContent usageMetadata
                         */
    
                        /**
                         * Constructs a new CachedContent.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CachedContent.
                         * @implements ICachedContent
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICachedContent=} [properties] Properties to set
                         */
                        function CachedContent(properties) {
                            this.contents = [];
                            this.tools = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CachedContent expireTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} expireTime
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.expireTime = null;
    
                        /**
                         * CachedContent ttl.
                         * @member {google.protobuf.IDuration|null|undefined} ttl
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.ttl = null;
    
                        /**
                         * CachedContent name.
                         * @member {string|null|undefined} name
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.name = null;
    
                        /**
                         * CachedContent displayName.
                         * @member {string|null|undefined} displayName
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.displayName = null;
    
                        /**
                         * CachedContent model.
                         * @member {string|null|undefined} model
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.model = null;
    
                        /**
                         * CachedContent systemInstruction.
                         * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} systemInstruction
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.systemInstruction = null;
    
                        /**
                         * CachedContent contents.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IContent>} contents
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.contents = $util.emptyArray;
    
                        /**
                         * CachedContent tools.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ITool>} tools
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.tools = $util.emptyArray;
    
                        /**
                         * CachedContent toolConfig.
                         * @member {google.ai.generativelanguage.v1alpha.IToolConfig|null|undefined} toolConfig
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.toolConfig = null;
    
                        /**
                         * CachedContent createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.createTime = null;
    
                        /**
                         * CachedContent updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.updateTime = null;
    
                        /**
                         * CachedContent usageMetadata.
                         * @member {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata|null|undefined} usageMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.usageMetadata = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CachedContent expiration.
                         * @member {"expireTime"|"ttl"|undefined} expiration
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "expiration", {
                            get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CachedContent _name.
                         * @member {"name"|undefined} _name
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "_name", {
                            get: $util.oneOfGetter($oneOfFields = ["name"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CachedContent _displayName.
                         * @member {"displayName"|undefined} _displayName
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "_displayName", {
                            get: $util.oneOfGetter($oneOfFields = ["displayName"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CachedContent _model.
                         * @member {"model"|undefined} _model
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "_model", {
                            get: $util.oneOfGetter($oneOfFields = ["model"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CachedContent _systemInstruction.
                         * @member {"systemInstruction"|undefined} _systemInstruction
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "_systemInstruction", {
                            get: $util.oneOfGetter($oneOfFields = ["systemInstruction"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CachedContent _toolConfig.
                         * @member {"toolConfig"|undefined} _toolConfig
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "_toolConfig", {
                            get: $util.oneOfGetter($oneOfFields = ["toolConfig"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CachedContent instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICachedContent=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CachedContent} CachedContent instance
                         */
                        CachedContent.create = function create(properties) {
                            return new CachedContent(properties);
                        };
    
                        /**
                         * Encodes the specified CachedContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CachedContent.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICachedContent} message CachedContent message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CachedContent.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.model);
                            if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction"))
                                $root.google.ai.generativelanguage.v1alpha.Content.encode(message.systemInstruction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.contents != null && message.contents.length)
                                for (var i = 0; i < message.contents.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Content.encode(message.contents[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.tools != null && message.tools.length)
                                for (var i = 0; i < message.tools.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Tool.encode(message.tools[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.toolConfig != null && Object.hasOwnProperty.call(message, "toolConfig"))
                                $root.google.ai.generativelanguage.v1alpha.ToolConfig.encode(message.toolConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime"))
                                $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                            if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl"))
                                $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 11, wireType 2 =*/90).string(message.displayName);
                            if (message.usageMetadata != null && Object.hasOwnProperty.call(message, "usageMetadata"))
                                $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CachedContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CachedContent.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICachedContent} message CachedContent message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CachedContent.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CachedContent message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CachedContent} CachedContent
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CachedContent.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CachedContent();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 9: {
                                        message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 10: {
                                        message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 11: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        if (!(message.contents && message.contents.length))
                                            message.contents = [];
                                        message.contents.push($root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 5: {
                                        if (!(message.tools && message.tools.length))
                                            message.tools = [];
                                        message.tools.push($root.google.ai.generativelanguage.v1alpha.Tool.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 6: {
                                        message.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 7: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 8: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 12: {
                                        message.usageMetadata = $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CachedContent message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CachedContent} CachedContent
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CachedContent.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CachedContent message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CachedContent.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.expireTime != null && message.hasOwnProperty("expireTime")) {
                                properties.expiration = 1;
                                {
                                    var error = $root.google.protobuf.Timestamp.verify(message.expireTime);
                                    if (error)
                                        return "expireTime." + error;
                                }
                            }
                            if (message.ttl != null && message.hasOwnProperty("ttl")) {
                                if (properties.expiration === 1)
                                    return "expiration: multiple values";
                                properties.expiration = 1;
                                {
                                    var error = $root.google.protobuf.Duration.verify(message.ttl);
                                    if (error)
                                        return "ttl." + error;
                                }
                            }
                            if (message.name != null && message.hasOwnProperty("name")) {
                                properties._name = 1;
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            }
                            if (message.displayName != null && message.hasOwnProperty("displayName")) {
                                properties._displayName = 1;
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            }
                            if (message.model != null && message.hasOwnProperty("model")) {
                                properties._model = 1;
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            }
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) {
                                properties._systemInstruction = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.systemInstruction);
                                    if (error)
                                        return "systemInstruction." + error;
                                }
                            }
                            if (message.contents != null && message.hasOwnProperty("contents")) {
                                if (!Array.isArray(message.contents))
                                    return "contents: array expected";
                                for (var i = 0; i < message.contents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.contents[i]);
                                    if (error)
                                        return "contents." + error;
                                }
                            }
                            if (message.tools != null && message.hasOwnProperty("tools")) {
                                if (!Array.isArray(message.tools))
                                    return "tools: array expected";
                                for (var i = 0; i < message.tools.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Tool.verify(message.tools[i]);
                                    if (error)
                                        return "tools." + error;
                                }
                            }
                            if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) {
                                properties._toolConfig = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.ToolConfig.verify(message.toolConfig);
                                    if (error)
                                        return "toolConfig." + error;
                                }
                            }
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.verify(message.usageMetadata);
                                if (error)
                                    return "usageMetadata." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CachedContent message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CachedContent} CachedContent
                         */
                        CachedContent.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CachedContent)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CachedContent();
                            if (object.expireTime != null) {
                                if (typeof object.expireTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.expireTime: object expected");
                                message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime);
                            }
                            if (object.ttl != null) {
                                if (typeof object.ttl !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.ttl: object expected");
                                message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl);
                            }
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.systemInstruction != null) {
                                if (typeof object.systemInstruction !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.systemInstruction: object expected");
                                message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.systemInstruction);
                            }
                            if (object.contents) {
                                if (!Array.isArray(object.contents))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.contents: array expected");
                                message.contents = [];
                                for (var i = 0; i < object.contents.length; ++i) {
                                    if (typeof object.contents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.contents: object expected");
                                    message.contents[i] = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.contents[i]);
                                }
                            }
                            if (object.tools) {
                                if (!Array.isArray(object.tools))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.tools: array expected");
                                message.tools = [];
                                for (var i = 0; i < object.tools.length; ++i) {
                                    if (typeof object.tools[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.tools: object expected");
                                    message.tools[i] = $root.google.ai.generativelanguage.v1alpha.Tool.fromObject(object.tools[i]);
                                }
                            }
                            if (object.toolConfig != null) {
                                if (typeof object.toolConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.toolConfig: object expected");
                                message.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.fromObject(object.toolConfig);
                            }
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            if (object.usageMetadata != null) {
                                if (typeof object.usageMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.usageMetadata: object expected");
                                message.usageMetadata = $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.fromObject(object.usageMetadata);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CachedContent message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CachedContent} message CachedContent
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CachedContent.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.contents = [];
                                object.tools = [];
                            }
                            if (options.defaults) {
                                object.createTime = null;
                                object.updateTime = null;
                                object.usageMetadata = null;
                            }
                            if (message.name != null && message.hasOwnProperty("name")) {
                                object.name = message.name;
                                if (options.oneofs)
                                    object._name = "name";
                            }
                            if (message.model != null && message.hasOwnProperty("model")) {
                                object.model = message.model;
                                if (options.oneofs)
                                    object._model = "model";
                            }
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) {
                                object.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.systemInstruction, options);
                                if (options.oneofs)
                                    object._systemInstruction = "systemInstruction";
                            }
                            if (message.contents && message.contents.length) {
                                object.contents = [];
                                for (var j = 0; j < message.contents.length; ++j)
                                    object.contents[j] = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.contents[j], options);
                            }
                            if (message.tools && message.tools.length) {
                                object.tools = [];
                                for (var j = 0; j < message.tools.length; ++j)
                                    object.tools[j] = $root.google.ai.generativelanguage.v1alpha.Tool.toObject(message.tools[j], options);
                            }
                            if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) {
                                object.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.toObject(message.toolConfig, options);
                                if (options.oneofs)
                                    object._toolConfig = "toolConfig";
                            }
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            if (message.expireTime != null && message.hasOwnProperty("expireTime")) {
                                object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options);
                                if (options.oneofs)
                                    object.expiration = "expireTime";
                            }
                            if (message.ttl != null && message.hasOwnProperty("ttl")) {
                                object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options);
                                if (options.oneofs)
                                    object.expiration = "ttl";
                            }
                            if (message.displayName != null && message.hasOwnProperty("displayName")) {
                                object.displayName = message.displayName;
                                if (options.oneofs)
                                    object._displayName = "displayName";
                            }
                            if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata"))
                                object.usageMetadata = $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.toObject(message.usageMetadata, options);
                            return object;
                        };
    
                        /**
                         * Converts this CachedContent to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CachedContent.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CachedContent
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CachedContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CachedContent";
                        };
    
                        CachedContent.UsageMetadata = (function() {
    
                            /**
                             * Properties of a UsageMetadata.
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                             * @interface IUsageMetadata
                             * @property {number|null} [totalTokenCount] UsageMetadata totalTokenCount
                             */
    
                            /**
                             * Constructs a new UsageMetadata.
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent
                             * @classdesc Represents a UsageMetadata.
                             * @implements IUsageMetadata
                             * @constructor
                             * @param {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata=} [properties] Properties to set
                             */
                            function UsageMetadata(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * UsageMetadata totalTokenCount.
                             * @member {number} totalTokenCount
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.totalTokenCount = 0;
    
                            /**
                             * Creates a new UsageMetadata instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata} UsageMetadata instance
                             */
                            UsageMetadata.create = function create(properties) {
                                return new UsageMetadata(properties);
                            };
    
                            /**
                             * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata} message UsageMetadata message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            UsageMetadata.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.totalTokenCount != null && Object.hasOwnProperty.call(message, "totalTokenCount"))
                                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalTokenCount);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata} message UsageMetadata message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            UsageMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a UsageMetadata message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata} UsageMetadata
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            UsageMetadata.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.totalTokenCount = reader.int32();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a UsageMetadata message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata} UsageMetadata
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            UsageMetadata.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a UsageMetadata message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            UsageMetadata.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount"))
                                    if (!$util.isInteger(message.totalTokenCount))
                                        return "totalTokenCount: integer expected";
                                return null;
                            };
    
                            /**
                             * Creates a UsageMetadata message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata} UsageMetadata
                             */
                            UsageMetadata.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata();
                                if (object.totalTokenCount != null)
                                    message.totalTokenCount = object.totalTokenCount | 0;
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a UsageMetadata message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata} message UsageMetadata
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            UsageMetadata.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.defaults)
                                    object.totalTokenCount = 0;
                                if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount"))
                                    object.totalTokenCount = message.totalTokenCount;
                                return object;
                            };
    
                            /**
                             * Converts this UsageMetadata to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            UsageMetadata.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for UsageMetadata
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            UsageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata";
                            };
    
                            return UsageMetadata;
                        })();
    
                        return CachedContent;
                    })();
    
                    /**
                     * Type enum.
                     * @name google.ai.generativelanguage.v1alpha.Type
                     * @enum {number}
                     * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value
                     * @property {number} STRING=1 STRING value
                     * @property {number} NUMBER=2 NUMBER value
                     * @property {number} INTEGER=3 INTEGER value
                     * @property {number} BOOLEAN=4 BOOLEAN value
                     * @property {number} ARRAY=5 ARRAY value
                     * @property {number} OBJECT=6 OBJECT value
                     */
                    v1alpha.Type = (function() {
                        var valuesById = {}, values = Object.create(valuesById);
                        values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0;
                        values[valuesById[1] = "STRING"] = 1;
                        values[valuesById[2] = "NUMBER"] = 2;
                        values[valuesById[3] = "INTEGER"] = 3;
                        values[valuesById[4] = "BOOLEAN"] = 4;
                        values[valuesById[5] = "ARRAY"] = 5;
                        values[valuesById[6] = "OBJECT"] = 6;
                        return values;
                    })();
    
                    v1alpha.Content = (function() {
    
                        /**
                         * Properties of a Content.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IContent
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IPart>|null} [parts] Content parts
                         * @property {string|null} [role] Content role
                         */
    
                        /**
                         * Constructs a new Content.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Content.
                         * @implements IContent
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IContent=} [properties] Properties to set
                         */
                        function Content(properties) {
                            this.parts = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Content parts.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IPart>} parts
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @instance
                         */
                        Content.prototype.parts = $util.emptyArray;
    
                        /**
                         * Content role.
                         * @member {string} role
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @instance
                         */
                        Content.prototype.role = "";
    
                        /**
                         * Creates a new Content instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IContent=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Content} Content instance
                         */
                        Content.create = function create(properties) {
                            return new Content(properties);
                        };
    
                        /**
                         * Encodes the specified Content message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Content.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IContent} message Content message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Content.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parts != null && message.parts.length)
                                for (var i = 0; i < message.parts.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Part.encode(message.parts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.role != null && Object.hasOwnProperty.call(message, "role"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.role);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Content message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Content.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IContent} message Content message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Content.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Content message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Content} Content
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Content.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Content();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.parts && message.parts.length))
                                            message.parts = [];
                                        message.parts.push($root.google.ai.generativelanguage.v1alpha.Part.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.role = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Content message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Content} Content
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Content.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Content message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Content.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parts != null && message.hasOwnProperty("parts")) {
                                if (!Array.isArray(message.parts))
                                    return "parts: array expected";
                                for (var i = 0; i < message.parts.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Part.verify(message.parts[i]);
                                    if (error)
                                        return "parts." + error;
                                }
                            }
                            if (message.role != null && message.hasOwnProperty("role"))
                                if (!$util.isString(message.role))
                                    return "role: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a Content message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Content} Content
                         */
                        Content.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Content)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Content();
                            if (object.parts) {
                                if (!Array.isArray(object.parts))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Content.parts: array expected");
                                message.parts = [];
                                for (var i = 0; i < object.parts.length; ++i) {
                                    if (typeof object.parts[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.Content.parts: object expected");
                                    message.parts[i] = $root.google.ai.generativelanguage.v1alpha.Part.fromObject(object.parts[i]);
                                }
                            }
                            if (object.role != null)
                                message.role = String(object.role);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Content message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Content} message Content
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Content.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.parts = [];
                            if (options.defaults)
                                object.role = "";
                            if (message.parts && message.parts.length) {
                                object.parts = [];
                                for (var j = 0; j < message.parts.length; ++j)
                                    object.parts[j] = $root.google.ai.generativelanguage.v1alpha.Part.toObject(message.parts[j], options);
                            }
                            if (message.role != null && message.hasOwnProperty("role"))
                                object.role = message.role;
                            return object;
                        };
    
                        /**
                         * Converts this Content to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Content.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Content
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Content
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Content.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Content";
                        };
    
                        return Content;
                    })();
    
                    v1alpha.Part = (function() {
    
                        /**
                         * Properties of a Part.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IPart
                         * @property {string|null} [text] Part text
                         * @property {google.ai.generativelanguage.v1alpha.IBlob|null} [inlineData] Part inlineData
                         * @property {google.ai.generativelanguage.v1alpha.IFunctionCall|null} [functionCall] Part functionCall
                         * @property {google.ai.generativelanguage.v1alpha.IFunctionResponse|null} [functionResponse] Part functionResponse
                         * @property {google.ai.generativelanguage.v1alpha.IFileData|null} [fileData] Part fileData
                         * @property {google.ai.generativelanguage.v1alpha.IExecutableCode|null} [executableCode] Part executableCode
                         * @property {google.ai.generativelanguage.v1alpha.ICodeExecutionResult|null} [codeExecutionResult] Part codeExecutionResult
                         */
    
                        /**
                         * Constructs a new Part.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Part.
                         * @implements IPart
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IPart=} [properties] Properties to set
                         */
                        function Part(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Part text.
                         * @member {string|null|undefined} text
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @instance
                         */
                        Part.prototype.text = null;
    
                        /**
                         * Part inlineData.
                         * @member {google.ai.generativelanguage.v1alpha.IBlob|null|undefined} inlineData
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @instance
                         */
                        Part.prototype.inlineData = null;
    
                        /**
                         * Part functionCall.
                         * @member {google.ai.generativelanguage.v1alpha.IFunctionCall|null|undefined} functionCall
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @instance
                         */
                        Part.prototype.functionCall = null;
    
                        /**
                         * Part functionResponse.
                         * @member {google.ai.generativelanguage.v1alpha.IFunctionResponse|null|undefined} functionResponse
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @instance
                         */
                        Part.prototype.functionResponse = null;
    
                        /**
                         * Part fileData.
                         * @member {google.ai.generativelanguage.v1alpha.IFileData|null|undefined} fileData
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @instance
                         */
                        Part.prototype.fileData = null;
    
                        /**
                         * Part executableCode.
                         * @member {google.ai.generativelanguage.v1alpha.IExecutableCode|null|undefined} executableCode
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @instance
                         */
                        Part.prototype.executableCode = null;
    
                        /**
                         * Part codeExecutionResult.
                         * @member {google.ai.generativelanguage.v1alpha.ICodeExecutionResult|null|undefined} codeExecutionResult
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @instance
                         */
                        Part.prototype.codeExecutionResult = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Part data.
                         * @member {"text"|"inlineData"|"functionCall"|"functionResponse"|"fileData"|"executableCode"|"codeExecutionResult"|undefined} data
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @instance
                         */
                        Object.defineProperty(Part.prototype, "data", {
                            get: $util.oneOfGetter($oneOfFields = ["text", "inlineData", "functionCall", "functionResponse", "fileData", "executableCode", "codeExecutionResult"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Part instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPart=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Part} Part instance
                         */
                        Part.create = function create(properties) {
                            return new Part(properties);
                        };
    
                        /**
                         * Encodes the specified Part message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Part.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPart} message Part message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Part.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.text);
                            if (message.inlineData != null && Object.hasOwnProperty.call(message, "inlineData"))
                                $root.google.ai.generativelanguage.v1alpha.Blob.encode(message.inlineData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.functionCall != null && Object.hasOwnProperty.call(message, "functionCall"))
                                $root.google.ai.generativelanguage.v1alpha.FunctionCall.encode(message.functionCall, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.functionResponse != null && Object.hasOwnProperty.call(message, "functionResponse"))
                                $root.google.ai.generativelanguage.v1alpha.FunctionResponse.encode(message.functionResponse, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.fileData != null && Object.hasOwnProperty.call(message, "fileData"))
                                $root.google.ai.generativelanguage.v1alpha.FileData.encode(message.fileData, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.executableCode != null && Object.hasOwnProperty.call(message, "executableCode"))
                                $root.google.ai.generativelanguage.v1alpha.ExecutableCode.encode(message.executableCode, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                            if (message.codeExecutionResult != null && Object.hasOwnProperty.call(message, "codeExecutionResult"))
                                $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.encode(message.codeExecutionResult, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Part message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Part.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPart} message Part message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Part.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Part message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Part} Part
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Part.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Part();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.text = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.inlineData = $root.google.ai.generativelanguage.v1alpha.Blob.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.functionCall = $root.google.ai.generativelanguage.v1alpha.FunctionCall.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        message.functionResponse = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 6: {
                                        message.fileData = $root.google.ai.generativelanguage.v1alpha.FileData.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 9: {
                                        message.executableCode = $root.google.ai.generativelanguage.v1alpha.ExecutableCode.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 10: {
                                        message.codeExecutionResult = $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Part message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Part} Part
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Part.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Part message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Part.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.text != null && message.hasOwnProperty("text")) {
                                properties.data = 1;
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            }
                            if (message.inlineData != null && message.hasOwnProperty("inlineData")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Blob.verify(message.inlineData);
                                    if (error)
                                        return "inlineData." + error;
                                }
                            }
                            if (message.functionCall != null && message.hasOwnProperty("functionCall")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.FunctionCall.verify(message.functionCall);
                                    if (error)
                                        return "functionCall." + error;
                                }
                            }
                            if (message.functionResponse != null && message.hasOwnProperty("functionResponse")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.verify(message.functionResponse);
                                    if (error)
                                        return "functionResponse." + error;
                                }
                            }
                            if (message.fileData != null && message.hasOwnProperty("fileData")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.FileData.verify(message.fileData);
                                    if (error)
                                        return "fileData." + error;
                                }
                            }
                            if (message.executableCode != null && message.hasOwnProperty("executableCode")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.ExecutableCode.verify(message.executableCode);
                                    if (error)
                                        return "executableCode." + error;
                                }
                            }
                            if (message.codeExecutionResult != null && message.hasOwnProperty("codeExecutionResult")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.verify(message.codeExecutionResult);
                                    if (error)
                                        return "codeExecutionResult." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Part message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Part} Part
                         */
                        Part.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Part)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Part();
                            if (object.text != null)
                                message.text = String(object.text);
                            if (object.inlineData != null) {
                                if (typeof object.inlineData !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Part.inlineData: object expected");
                                message.inlineData = $root.google.ai.generativelanguage.v1alpha.Blob.fromObject(object.inlineData);
                            }
                            if (object.functionCall != null) {
                                if (typeof object.functionCall !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Part.functionCall: object expected");
                                message.functionCall = $root.google.ai.generativelanguage.v1alpha.FunctionCall.fromObject(object.functionCall);
                            }
                            if (object.functionResponse != null) {
                                if (typeof object.functionResponse !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Part.functionResponse: object expected");
                                message.functionResponse = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.fromObject(object.functionResponse);
                            }
                            if (object.fileData != null) {
                                if (typeof object.fileData !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Part.fileData: object expected");
                                message.fileData = $root.google.ai.generativelanguage.v1alpha.FileData.fromObject(object.fileData);
                            }
                            if (object.executableCode != null) {
                                if (typeof object.executableCode !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Part.executableCode: object expected");
                                message.executableCode = $root.google.ai.generativelanguage.v1alpha.ExecutableCode.fromObject(object.executableCode);
                            }
                            if (object.codeExecutionResult != null) {
                                if (typeof object.codeExecutionResult !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Part.codeExecutionResult: object expected");
                                message.codeExecutionResult = $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.fromObject(object.codeExecutionResult);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Part message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Part} message Part
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Part.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.text != null && message.hasOwnProperty("text")) {
                                object.text = message.text;
                                if (options.oneofs)
                                    object.data = "text";
                            }
                            if (message.inlineData != null && message.hasOwnProperty("inlineData")) {
                                object.inlineData = $root.google.ai.generativelanguage.v1alpha.Blob.toObject(message.inlineData, options);
                                if (options.oneofs)
                                    object.data = "inlineData";
                            }
                            if (message.functionCall != null && message.hasOwnProperty("functionCall")) {
                                object.functionCall = $root.google.ai.generativelanguage.v1alpha.FunctionCall.toObject(message.functionCall, options);
                                if (options.oneofs)
                                    object.data = "functionCall";
                            }
                            if (message.functionResponse != null && message.hasOwnProperty("functionResponse")) {
                                object.functionResponse = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.toObject(message.functionResponse, options);
                                if (options.oneofs)
                                    object.data = "functionResponse";
                            }
                            if (message.fileData != null && message.hasOwnProperty("fileData")) {
                                object.fileData = $root.google.ai.generativelanguage.v1alpha.FileData.toObject(message.fileData, options);
                                if (options.oneofs)
                                    object.data = "fileData";
                            }
                            if (message.executableCode != null && message.hasOwnProperty("executableCode")) {
                                object.executableCode = $root.google.ai.generativelanguage.v1alpha.ExecutableCode.toObject(message.executableCode, options);
                                if (options.oneofs)
                                    object.data = "executableCode";
                            }
                            if (message.codeExecutionResult != null && message.hasOwnProperty("codeExecutionResult")) {
                                object.codeExecutionResult = $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.toObject(message.codeExecutionResult, options);
                                if (options.oneofs)
                                    object.data = "codeExecutionResult";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Part to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Part.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Part
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Part
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Part.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Part";
                        };
    
                        return Part;
                    })();
    
                    v1alpha.Blob = (function() {
    
                        /**
                         * Properties of a Blob.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBlob
                         * @property {string|null} [mimeType] Blob mimeType
                         * @property {Uint8Array|null} [data] Blob data
                         */
    
                        /**
                         * Constructs a new Blob.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Blob.
                         * @implements IBlob
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBlob=} [properties] Properties to set
                         */
                        function Blob(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Blob mimeType.
                         * @member {string} mimeType
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @instance
                         */
                        Blob.prototype.mimeType = "";
    
                        /**
                         * Blob data.
                         * @member {Uint8Array} data
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @instance
                         */
                        Blob.prototype.data = $util.newBuffer([]);
    
                        /**
                         * Creates a new Blob instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBlob=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Blob} Blob instance
                         */
                        Blob.create = function create(properties) {
                            return new Blob(properties);
                        };
    
                        /**
                         * Encodes the specified Blob message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Blob.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBlob} message Blob message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Blob.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType);
                            if (message.data != null && Object.hasOwnProperty.call(message, "data"))
                                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Blob.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBlob} message Blob message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Blob.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Blob message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Blob} Blob
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Blob.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Blob();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.mimeType = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.data = reader.bytes();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Blob message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Blob} Blob
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Blob.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Blob message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Blob.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                if (!$util.isString(message.mimeType))
                                    return "mimeType: string expected";
                            if (message.data != null && message.hasOwnProperty("data"))
                                if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data)))
                                    return "data: buffer expected";
                            return null;
                        };
    
                        /**
                         * Creates a Blob message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Blob} Blob
                         */
                        Blob.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Blob)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Blob();
                            if (object.mimeType != null)
                                message.mimeType = String(object.mimeType);
                            if (object.data != null)
                                if (typeof object.data === "string")
                                    $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0);
                                else if (object.data.length >= 0)
                                    message.data = object.data;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Blob message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Blob} message Blob
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Blob.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.mimeType = "";
                                if (options.bytes === String)
                                    object.data = "";
                                else {
                                    object.data = [];
                                    if (options.bytes !== Array)
                                        object.data = $util.newBuffer(object.data);
                                }
                            }
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                object.mimeType = message.mimeType;
                            if (message.data != null && message.hasOwnProperty("data"))
                                object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data;
                            return object;
                        };
    
                        /**
                         * Converts this Blob to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Blob.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Blob
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Blob
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Blob.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Blob";
                        };
    
                        return Blob;
                    })();
    
                    v1alpha.FileData = (function() {
    
                        /**
                         * Properties of a FileData.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IFileData
                         * @property {string|null} [mimeType] FileData mimeType
                         * @property {string|null} [fileUri] FileData fileUri
                         */
    
                        /**
                         * Constructs a new FileData.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a FileData.
                         * @implements IFileData
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IFileData=} [properties] Properties to set
                         */
                        function FileData(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * FileData mimeType.
                         * @member {string} mimeType
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @instance
                         */
                        FileData.prototype.mimeType = "";
    
                        /**
                         * FileData fileUri.
                         * @member {string} fileUri
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @instance
                         */
                        FileData.prototype.fileUri = "";
    
                        /**
                         * Creates a new FileData instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFileData=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.FileData} FileData instance
                         */
                        FileData.create = function create(properties) {
                            return new FileData(properties);
                        };
    
                        /**
                         * Encodes the specified FileData message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FileData.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFileData} message FileData message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FileData.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType);
                            if (message.fileUri != null && Object.hasOwnProperty.call(message, "fileUri"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.fileUri);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified FileData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FileData.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFileData} message FileData message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FileData.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a FileData message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.FileData} FileData
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FileData.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.FileData();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.mimeType = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.fileUri = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a FileData message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.FileData} FileData
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FileData.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a FileData message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        FileData.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                if (!$util.isString(message.mimeType))
                                    return "mimeType: string expected";
                            if (message.fileUri != null && message.hasOwnProperty("fileUri"))
                                if (!$util.isString(message.fileUri))
                                    return "fileUri: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a FileData message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.FileData} FileData
                         */
                        FileData.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.FileData)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.FileData();
                            if (object.mimeType != null)
                                message.mimeType = String(object.mimeType);
                            if (object.fileUri != null)
                                message.fileUri = String(object.fileUri);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a FileData message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.FileData} message FileData
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        FileData.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.mimeType = "";
                                object.fileUri = "";
                            }
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                object.mimeType = message.mimeType;
                            if (message.fileUri != null && message.hasOwnProperty("fileUri"))
                                object.fileUri = message.fileUri;
                            return object;
                        };
    
                        /**
                         * Converts this FileData to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        FileData.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for FileData
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.FileData
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        FileData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.FileData";
                        };
    
                        return FileData;
                    })();
    
                    v1alpha.ExecutableCode = (function() {
    
                        /**
                         * Properties of an ExecutableCode.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IExecutableCode
                         * @property {google.ai.generativelanguage.v1alpha.ExecutableCode.Language|null} [language] ExecutableCode language
                         * @property {string|null} [code] ExecutableCode code
                         */
    
                        /**
                         * Constructs a new ExecutableCode.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an ExecutableCode.
                         * @implements IExecutableCode
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IExecutableCode=} [properties] Properties to set
                         */
                        function ExecutableCode(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ExecutableCode language.
                         * @member {google.ai.generativelanguage.v1alpha.ExecutableCode.Language} language
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @instance
                         */
                        ExecutableCode.prototype.language = 0;
    
                        /**
                         * ExecutableCode code.
                         * @member {string} code
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @instance
                         */
                        ExecutableCode.prototype.code = "";
    
                        /**
                         * Creates a new ExecutableCode instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IExecutableCode=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ExecutableCode} ExecutableCode instance
                         */
                        ExecutableCode.create = function create(properties) {
                            return new ExecutableCode(properties);
                        };
    
                        /**
                         * Encodes the specified ExecutableCode message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ExecutableCode.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IExecutableCode} message ExecutableCode message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ExecutableCode.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.language != null && Object.hasOwnProperty.call(message, "language"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.language);
                            if (message.code != null && Object.hasOwnProperty.call(message, "code"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.code);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ExecutableCode message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ExecutableCode.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IExecutableCode} message ExecutableCode message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ExecutableCode.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an ExecutableCode message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ExecutableCode} ExecutableCode
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ExecutableCode.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ExecutableCode();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.language = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.code = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an ExecutableCode message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ExecutableCode} ExecutableCode
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ExecutableCode.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an ExecutableCode message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ExecutableCode.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.language != null && message.hasOwnProperty("language"))
                                switch (message.language) {
                                default:
                                    return "language: enum value expected";
                                case 0:
                                case 1:
                                    break;
                                }
                            if (message.code != null && message.hasOwnProperty("code"))
                                if (!$util.isString(message.code))
                                    return "code: string expected";
                            return null;
                        };
    
                        /**
                         * Creates an ExecutableCode message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ExecutableCode} ExecutableCode
                         */
                        ExecutableCode.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ExecutableCode)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ExecutableCode();
                            switch (object.language) {
                            default:
                                if (typeof object.language === "number") {
                                    message.language = object.language;
                                    break;
                                }
                                break;
                            case "LANGUAGE_UNSPECIFIED":
                            case 0:
                                message.language = 0;
                                break;
                            case "PYTHON":
                            case 1:
                                message.language = 1;
                                break;
                            }
                            if (object.code != null)
                                message.code = String(object.code);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an ExecutableCode message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ExecutableCode} message ExecutableCode
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ExecutableCode.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.language = options.enums === String ? "LANGUAGE_UNSPECIFIED" : 0;
                                object.code = "";
                            }
                            if (message.language != null && message.hasOwnProperty("language"))
                                object.language = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.ExecutableCode.Language[message.language] === undefined ? message.language : $root.google.ai.generativelanguage.v1alpha.ExecutableCode.Language[message.language] : message.language;
                            if (message.code != null && message.hasOwnProperty("code"))
                                object.code = message.code;
                            return object;
                        };
    
                        /**
                         * Converts this ExecutableCode to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ExecutableCode.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ExecutableCode
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ExecutableCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ExecutableCode";
                        };
    
                        /**
                         * Language enum.
                         * @name google.ai.generativelanguage.v1alpha.ExecutableCode.Language
                         * @enum {number}
                         * @property {number} LANGUAGE_UNSPECIFIED=0 LANGUAGE_UNSPECIFIED value
                         * @property {number} PYTHON=1 PYTHON value
                         */
                        ExecutableCode.Language = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "LANGUAGE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "PYTHON"] = 1;
                            return values;
                        })();
    
                        return ExecutableCode;
                    })();
    
                    v1alpha.CodeExecutionResult = (function() {
    
                        /**
                         * Properties of a CodeExecutionResult.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICodeExecutionResult
                         * @property {google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome|null} [outcome] CodeExecutionResult outcome
                         * @property {string|null} [output] CodeExecutionResult output
                         */
    
                        /**
                         * Constructs a new CodeExecutionResult.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CodeExecutionResult.
                         * @implements ICodeExecutionResult
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICodeExecutionResult=} [properties] Properties to set
                         */
                        function CodeExecutionResult(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CodeExecutionResult outcome.
                         * @member {google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome} outcome
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @instance
                         */
                        CodeExecutionResult.prototype.outcome = 0;
    
                        /**
                         * CodeExecutionResult output.
                         * @member {string} output
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @instance
                         */
                        CodeExecutionResult.prototype.output = "";
    
                        /**
                         * Creates a new CodeExecutionResult instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICodeExecutionResult=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CodeExecutionResult} CodeExecutionResult instance
                         */
                        CodeExecutionResult.create = function create(properties) {
                            return new CodeExecutionResult(properties);
                        };
    
                        /**
                         * Encodes the specified CodeExecutionResult message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CodeExecutionResult.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CodeExecutionResult.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.outcome);
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.output);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CodeExecutionResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CodeExecutionResult.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CodeExecutionResult.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CodeExecutionResult message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CodeExecutionResult} CodeExecutionResult
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CodeExecutionResult.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.outcome = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.output = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CodeExecutionResult message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CodeExecutionResult} CodeExecutionResult
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CodeExecutionResult.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CodeExecutionResult message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CodeExecutionResult.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.outcome != null && message.hasOwnProperty("outcome"))
                                switch (message.outcome) {
                                default:
                                    return "outcome: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            if (message.output != null && message.hasOwnProperty("output"))
                                if (!$util.isString(message.output))
                                    return "output: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a CodeExecutionResult message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CodeExecutionResult} CodeExecutionResult
                         */
                        CodeExecutionResult.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult();
                            switch (object.outcome) {
                            default:
                                if (typeof object.outcome === "number") {
                                    message.outcome = object.outcome;
                                    break;
                                }
                                break;
                            case "OUTCOME_UNSPECIFIED":
                            case 0:
                                message.outcome = 0;
                                break;
                            case "OUTCOME_OK":
                            case 1:
                                message.outcome = 1;
                                break;
                            case "OUTCOME_FAILED":
                            case 2:
                                message.outcome = 2;
                                break;
                            case "OUTCOME_DEADLINE_EXCEEDED":
                            case 3:
                                message.outcome = 3;
                                break;
                            }
                            if (object.output != null)
                                message.output = String(object.output);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CodeExecutionResult message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CodeExecutionResult} message CodeExecutionResult
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CodeExecutionResult.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0;
                                object.output = "";
                            }
                            if (message.outcome != null && message.hasOwnProperty("outcome"))
                                object.outcome = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome[message.outcome] : message.outcome;
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = message.output;
                            return object;
                        };
    
                        /**
                         * Converts this CodeExecutionResult to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CodeExecutionResult.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CodeExecutionResult
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CodeExecutionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CodeExecutionResult";
                        };
    
                        /**
                         * Outcome enum.
                         * @name google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome
                         * @enum {number}
                         * @property {number} OUTCOME_UNSPECIFIED=0 OUTCOME_UNSPECIFIED value
                         * @property {number} OUTCOME_OK=1 OUTCOME_OK value
                         * @property {number} OUTCOME_FAILED=2 OUTCOME_FAILED value
                         * @property {number} OUTCOME_DEADLINE_EXCEEDED=3 OUTCOME_DEADLINE_EXCEEDED value
                         */
                        CodeExecutionResult.Outcome = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "OUTCOME_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "OUTCOME_OK"] = 1;
                            values[valuesById[2] = "OUTCOME_FAILED"] = 2;
                            values[valuesById[3] = "OUTCOME_DEADLINE_EXCEEDED"] = 3;
                            return values;
                        })();
    
                        return CodeExecutionResult;
                    })();
    
                    v1alpha.Tool = (function() {
    
                        /**
                         * Properties of a Tool.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITool
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IFunctionDeclaration>|null} [functionDeclarations] Tool functionDeclarations
                         * @property {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval|null} [googleSearchRetrieval] Tool googleSearchRetrieval
                         * @property {google.ai.generativelanguage.v1alpha.ICodeExecution|null} [codeExecution] Tool codeExecution
                         * @property {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch|null} [googleSearch] Tool googleSearch
                         */
    
                        /**
                         * Constructs a new Tool.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Tool.
                         * @implements ITool
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITool=} [properties] Properties to set
                         */
                        function Tool(properties) {
                            this.functionDeclarations = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Tool functionDeclarations.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IFunctionDeclaration>} functionDeclarations
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @instance
                         */
                        Tool.prototype.functionDeclarations = $util.emptyArray;
    
                        /**
                         * Tool googleSearchRetrieval.
                         * @member {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval|null|undefined} googleSearchRetrieval
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @instance
                         */
                        Tool.prototype.googleSearchRetrieval = null;
    
                        /**
                         * Tool codeExecution.
                         * @member {google.ai.generativelanguage.v1alpha.ICodeExecution|null|undefined} codeExecution
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @instance
                         */
                        Tool.prototype.codeExecution = null;
    
                        /**
                         * Tool googleSearch.
                         * @member {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch|null|undefined} googleSearch
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @instance
                         */
                        Tool.prototype.googleSearch = null;
    
                        /**
                         * Creates a new Tool instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITool=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Tool} Tool instance
                         */
                        Tool.create = function create(properties) {
                            return new Tool(properties);
                        };
    
                        /**
                         * Encodes the specified Tool message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Tool.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITool} message Tool message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Tool.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.functionDeclarations != null && message.functionDeclarations.length)
                                for (var i = 0; i < message.functionDeclarations.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration.encode(message.functionDeclarations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.googleSearchRetrieval != null && Object.hasOwnProperty.call(message, "googleSearchRetrieval"))
                                $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.encode(message.googleSearchRetrieval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.codeExecution != null && Object.hasOwnProperty.call(message, "codeExecution"))
                                $root.google.ai.generativelanguage.v1alpha.CodeExecution.encode(message.codeExecution, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.googleSearch != null && Object.hasOwnProperty.call(message, "googleSearch"))
                                $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.encode(message.googleSearch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Tool.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITool} message Tool message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Tool.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Tool message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Tool} Tool
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Tool.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Tool();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.functionDeclarations && message.functionDeclarations.length))
                                            message.functionDeclarations = [];
                                        message.functionDeclarations.push($root.google.ai.generativelanguage.v1alpha.FunctionDeclaration.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.googleSearchRetrieval = $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.codeExecution = $root.google.ai.generativelanguage.v1alpha.CodeExecution.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.googleSearch = $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Tool message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Tool} Tool
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Tool.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Tool message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Tool.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.functionDeclarations != null && message.hasOwnProperty("functionDeclarations")) {
                                if (!Array.isArray(message.functionDeclarations))
                                    return "functionDeclarations: array expected";
                                for (var i = 0; i < message.functionDeclarations.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration.verify(message.functionDeclarations[i]);
                                    if (error)
                                        return "functionDeclarations." + error;
                                }
                            }
                            if (message.googleSearchRetrieval != null && message.hasOwnProperty("googleSearchRetrieval")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.verify(message.googleSearchRetrieval);
                                if (error)
                                    return "googleSearchRetrieval." + error;
                            }
                            if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.CodeExecution.verify(message.codeExecution);
                                if (error)
                                    return "codeExecution." + error;
                            }
                            if (message.googleSearch != null && message.hasOwnProperty("googleSearch")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.verify(message.googleSearch);
                                if (error)
                                    return "googleSearch." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Tool message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Tool} Tool
                         */
                        Tool.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Tool)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Tool();
                            if (object.functionDeclarations) {
                                if (!Array.isArray(object.functionDeclarations))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Tool.functionDeclarations: array expected");
                                message.functionDeclarations = [];
                                for (var i = 0; i < object.functionDeclarations.length; ++i) {
                                    if (typeof object.functionDeclarations[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.Tool.functionDeclarations: object expected");
                                    message.functionDeclarations[i] = $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration.fromObject(object.functionDeclarations[i]);
                                }
                            }
                            if (object.googleSearchRetrieval != null) {
                                if (typeof object.googleSearchRetrieval !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Tool.googleSearchRetrieval: object expected");
                                message.googleSearchRetrieval = $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.fromObject(object.googleSearchRetrieval);
                            }
                            if (object.codeExecution != null) {
                                if (typeof object.codeExecution !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Tool.codeExecution: object expected");
                                message.codeExecution = $root.google.ai.generativelanguage.v1alpha.CodeExecution.fromObject(object.codeExecution);
                            }
                            if (object.googleSearch != null) {
                                if (typeof object.googleSearch !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Tool.googleSearch: object expected");
                                message.googleSearch = $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.fromObject(object.googleSearch);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Tool message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Tool} message Tool
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Tool.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.functionDeclarations = [];
                            if (options.defaults) {
                                object.googleSearchRetrieval = null;
                                object.codeExecution = null;
                                object.googleSearch = null;
                            }
                            if (message.functionDeclarations && message.functionDeclarations.length) {
                                object.functionDeclarations = [];
                                for (var j = 0; j < message.functionDeclarations.length; ++j)
                                    object.functionDeclarations[j] = $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration.toObject(message.functionDeclarations[j], options);
                            }
                            if (message.googleSearchRetrieval != null && message.hasOwnProperty("googleSearchRetrieval"))
                                object.googleSearchRetrieval = $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.toObject(message.googleSearchRetrieval, options);
                            if (message.codeExecution != null && message.hasOwnProperty("codeExecution"))
                                object.codeExecution = $root.google.ai.generativelanguage.v1alpha.CodeExecution.toObject(message.codeExecution, options);
                            if (message.googleSearch != null && message.hasOwnProperty("googleSearch"))
                                object.googleSearch = $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.toObject(message.googleSearch, options);
                            return object;
                        };
    
                        /**
                         * Converts this Tool to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Tool.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Tool
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Tool
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Tool.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Tool";
                        };
    
                        Tool.GoogleSearch = (function() {
    
                            /**
                             * Properties of a GoogleSearch.
                             * @memberof google.ai.generativelanguage.v1alpha.Tool
                             * @interface IGoogleSearch
                             */
    
                            /**
                             * Constructs a new GoogleSearch.
                             * @memberof google.ai.generativelanguage.v1alpha.Tool
                             * @classdesc Represents a GoogleSearch.
                             * @implements IGoogleSearch
                             * @constructor
                             * @param {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch=} [properties] Properties to set
                             */
                            function GoogleSearch(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * Creates a new GoogleSearch instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1alpha.Tool.GoogleSearch} GoogleSearch instance
                             */
                            GoogleSearch.create = function create(properties) {
                                return new GoogleSearch(properties);
                            };
    
                            /**
                             * Encodes the specified GoogleSearch message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch} message GoogleSearch message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            GoogleSearch.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                return writer;
                            };
    
                            /**
                             * Encodes the specified GoogleSearch message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch} message GoogleSearch message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            GoogleSearch.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a GoogleSearch message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1alpha.Tool.GoogleSearch} GoogleSearch
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            GoogleSearch.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a GoogleSearch message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1alpha.Tool.GoogleSearch} GoogleSearch
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            GoogleSearch.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a GoogleSearch message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            GoogleSearch.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                return null;
                            };
    
                            /**
                             * Creates a GoogleSearch message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1alpha.Tool.GoogleSearch} GoogleSearch
                             */
                            GoogleSearch.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch)
                                    return object;
                                return new $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch();
                            };
    
                            /**
                             * Creates a plain object from a GoogleSearch message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.Tool.GoogleSearch} message GoogleSearch
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            GoogleSearch.toObject = function toObject() {
                                return {};
                            };
    
                            /**
                             * Converts this GoogleSearch to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            GoogleSearch.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for GoogleSearch
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            GoogleSearch.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Tool.GoogleSearch";
                            };
    
                            return GoogleSearch;
                        })();
    
                        return Tool;
                    })();
    
                    v1alpha.GoogleSearchRetrieval = (function() {
    
                        /**
                         * Properties of a GoogleSearchRetrieval.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGoogleSearchRetrieval
                         * @property {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig|null} [dynamicRetrievalConfig] GoogleSearchRetrieval dynamicRetrievalConfig
                         */
    
                        /**
                         * Constructs a new GoogleSearchRetrieval.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GoogleSearchRetrieval.
                         * @implements IGoogleSearchRetrieval
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval=} [properties] Properties to set
                         */
                        function GoogleSearchRetrieval(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GoogleSearchRetrieval dynamicRetrievalConfig.
                         * @member {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig|null|undefined} dynamicRetrievalConfig
                         * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval
                         * @instance
                         */
                        GoogleSearchRetrieval.prototype.dynamicRetrievalConfig = null;
    
                        /**
                         * Creates a new GoogleSearchRetrieval instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval} GoogleSearchRetrieval instance
                         */
                        GoogleSearchRetrieval.create = function create(properties) {
                            return new GoogleSearchRetrieval(properties);
                        };
    
                        /**
                         * Encodes the specified GoogleSearchRetrieval message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval} message GoogleSearchRetrieval message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GoogleSearchRetrieval.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.dynamicRetrievalConfig != null && Object.hasOwnProperty.call(message, "dynamicRetrievalConfig"))
                                $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.encode(message.dynamicRetrievalConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GoogleSearchRetrieval message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval} message GoogleSearchRetrieval message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GoogleSearchRetrieval.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GoogleSearchRetrieval message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval} GoogleSearchRetrieval
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GoogleSearchRetrieval.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GoogleSearchRetrieval message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval} GoogleSearchRetrieval
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GoogleSearchRetrieval.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GoogleSearchRetrieval message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GoogleSearchRetrieval.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.dynamicRetrievalConfig != null && message.hasOwnProperty("dynamicRetrievalConfig")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.verify(message.dynamicRetrievalConfig);
                                if (error)
                                    return "dynamicRetrievalConfig." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GoogleSearchRetrieval message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval} GoogleSearchRetrieval
                         */
                        GoogleSearchRetrieval.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval();
                            if (object.dynamicRetrievalConfig != null) {
                                if (typeof object.dynamicRetrievalConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.dynamicRetrievalConfig: object expected");
                                message.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.fromObject(object.dynamicRetrievalConfig);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GoogleSearchRetrieval message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval} message GoogleSearchRetrieval
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GoogleSearchRetrieval.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.dynamicRetrievalConfig = null;
                            if (message.dynamicRetrievalConfig != null && message.hasOwnProperty("dynamicRetrievalConfig"))
                                object.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.toObject(message.dynamicRetrievalConfig, options);
                            return object;
                        };
    
                        /**
                         * Converts this GoogleSearchRetrieval to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GoogleSearchRetrieval.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GoogleSearchRetrieval
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GoogleSearchRetrieval.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval";
                        };
    
                        return GoogleSearchRetrieval;
                    })();
    
                    v1alpha.DynamicRetrievalConfig = (function() {
    
                        /**
                         * Properties of a DynamicRetrievalConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IDynamicRetrievalConfig
                         * @property {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode|null} [mode] DynamicRetrievalConfig mode
                         * @property {number|null} [dynamicThreshold] DynamicRetrievalConfig dynamicThreshold
                         */
    
                        /**
                         * Constructs a new DynamicRetrievalConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a DynamicRetrievalConfig.
                         * @implements IDynamicRetrievalConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig=} [properties] Properties to set
                         */
                        function DynamicRetrievalConfig(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DynamicRetrievalConfig mode.
                         * @member {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode} mode
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @instance
                         */
                        DynamicRetrievalConfig.prototype.mode = 0;
    
                        /**
                         * DynamicRetrievalConfig dynamicThreshold.
                         * @member {number|null|undefined} dynamicThreshold
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @instance
                         */
                        DynamicRetrievalConfig.prototype.dynamicThreshold = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * DynamicRetrievalConfig _dynamicThreshold.
                         * @member {"dynamicThreshold"|undefined} _dynamicThreshold
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @instance
                         */
                        Object.defineProperty(DynamicRetrievalConfig.prototype, "_dynamicThreshold", {
                            get: $util.oneOfGetter($oneOfFields = ["dynamicThreshold"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new DynamicRetrievalConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig} DynamicRetrievalConfig instance
                         */
                        DynamicRetrievalConfig.create = function create(properties) {
                            return new DynamicRetrievalConfig(properties);
                        };
    
                        /**
                         * Encodes the specified DynamicRetrievalConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig} message DynamicRetrievalConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DynamicRetrievalConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.mode != null && Object.hasOwnProperty.call(message, "mode"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode);
                            if (message.dynamicThreshold != null && Object.hasOwnProperty.call(message, "dynamicThreshold"))
                                writer.uint32(/* id 2, wireType 5 =*/21).float(message.dynamicThreshold);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DynamicRetrievalConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig} message DynamicRetrievalConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DynamicRetrievalConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DynamicRetrievalConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig} DynamicRetrievalConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DynamicRetrievalConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.mode = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.dynamicThreshold = reader.float();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DynamicRetrievalConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig} DynamicRetrievalConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DynamicRetrievalConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DynamicRetrievalConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DynamicRetrievalConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.mode != null && message.hasOwnProperty("mode"))
                                switch (message.mode) {
                                default:
                                    return "mode: enum value expected";
                                case 0:
                                case 1:
                                    break;
                                }
                            if (message.dynamicThreshold != null && message.hasOwnProperty("dynamicThreshold")) {
                                properties._dynamicThreshold = 1;
                                if (typeof message.dynamicThreshold !== "number")
                                    return "dynamicThreshold: number expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a DynamicRetrievalConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig} DynamicRetrievalConfig
                         */
                        DynamicRetrievalConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig();
                            switch (object.mode) {
                            default:
                                if (typeof object.mode === "number") {
                                    message.mode = object.mode;
                                    break;
                                }
                                break;
                            case "MODE_UNSPECIFIED":
                            case 0:
                                message.mode = 0;
                                break;
                            case "MODE_DYNAMIC":
                            case 1:
                                message.mode = 1;
                                break;
                            }
                            if (object.dynamicThreshold != null)
                                message.dynamicThreshold = Number(object.dynamicThreshold);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DynamicRetrievalConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig} message DynamicRetrievalConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DynamicRetrievalConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0;
                            if (message.mode != null && message.hasOwnProperty("mode"))
                                object.mode = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode[message.mode] === undefined ? message.mode : $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode[message.mode] : message.mode;
                            if (message.dynamicThreshold != null && message.hasOwnProperty("dynamicThreshold")) {
                                object.dynamicThreshold = options.json && !isFinite(message.dynamicThreshold) ? String(message.dynamicThreshold) : message.dynamicThreshold;
                                if (options.oneofs)
                                    object._dynamicThreshold = "dynamicThreshold";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this DynamicRetrievalConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DynamicRetrievalConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DynamicRetrievalConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DynamicRetrievalConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig";
                        };
    
                        /**
                         * Mode enum.
                         * @name google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode
                         * @enum {number}
                         * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value
                         * @property {number} MODE_DYNAMIC=1 MODE_DYNAMIC value
                         */
                        DynamicRetrievalConfig.Mode = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "MODE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "MODE_DYNAMIC"] = 1;
                            return values;
                        })();
    
                        return DynamicRetrievalConfig;
                    })();
    
                    v1alpha.CodeExecution = (function() {
    
                        /**
                         * Properties of a CodeExecution.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICodeExecution
                         */
    
                        /**
                         * Constructs a new CodeExecution.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CodeExecution.
                         * @implements ICodeExecution
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICodeExecution=} [properties] Properties to set
                         */
                        function CodeExecution(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Creates a new CodeExecution instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecution
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICodeExecution=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CodeExecution} CodeExecution instance
                         */
                        CodeExecution.create = function create(properties) {
                            return new CodeExecution(properties);
                        };
    
                        /**
                         * Encodes the specified CodeExecution message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CodeExecution.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecution
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICodeExecution} message CodeExecution message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CodeExecution.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CodeExecution message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CodeExecution.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecution
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICodeExecution} message CodeExecution message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CodeExecution.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CodeExecution message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecution
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CodeExecution} CodeExecution
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CodeExecution.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CodeExecution();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CodeExecution message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecution
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CodeExecution} CodeExecution
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CodeExecution.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CodeExecution message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecution
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CodeExecution.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            return null;
                        };
    
                        /**
                         * Creates a CodeExecution message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecution
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CodeExecution} CodeExecution
                         */
                        CodeExecution.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CodeExecution)
                                return object;
                            return new $root.google.ai.generativelanguage.v1alpha.CodeExecution();
                        };
    
                        /**
                         * Creates a plain object from a CodeExecution message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecution
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CodeExecution} message CodeExecution
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CodeExecution.toObject = function toObject() {
                            return {};
                        };
    
                        /**
                         * Converts this CodeExecution to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecution
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CodeExecution.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CodeExecution
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CodeExecution
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CodeExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CodeExecution";
                        };
    
                        return CodeExecution;
                    })();
    
                    v1alpha.ToolConfig = (function() {
    
                        /**
                         * Properties of a ToolConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IToolConfig
                         * @property {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig|null} [functionCallingConfig] ToolConfig functionCallingConfig
                         */
    
                        /**
                         * Constructs a new ToolConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ToolConfig.
                         * @implements IToolConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IToolConfig=} [properties] Properties to set
                         */
                        function ToolConfig(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ToolConfig functionCallingConfig.
                         * @member {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig|null|undefined} functionCallingConfig
                         * @memberof google.ai.generativelanguage.v1alpha.ToolConfig
                         * @instance
                         */
                        ToolConfig.prototype.functionCallingConfig = null;
    
                        /**
                         * Creates a new ToolConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ToolConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IToolConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ToolConfig} ToolConfig instance
                         */
                        ToolConfig.create = function create(properties) {
                            return new ToolConfig(properties);
                        };
    
                        /**
                         * Encodes the specified ToolConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ToolConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ToolConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IToolConfig} message ToolConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ToolConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.functionCallingConfig != null && Object.hasOwnProperty.call(message, "functionCallingConfig"))
                                $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.encode(message.functionCallingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ToolConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ToolConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ToolConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IToolConfig} message ToolConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ToolConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ToolConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ToolConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ToolConfig} ToolConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ToolConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ToolConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.functionCallingConfig = $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ToolConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ToolConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ToolConfig} ToolConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ToolConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ToolConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ToolConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ToolConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.functionCallingConfig != null && message.hasOwnProperty("functionCallingConfig")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.verify(message.functionCallingConfig);
                                if (error)
                                    return "functionCallingConfig." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a ToolConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ToolConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ToolConfig} ToolConfig
                         */
                        ToolConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ToolConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ToolConfig();
                            if (object.functionCallingConfig != null) {
                                if (typeof object.functionCallingConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.ToolConfig.functionCallingConfig: object expected");
                                message.functionCallingConfig = $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.fromObject(object.functionCallingConfig);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ToolConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ToolConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ToolConfig} message ToolConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ToolConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.functionCallingConfig = null;
                            if (message.functionCallingConfig != null && message.hasOwnProperty("functionCallingConfig"))
                                object.functionCallingConfig = $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.toObject(message.functionCallingConfig, options);
                            return object;
                        };
    
                        /**
                         * Converts this ToolConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ToolConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ToolConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ToolConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ToolConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ToolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ToolConfig";
                        };
    
                        return ToolConfig;
                    })();
    
                    v1alpha.FunctionCallingConfig = (function() {
    
                        /**
                         * Properties of a FunctionCallingConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IFunctionCallingConfig
                         * @property {google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode|null} [mode] FunctionCallingConfig mode
                         * @property {Array.<string>|null} [allowedFunctionNames] FunctionCallingConfig allowedFunctionNames
                         */
    
                        /**
                         * Constructs a new FunctionCallingConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a FunctionCallingConfig.
                         * @implements IFunctionCallingConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig=} [properties] Properties to set
                         */
                        function FunctionCallingConfig(properties) {
                            this.allowedFunctionNames = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * FunctionCallingConfig mode.
                         * @member {google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode} mode
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @instance
                         */
                        FunctionCallingConfig.prototype.mode = 0;
    
                        /**
                         * FunctionCallingConfig allowedFunctionNames.
                         * @member {Array.<string>} allowedFunctionNames
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @instance
                         */
                        FunctionCallingConfig.prototype.allowedFunctionNames = $util.emptyArray;
    
                        /**
                         * Creates a new FunctionCallingConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionCallingConfig} FunctionCallingConfig instance
                         */
                        FunctionCallingConfig.create = function create(properties) {
                            return new FunctionCallingConfig(properties);
                        };
    
                        /**
                         * Encodes the specified FunctionCallingConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCallingConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig} message FunctionCallingConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionCallingConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.mode != null && Object.hasOwnProperty.call(message, "mode"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode);
                            if (message.allowedFunctionNames != null && message.allowedFunctionNames.length)
                                for (var i = 0; i < message.allowedFunctionNames.length; ++i)
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedFunctionNames[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified FunctionCallingConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCallingConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig} message FunctionCallingConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionCallingConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a FunctionCallingConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionCallingConfig} FunctionCallingConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionCallingConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.mode = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.allowedFunctionNames && message.allowedFunctionNames.length))
                                            message.allowedFunctionNames = [];
                                        message.allowedFunctionNames.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a FunctionCallingConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionCallingConfig} FunctionCallingConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionCallingConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a FunctionCallingConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        FunctionCallingConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.mode != null && message.hasOwnProperty("mode"))
                                switch (message.mode) {
                                default:
                                    return "mode: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            if (message.allowedFunctionNames != null && message.hasOwnProperty("allowedFunctionNames")) {
                                if (!Array.isArray(message.allowedFunctionNames))
                                    return "allowedFunctionNames: array expected";
                                for (var i = 0; i < message.allowedFunctionNames.length; ++i)
                                    if (!$util.isString(message.allowedFunctionNames[i]))
                                        return "allowedFunctionNames: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a FunctionCallingConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionCallingConfig} FunctionCallingConfig
                         */
                        FunctionCallingConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig();
                            switch (object.mode) {
                            default:
                                if (typeof object.mode === "number") {
                                    message.mode = object.mode;
                                    break;
                                }
                                break;
                            case "MODE_UNSPECIFIED":
                            case 0:
                                message.mode = 0;
                                break;
                            case "AUTO":
                            case 1:
                                message.mode = 1;
                                break;
                            case "ANY":
                            case 2:
                                message.mode = 2;
                                break;
                            case "NONE":
                            case 3:
                                message.mode = 3;
                                break;
                            }
                            if (object.allowedFunctionNames) {
                                if (!Array.isArray(object.allowedFunctionNames))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.FunctionCallingConfig.allowedFunctionNames: array expected");
                                message.allowedFunctionNames = [];
                                for (var i = 0; i < object.allowedFunctionNames.length; ++i)
                                    message.allowedFunctionNames[i] = String(object.allowedFunctionNames[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a FunctionCallingConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.FunctionCallingConfig} message FunctionCallingConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        FunctionCallingConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.allowedFunctionNames = [];
                            if (options.defaults)
                                object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0;
                            if (message.mode != null && message.hasOwnProperty("mode"))
                                object.mode = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode[message.mode] === undefined ? message.mode : $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode[message.mode] : message.mode;
                            if (message.allowedFunctionNames && message.allowedFunctionNames.length) {
                                object.allowedFunctionNames = [];
                                for (var j = 0; j < message.allowedFunctionNames.length; ++j)
                                    object.allowedFunctionNames[j] = message.allowedFunctionNames[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this FunctionCallingConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        FunctionCallingConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for FunctionCallingConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        FunctionCallingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.FunctionCallingConfig";
                        };
    
                        /**
                         * Mode enum.
                         * @name google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode
                         * @enum {number}
                         * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value
                         * @property {number} AUTO=1 AUTO value
                         * @property {number} ANY=2 ANY value
                         * @property {number} NONE=3 NONE value
                         */
                        FunctionCallingConfig.Mode = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "MODE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "AUTO"] = 1;
                            values[valuesById[2] = "ANY"] = 2;
                            values[valuesById[3] = "NONE"] = 3;
                            return values;
                        })();
    
                        return FunctionCallingConfig;
                    })();
    
                    v1alpha.FunctionDeclaration = (function() {
    
                        /**
                         * Properties of a FunctionDeclaration.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IFunctionDeclaration
                         * @property {string|null} [name] FunctionDeclaration name
                         * @property {string|null} [description] FunctionDeclaration description
                         * @property {google.ai.generativelanguage.v1alpha.ISchema|null} [parameters] FunctionDeclaration parameters
                         * @property {google.ai.generativelanguage.v1alpha.ISchema|null} [response] FunctionDeclaration response
                         */
    
                        /**
                         * Constructs a new FunctionDeclaration.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a FunctionDeclaration.
                         * @implements IFunctionDeclaration
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionDeclaration=} [properties] Properties to set
                         */
                        function FunctionDeclaration(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * FunctionDeclaration name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @instance
                         */
                        FunctionDeclaration.prototype.name = "";
    
                        /**
                         * FunctionDeclaration description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @instance
                         */
                        FunctionDeclaration.prototype.description = "";
    
                        /**
                         * FunctionDeclaration parameters.
                         * @member {google.ai.generativelanguage.v1alpha.ISchema|null|undefined} parameters
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @instance
                         */
                        FunctionDeclaration.prototype.parameters = null;
    
                        /**
                         * FunctionDeclaration response.
                         * @member {google.ai.generativelanguage.v1alpha.ISchema|null|undefined} response
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @instance
                         */
                        FunctionDeclaration.prototype.response = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * FunctionDeclaration _parameters.
                         * @member {"parameters"|undefined} _parameters
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @instance
                         */
                        Object.defineProperty(FunctionDeclaration.prototype, "_parameters", {
                            get: $util.oneOfGetter($oneOfFields = ["parameters"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * FunctionDeclaration _response.
                         * @member {"response"|undefined} _response
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @instance
                         */
                        Object.defineProperty(FunctionDeclaration.prototype, "_response", {
                            get: $util.oneOfGetter($oneOfFields = ["response"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new FunctionDeclaration instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionDeclaration=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionDeclaration} FunctionDeclaration instance
                         */
                        FunctionDeclaration.create = function create(properties) {
                            return new FunctionDeclaration(properties);
                        };
    
                        /**
                         * Encodes the specified FunctionDeclaration message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionDeclaration.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionDeclaration} message FunctionDeclaration message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionDeclaration.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
                            if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters"))
                                $root.google.ai.generativelanguage.v1alpha.Schema.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.response != null && Object.hasOwnProperty.call(message, "response"))
                                $root.google.ai.generativelanguage.v1alpha.Schema.encode(message.response, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified FunctionDeclaration message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionDeclaration.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionDeclaration} message FunctionDeclaration message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionDeclaration.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a FunctionDeclaration message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionDeclaration} FunctionDeclaration
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionDeclaration.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.parameters = $root.google.ai.generativelanguage.v1alpha.Schema.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.response = $root.google.ai.generativelanguage.v1alpha.Schema.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a FunctionDeclaration message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionDeclaration} FunctionDeclaration
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionDeclaration.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a FunctionDeclaration message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        FunctionDeclaration.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.parameters != null && message.hasOwnProperty("parameters")) {
                                properties._parameters = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Schema.verify(message.parameters);
                                    if (error)
                                        return "parameters." + error;
                                }
                            }
                            if (message.response != null && message.hasOwnProperty("response")) {
                                properties._response = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Schema.verify(message.response);
                                    if (error)
                                        return "response." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a FunctionDeclaration message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionDeclaration} FunctionDeclaration
                         */
                        FunctionDeclaration.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.parameters != null) {
                                if (typeof object.parameters !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.FunctionDeclaration.parameters: object expected");
                                message.parameters = $root.google.ai.generativelanguage.v1alpha.Schema.fromObject(object.parameters);
                            }
                            if (object.response != null) {
                                if (typeof object.response !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.FunctionDeclaration.response: object expected");
                                message.response = $root.google.ai.generativelanguage.v1alpha.Schema.fromObject(object.response);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a FunctionDeclaration message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.FunctionDeclaration} message FunctionDeclaration
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        FunctionDeclaration.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.description = "";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.parameters != null && message.hasOwnProperty("parameters")) {
                                object.parameters = $root.google.ai.generativelanguage.v1alpha.Schema.toObject(message.parameters, options);
                                if (options.oneofs)
                                    object._parameters = "parameters";
                            }
                            if (message.response != null && message.hasOwnProperty("response")) {
                                object.response = $root.google.ai.generativelanguage.v1alpha.Schema.toObject(message.response, options);
                                if (options.oneofs)
                                    object._response = "response";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this FunctionDeclaration to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        FunctionDeclaration.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for FunctionDeclaration
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        FunctionDeclaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.FunctionDeclaration";
                        };
    
                        return FunctionDeclaration;
                    })();
    
                    v1alpha.FunctionCall = (function() {
    
                        /**
                         * Properties of a FunctionCall.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IFunctionCall
                         * @property {string|null} [id] FunctionCall id
                         * @property {string|null} [name] FunctionCall name
                         * @property {google.protobuf.IStruct|null} [args] FunctionCall args
                         */
    
                        /**
                         * Constructs a new FunctionCall.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a FunctionCall.
                         * @implements IFunctionCall
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionCall=} [properties] Properties to set
                         */
                        function FunctionCall(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * FunctionCall id.
                         * @member {string} id
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @instance
                         */
                        FunctionCall.prototype.id = "";
    
                        /**
                         * FunctionCall name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @instance
                         */
                        FunctionCall.prototype.name = "";
    
                        /**
                         * FunctionCall args.
                         * @member {google.protobuf.IStruct|null|undefined} args
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @instance
                         */
                        FunctionCall.prototype.args = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * FunctionCall _args.
                         * @member {"args"|undefined} _args
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @instance
                         */
                        Object.defineProperty(FunctionCall.prototype, "_args", {
                            get: $util.oneOfGetter($oneOfFields = ["args"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new FunctionCall instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionCall=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionCall} FunctionCall instance
                         */
                        FunctionCall.create = function create(properties) {
                            return new FunctionCall(properties);
                        };
    
                        /**
                         * Encodes the specified FunctionCall message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCall.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionCall} message FunctionCall message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionCall.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.args != null && Object.hasOwnProperty.call(message, "args"))
                                $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.id);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified FunctionCall message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCall.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionCall} message FunctionCall message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionCall.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a FunctionCall message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionCall} FunctionCall
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionCall.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.FunctionCall();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.id = reader.string();
                                        break;
                                    }
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a FunctionCall message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionCall} FunctionCall
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionCall.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a FunctionCall message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        FunctionCall.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.id != null && message.hasOwnProperty("id"))
                                if (!$util.isString(message.id))
                                    return "id: string expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.args != null && message.hasOwnProperty("args")) {
                                properties._args = 1;
                                {
                                    var error = $root.google.protobuf.Struct.verify(message.args);
                                    if (error)
                                        return "args." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a FunctionCall message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionCall} FunctionCall
                         */
                        FunctionCall.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.FunctionCall)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.FunctionCall();
                            if (object.id != null)
                                message.id = String(object.id);
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.args != null) {
                                if (typeof object.args !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.FunctionCall.args: object expected");
                                message.args = $root.google.protobuf.Struct.fromObject(object.args);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a FunctionCall message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.FunctionCall} message FunctionCall
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        FunctionCall.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.id = "";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.args != null && message.hasOwnProperty("args")) {
                                object.args = $root.google.protobuf.Struct.toObject(message.args, options);
                                if (options.oneofs)
                                    object._args = "args";
                            }
                            if (message.id != null && message.hasOwnProperty("id"))
                                object.id = message.id;
                            return object;
                        };
    
                        /**
                         * Converts this FunctionCall to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        FunctionCall.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for FunctionCall
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionCall
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        FunctionCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.FunctionCall";
                        };
    
                        return FunctionCall;
                    })();
    
                    v1alpha.FunctionResponse = (function() {
    
                        /**
                         * Properties of a FunctionResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IFunctionResponse
                         * @property {string|null} [id] FunctionResponse id
                         * @property {string|null} [name] FunctionResponse name
                         * @property {google.protobuf.IStruct|null} [response] FunctionResponse response
                         */
    
                        /**
                         * Constructs a new FunctionResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a FunctionResponse.
                         * @implements IFunctionResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionResponse=} [properties] Properties to set
                         */
                        function FunctionResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * FunctionResponse id.
                         * @member {string} id
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @instance
                         */
                        FunctionResponse.prototype.id = "";
    
                        /**
                         * FunctionResponse name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @instance
                         */
                        FunctionResponse.prototype.name = "";
    
                        /**
                         * FunctionResponse response.
                         * @member {google.protobuf.IStruct|null|undefined} response
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @instance
                         */
                        FunctionResponse.prototype.response = null;
    
                        /**
                         * Creates a new FunctionResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionResponse} FunctionResponse instance
                         */
                        FunctionResponse.create = function create(properties) {
                            return new FunctionResponse(properties);
                        };
    
                        /**
                         * Encodes the specified FunctionResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionResponse} message FunctionResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.response != null && Object.hasOwnProperty.call(message, "response"))
                                $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.id);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified FunctionResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFunctionResponse} message FunctionResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a FunctionResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionResponse} FunctionResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.FunctionResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.id = reader.string();
                                        break;
                                    }
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a FunctionResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionResponse} FunctionResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a FunctionResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        FunctionResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.id != null && message.hasOwnProperty("id"))
                                if (!$util.isString(message.id))
                                    return "id: string expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.response != null && message.hasOwnProperty("response")) {
                                var error = $root.google.protobuf.Struct.verify(message.response);
                                if (error)
                                    return "response." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a FunctionResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.FunctionResponse} FunctionResponse
                         */
                        FunctionResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.FunctionResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.FunctionResponse();
                            if (object.id != null)
                                message.id = String(object.id);
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.response != null) {
                                if (typeof object.response !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.FunctionResponse.response: object expected");
                                message.response = $root.google.protobuf.Struct.fromObject(object.response);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a FunctionResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.FunctionResponse} message FunctionResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        FunctionResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.response = null;
                                object.id = "";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.response != null && message.hasOwnProperty("response"))
                                object.response = $root.google.protobuf.Struct.toObject(message.response, options);
                            if (message.id != null && message.hasOwnProperty("id"))
                                object.id = message.id;
                            return object;
                        };
    
                        /**
                         * Converts this FunctionResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        FunctionResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for FunctionResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        FunctionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.FunctionResponse";
                        };
    
                        return FunctionResponse;
                    })();
    
                    v1alpha.Schema = (function() {
    
                        /**
                         * Properties of a Schema.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ISchema
                         * @property {google.ai.generativelanguage.v1alpha.Type|null} [type] Schema type
                         * @property {string|null} [format] Schema format
                         * @property {string|null} [description] Schema description
                         * @property {boolean|null} [nullable] Schema nullable
                         * @property {Array.<string>|null} ["enum"] Schema enum
                         * @property {google.ai.generativelanguage.v1alpha.ISchema|null} [items] Schema items
                         * @property {number|Long|null} [maxItems] Schema maxItems
                         * @property {number|Long|null} [minItems] Schema minItems
                         * @property {Object.<string,google.ai.generativelanguage.v1alpha.ISchema>|null} [properties] Schema properties
                         * @property {Array.<string>|null} [required] Schema required
                         */
    
                        /**
                         * Constructs a new Schema.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Schema.
                         * @implements ISchema
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ISchema=} [properties] Properties to set
                         */
                        function Schema(properties) {
                            this["enum"] = [];
                            this.properties = {};
                            this.required = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Schema type.
                         * @member {google.ai.generativelanguage.v1alpha.Type} type
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         */
                        Schema.prototype.type = 0;
    
                        /**
                         * Schema format.
                         * @member {string} format
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         */
                        Schema.prototype.format = "";
    
                        /**
                         * Schema description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         */
                        Schema.prototype.description = "";
    
                        /**
                         * Schema nullable.
                         * @member {boolean} nullable
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         */
                        Schema.prototype.nullable = false;
    
                        /**
                         * Schema enum.
                         * @member {Array.<string>} enum
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         */
                        Schema.prototype["enum"] = $util.emptyArray;
    
                        /**
                         * Schema items.
                         * @member {google.ai.generativelanguage.v1alpha.ISchema|null|undefined} items
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         */
                        Schema.prototype.items = null;
    
                        /**
                         * Schema maxItems.
                         * @member {number|Long} maxItems
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         */
                        Schema.prototype.maxItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
    
                        /**
                         * Schema minItems.
                         * @member {number|Long} minItems
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         */
                        Schema.prototype.minItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
    
                        /**
                         * Schema properties.
                         * @member {Object.<string,google.ai.generativelanguage.v1alpha.ISchema>} properties
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         */
                        Schema.prototype.properties = $util.emptyObject;
    
                        /**
                         * Schema required.
                         * @member {Array.<string>} required
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         */
                        Schema.prototype.required = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Schema _items.
                         * @member {"items"|undefined} _items
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         */
                        Object.defineProperty(Schema.prototype, "_items", {
                            get: $util.oneOfGetter($oneOfFields = ["items"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Schema instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISchema=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Schema} Schema instance
                         */
                        Schema.create = function create(properties) {
                            return new Schema(properties);
                        };
    
                        /**
                         * Encodes the specified Schema message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Schema.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISchema} message Schema message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Schema.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);
                            if (message.format != null && Object.hasOwnProperty.call(message, "format"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.format);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.description);
                            if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable"))
                                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.nullable);
                            if (message["enum"] != null && message["enum"].length)
                                for (var i = 0; i < message["enum"].length; ++i)
                                    writer.uint32(/* id 5, wireType 2 =*/42).string(message["enum"][i]);
                            if (message.items != null && Object.hasOwnProperty.call(message, "items"))
                                $root.google.ai.generativelanguage.v1alpha.Schema.encode(message.items, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.properties != null && Object.hasOwnProperty.call(message, "properties"))
                                for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) {
                                    writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
                                    $root.google.ai.generativelanguage.v1alpha.Schema.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                                }
                            if (message.required != null && message.required.length)
                                for (var i = 0; i < message.required.length; ++i)
                                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.required[i]);
                            if (message.maxItems != null && Object.hasOwnProperty.call(message, "maxItems"))
                                writer.uint32(/* id 21, wireType 0 =*/168).int64(message.maxItems);
                            if (message.minItems != null && Object.hasOwnProperty.call(message, "minItems"))
                                writer.uint32(/* id 22, wireType 0 =*/176).int64(message.minItems);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Schema.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISchema} message Schema message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Schema.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Schema message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Schema} Schema
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Schema.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Schema(), key, value;
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.type = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.format = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.nullable = reader.bool();
                                        break;
                                    }
                                case 5: {
                                        if (!(message["enum"] && message["enum"].length))
                                            message["enum"] = [];
                                        message["enum"].push(reader.string());
                                        break;
                                    }
                                case 6: {
                                        message.items = $root.google.ai.generativelanguage.v1alpha.Schema.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 21: {
                                        message.maxItems = reader.int64();
                                        break;
                                    }
                                case 22: {
                                        message.minItems = reader.int64();
                                        break;
                                    }
                                case 7: {
                                        if (message.properties === $util.emptyObject)
                                            message.properties = {};
                                        var end2 = reader.uint32() + reader.pos;
                                        key = "";
                                        value = null;
                                        while (reader.pos < end2) {
                                            var tag2 = reader.uint32();
                                            switch (tag2 >>> 3) {
                                            case 1:
                                                key = reader.string();
                                                break;
                                            case 2:
                                                value = $root.google.ai.generativelanguage.v1alpha.Schema.decode(reader, reader.uint32());
                                                break;
                                            default:
                                                reader.skipType(tag2 & 7);
                                                break;
                                            }
                                        }
                                        message.properties[key] = value;
                                        break;
                                    }
                                case 8: {
                                        if (!(message.required && message.required.length))
                                            message.required = [];
                                        message.required.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Schema message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Schema} Schema
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Schema.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Schema message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Schema.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.type != null && message.hasOwnProperty("type"))
                                switch (message.type) {
                                default:
                                    return "type: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                    break;
                                }
                            if (message.format != null && message.hasOwnProperty("format"))
                                if (!$util.isString(message.format))
                                    return "format: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.nullable != null && message.hasOwnProperty("nullable"))
                                if (typeof message.nullable !== "boolean")
                                    return "nullable: boolean expected";
                            if (message["enum"] != null && message.hasOwnProperty("enum")) {
                                if (!Array.isArray(message["enum"]))
                                    return "enum: array expected";
                                for (var i = 0; i < message["enum"].length; ++i)
                                    if (!$util.isString(message["enum"][i]))
                                        return "enum: string[] expected";
                            }
                            if (message.items != null && message.hasOwnProperty("items")) {
                                properties._items = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Schema.verify(message.items);
                                    if (error)
                                        return "items." + error;
                                }
                            }
                            if (message.maxItems != null && message.hasOwnProperty("maxItems"))
                                if (!$util.isInteger(message.maxItems) && !(message.maxItems && $util.isInteger(message.maxItems.low) && $util.isInteger(message.maxItems.high)))
                                    return "maxItems: integer|Long expected";
                            if (message.minItems != null && message.hasOwnProperty("minItems"))
                                if (!$util.isInteger(message.minItems) && !(message.minItems && $util.isInteger(message.minItems.low) && $util.isInteger(message.minItems.high)))
                                    return "minItems: integer|Long expected";
                            if (message.properties != null && message.hasOwnProperty("properties")) {
                                if (!$util.isObject(message.properties))
                                    return "properties: object expected";
                                var key = Object.keys(message.properties);
                                for (var i = 0; i < key.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Schema.verify(message.properties[key[i]]);
                                    if (error)
                                        return "properties." + error;
                                }
                            }
                            if (message.required != null && message.hasOwnProperty("required")) {
                                if (!Array.isArray(message.required))
                                    return "required: array expected";
                                for (var i = 0; i < message.required.length; ++i)
                                    if (!$util.isString(message.required[i]))
                                        return "required: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Schema message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Schema} Schema
                         */
                        Schema.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Schema)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Schema();
                            switch (object.type) {
                            default:
                                if (typeof object.type === "number") {
                                    message.type = object.type;
                                    break;
                                }
                                break;
                            case "TYPE_UNSPECIFIED":
                            case 0:
                                message.type = 0;
                                break;
                            case "STRING":
                            case 1:
                                message.type = 1;
                                break;
                            case "NUMBER":
                            case 2:
                                message.type = 2;
                                break;
                            case "INTEGER":
                            case 3:
                                message.type = 3;
                                break;
                            case "BOOLEAN":
                            case 4:
                                message.type = 4;
                                break;
                            case "ARRAY":
                            case 5:
                                message.type = 5;
                                break;
                            case "OBJECT":
                            case 6:
                                message.type = 6;
                                break;
                            }
                            if (object.format != null)
                                message.format = String(object.format);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.nullable != null)
                                message.nullable = Boolean(object.nullable);
                            if (object["enum"]) {
                                if (!Array.isArray(object["enum"]))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Schema.enum: array expected");
                                message["enum"] = [];
                                for (var i = 0; i < object["enum"].length; ++i)
                                    message["enum"][i] = String(object["enum"][i]);
                            }
                            if (object.items != null) {
                                if (typeof object.items !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Schema.items: object expected");
                                message.items = $root.google.ai.generativelanguage.v1alpha.Schema.fromObject(object.items);
                            }
                            if (object.maxItems != null)
                                if ($util.Long)
                                    (message.maxItems = $util.Long.fromValue(object.maxItems)).unsigned = false;
                                else if (typeof object.maxItems === "string")
                                    message.maxItems = parseInt(object.maxItems, 10);
                                else if (typeof object.maxItems === "number")
                                    message.maxItems = object.maxItems;
                                else if (typeof object.maxItems === "object")
                                    message.maxItems = new $util.LongBits(object.maxItems.low >>> 0, object.maxItems.high >>> 0).toNumber();
                            if (object.minItems != null)
                                if ($util.Long)
                                    (message.minItems = $util.Long.fromValue(object.minItems)).unsigned = false;
                                else if (typeof object.minItems === "string")
                                    message.minItems = parseInt(object.minItems, 10);
                                else if (typeof object.minItems === "number")
                                    message.minItems = object.minItems;
                                else if (typeof object.minItems === "object")
                                    message.minItems = new $util.LongBits(object.minItems.low >>> 0, object.minItems.high >>> 0).toNumber();
                            if (object.properties) {
                                if (typeof object.properties !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Schema.properties: object expected");
                                message.properties = {};
                                for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) {
                                    if (typeof object.properties[keys[i]] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.Schema.properties: object expected");
                                    message.properties[keys[i]] = $root.google.ai.generativelanguage.v1alpha.Schema.fromObject(object.properties[keys[i]]);
                                }
                            }
                            if (object.required) {
                                if (!Array.isArray(object.required))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Schema.required: array expected");
                                message.required = [];
                                for (var i = 0; i < object.required.length; ++i)
                                    message.required[i] = String(object.required[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Schema message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Schema} message Schema
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Schema.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object["enum"] = [];
                                object.required = [];
                            }
                            if (options.objects || options.defaults)
                                object.properties = {};
                            if (options.defaults) {
                                object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0;
                                object.format = "";
                                object.description = "";
                                object.nullable = false;
                                if ($util.Long) {
                                    var long = new $util.Long(0, 0, false);
                                    object.maxItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                                } else
                                    object.maxItems = options.longs === String ? "0" : 0;
                                if ($util.Long) {
                                    var long = new $util.Long(0, 0, false);
                                    object.minItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                                } else
                                    object.minItems = options.longs === String ? "0" : 0;
                            }
                            if (message.type != null && message.hasOwnProperty("type"))
                                object.type = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Type[message.type] === undefined ? message.type : $root.google.ai.generativelanguage.v1alpha.Type[message.type] : message.type;
                            if (message.format != null && message.hasOwnProperty("format"))
                                object.format = message.format;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.nullable != null && message.hasOwnProperty("nullable"))
                                object.nullable = message.nullable;
                            if (message["enum"] && message["enum"].length) {
                                object["enum"] = [];
                                for (var j = 0; j < message["enum"].length; ++j)
                                    object["enum"][j] = message["enum"][j];
                            }
                            if (message.items != null && message.hasOwnProperty("items")) {
                                object.items = $root.google.ai.generativelanguage.v1alpha.Schema.toObject(message.items, options);
                                if (options.oneofs)
                                    object._items = "items";
                            }
                            var keys2;
                            if (message.properties && (keys2 = Object.keys(message.properties)).length) {
                                object.properties = {};
                                for (var j = 0; j < keys2.length; ++j)
                                    object.properties[keys2[j]] = $root.google.ai.generativelanguage.v1alpha.Schema.toObject(message.properties[keys2[j]], options);
                            }
                            if (message.required && message.required.length) {
                                object.required = [];
                                for (var j = 0; j < message.required.length; ++j)
                                    object.required[j] = message.required[j];
                            }
                            if (message.maxItems != null && message.hasOwnProperty("maxItems"))
                                if (typeof message.maxItems === "number")
                                    object.maxItems = options.longs === String ? String(message.maxItems) : message.maxItems;
                                else
                                    object.maxItems = options.longs === String ? $util.Long.prototype.toString.call(message.maxItems) : options.longs === Number ? new $util.LongBits(message.maxItems.low >>> 0, message.maxItems.high >>> 0).toNumber() : message.maxItems;
                            if (message.minItems != null && message.hasOwnProperty("minItems"))
                                if (typeof message.minItems === "number")
                                    object.minItems = options.longs === String ? String(message.minItems) : message.minItems;
                                else
                                    object.minItems = options.longs === String ? $util.Long.prototype.toString.call(message.minItems) : options.longs === Number ? new $util.LongBits(message.minItems.low >>> 0, message.minItems.high >>> 0).toNumber() : message.minItems;
                            return object;
                        };
    
                        /**
                         * Converts this Schema to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Schema.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Schema
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Schema
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Schema";
                        };
    
                        return Schema;
                    })();
    
                    v1alpha.GroundingPassage = (function() {
    
                        /**
                         * Properties of a GroundingPassage.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGroundingPassage
                         * @property {string|null} [id] GroundingPassage id
                         * @property {google.ai.generativelanguage.v1alpha.IContent|null} [content] GroundingPassage content
                         */
    
                        /**
                         * Constructs a new GroundingPassage.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GroundingPassage.
                         * @implements IGroundingPassage
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingPassage=} [properties] Properties to set
                         */
                        function GroundingPassage(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingPassage id.
                         * @member {string} id
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @instance
                         */
                        GroundingPassage.prototype.id = "";
    
                        /**
                         * GroundingPassage content.
                         * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} content
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @instance
                         */
                        GroundingPassage.prototype.content = null;
    
                        /**
                         * Creates a new GroundingPassage instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingPassage=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingPassage} GroundingPassage instance
                         */
                        GroundingPassage.create = function create(properties) {
                            return new GroundingPassage(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingPassage message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingPassage.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingPassage} message GroundingPassage message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingPassage.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                $root.google.ai.generativelanguage.v1alpha.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingPassage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingPassage.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingPassage} message GroundingPassage message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingPassage.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingPassage message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingPassage} GroundingPassage
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingPassage.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GroundingPassage();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.id = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.content = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingPassage message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingPassage} GroundingPassage
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingPassage.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingPassage message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingPassage.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.id != null && message.hasOwnProperty("id"))
                                if (!$util.isString(message.id))
                                    return "id: string expected";
                            if (message.content != null && message.hasOwnProperty("content")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.content);
                                if (error)
                                    return "content." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingPassage message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingPassage} GroundingPassage
                         */
                        GroundingPassage.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingPassage)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GroundingPassage();
                            if (object.id != null)
                                message.id = String(object.id);
                            if (object.content != null) {
                                if (typeof object.content !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingPassage.content: object expected");
                                message.content = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.content);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingPassage message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GroundingPassage} message GroundingPassage
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingPassage.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.id = "";
                                object.content = null;
                            }
                            if (message.id != null && message.hasOwnProperty("id"))
                                object.id = message.id;
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.content, options);
                            return object;
                        };
    
                        /**
                         * Converts this GroundingPassage to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingPassage.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingPassage
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingPassage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GroundingPassage";
                        };
    
                        return GroundingPassage;
                    })();
    
                    v1alpha.GroundingPassages = (function() {
    
                        /**
                         * Properties of a GroundingPassages.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGroundingPassages
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IGroundingPassage>|null} [passages] GroundingPassages passages
                         */
    
                        /**
                         * Constructs a new GroundingPassages.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GroundingPassages.
                         * @implements IGroundingPassages
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingPassages=} [properties] Properties to set
                         */
                        function GroundingPassages(properties) {
                            this.passages = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingPassages passages.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IGroundingPassage>} passages
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages
                         * @instance
                         */
                        GroundingPassages.prototype.passages = $util.emptyArray;
    
                        /**
                         * Creates a new GroundingPassages instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingPassages=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingPassages} GroundingPassages instance
                         */
                        GroundingPassages.create = function create(properties) {
                            return new GroundingPassages(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingPassages message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingPassages.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingPassages} message GroundingPassages message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingPassages.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.passages != null && message.passages.length)
                                for (var i = 0; i < message.passages.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.GroundingPassage.encode(message.passages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingPassages message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingPassages.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingPassages} message GroundingPassages message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingPassages.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingPassages message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingPassages} GroundingPassages
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingPassages.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GroundingPassages();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.passages && message.passages.length))
                                            message.passages = [];
                                        message.passages.push($root.google.ai.generativelanguage.v1alpha.GroundingPassage.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingPassages message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingPassages} GroundingPassages
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingPassages.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingPassages message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingPassages.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.passages != null && message.hasOwnProperty("passages")) {
                                if (!Array.isArray(message.passages))
                                    return "passages: array expected";
                                for (var i = 0; i < message.passages.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.GroundingPassage.verify(message.passages[i]);
                                    if (error)
                                        return "passages." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingPassages message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingPassages} GroundingPassages
                         */
                        GroundingPassages.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingPassages)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GroundingPassages();
                            if (object.passages) {
                                if (!Array.isArray(object.passages))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingPassages.passages: array expected");
                                message.passages = [];
                                for (var i = 0; i < object.passages.length; ++i) {
                                    if (typeof object.passages[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingPassages.passages: object expected");
                                    message.passages[i] = $root.google.ai.generativelanguage.v1alpha.GroundingPassage.fromObject(object.passages[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingPassages message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GroundingPassages} message GroundingPassages
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingPassages.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.passages = [];
                            if (message.passages && message.passages.length) {
                                object.passages = [];
                                for (var j = 0; j < message.passages.length; ++j)
                                    object.passages[j] = $root.google.ai.generativelanguage.v1alpha.GroundingPassage.toObject(message.passages[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GroundingPassages to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingPassages.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingPassages
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingPassages.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GroundingPassages";
                        };
    
                        return GroundingPassages;
                    })();
    
                    v1alpha.CitationMetadata = (function() {
    
                        /**
                         * Properties of a CitationMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICitationMetadata
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ICitationSource>|null} [citationSources] CitationMetadata citationSources
                         */
    
                        /**
                         * Constructs a new CitationMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CitationMetadata.
                         * @implements ICitationMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICitationMetadata=} [properties] Properties to set
                         */
                        function CitationMetadata(properties) {
                            this.citationSources = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CitationMetadata citationSources.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ICitationSource>} citationSources
                         * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata
                         * @instance
                         */
                        CitationMetadata.prototype.citationSources = $util.emptyArray;
    
                        /**
                         * Creates a new CitationMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICitationMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CitationMetadata} CitationMetadata instance
                         */
                        CitationMetadata.create = function create(properties) {
                            return new CitationMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CitationMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICitationMetadata} message CitationMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.citationSources != null && message.citationSources.length)
                                for (var i = 0; i < message.citationSources.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.CitationSource.encode(message.citationSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CitationMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICitationMetadata} message CitationMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CitationMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CitationMetadata} CitationMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CitationMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.citationSources && message.citationSources.length))
                                            message.citationSources = [];
                                        message.citationSources.push($root.google.ai.generativelanguage.v1alpha.CitationSource.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CitationMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CitationMetadata} CitationMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CitationMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CitationMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.citationSources != null && message.hasOwnProperty("citationSources")) {
                                if (!Array.isArray(message.citationSources))
                                    return "citationSources: array expected";
                                for (var i = 0; i < message.citationSources.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.CitationSource.verify(message.citationSources[i]);
                                    if (error)
                                        return "citationSources." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CitationMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CitationMetadata} CitationMetadata
                         */
                        CitationMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CitationMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CitationMetadata();
                            if (object.citationSources) {
                                if (!Array.isArray(object.citationSources))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CitationMetadata.citationSources: array expected");
                                message.citationSources = [];
                                for (var i = 0; i < object.citationSources.length; ++i) {
                                    if (typeof object.citationSources[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.CitationMetadata.citationSources: object expected");
                                    message.citationSources[i] = $root.google.ai.generativelanguage.v1alpha.CitationSource.fromObject(object.citationSources[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CitationMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CitationMetadata} message CitationMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CitationMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.citationSources = [];
                            if (message.citationSources && message.citationSources.length) {
                                object.citationSources = [];
                                for (var j = 0; j < message.citationSources.length; ++j)
                                    object.citationSources[j] = $root.google.ai.generativelanguage.v1alpha.CitationSource.toObject(message.citationSources[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CitationMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CitationMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CitationMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CitationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CitationMetadata";
                        };
    
                        return CitationMetadata;
                    })();
    
                    v1alpha.CitationSource = (function() {
    
                        /**
                         * Properties of a CitationSource.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICitationSource
                         * @property {number|null} [startIndex] CitationSource startIndex
                         * @property {number|null} [endIndex] CitationSource endIndex
                         * @property {string|null} [uri] CitationSource uri
                         * @property {string|null} [license] CitationSource license
                         */
    
                        /**
                         * Constructs a new CitationSource.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CitationSource.
                         * @implements ICitationSource
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICitationSource=} [properties] Properties to set
                         */
                        function CitationSource(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CitationSource startIndex.
                         * @member {number|null|undefined} startIndex
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.startIndex = null;
    
                        /**
                         * CitationSource endIndex.
                         * @member {number|null|undefined} endIndex
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.endIndex = null;
    
                        /**
                         * CitationSource uri.
                         * @member {string|null|undefined} uri
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.uri = null;
    
                        /**
                         * CitationSource license.
                         * @member {string|null|undefined} license
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.license = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CitationSource _startIndex.
                         * @member {"startIndex"|undefined} _startIndex
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_startIndex", {
                            get: $util.oneOfGetter($oneOfFields = ["startIndex"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _endIndex.
                         * @member {"endIndex"|undefined} _endIndex
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_endIndex", {
                            get: $util.oneOfGetter($oneOfFields = ["endIndex"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _uri.
                         * @member {"uri"|undefined} _uri
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_uri", {
                            get: $util.oneOfGetter($oneOfFields = ["uri"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _license.
                         * @member {"license"|undefined} _license
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_license", {
                            get: $util.oneOfGetter($oneOfFields = ["license"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CitationSource instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICitationSource=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CitationSource} CitationSource instance
                         */
                        CitationSource.create = function create(properties) {
                            return new CitationSource(properties);
                        };
    
                        /**
                         * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CitationSource.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICitationSource} message CitationSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationSource.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startIndex);
                            if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endIndex);
                            if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri);
                            if (message.license != null && Object.hasOwnProperty.call(message, "license"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.license);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CitationSource.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICitationSource} message CitationSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationSource.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CitationSource message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CitationSource} CitationSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationSource.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CitationSource();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.startIndex = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.endIndex = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.uri = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.license = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CitationSource message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CitationSource} CitationSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationSource.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CitationSource message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CitationSource.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.startIndex != null && message.hasOwnProperty("startIndex")) {
                                properties._startIndex = 1;
                                if (!$util.isInteger(message.startIndex))
                                    return "startIndex: integer expected";
                            }
                            if (message.endIndex != null && message.hasOwnProperty("endIndex")) {
                                properties._endIndex = 1;
                                if (!$util.isInteger(message.endIndex))
                                    return "endIndex: integer expected";
                            }
                            if (message.uri != null && message.hasOwnProperty("uri")) {
                                properties._uri = 1;
                                if (!$util.isString(message.uri))
                                    return "uri: string expected";
                            }
                            if (message.license != null && message.hasOwnProperty("license")) {
                                properties._license = 1;
                                if (!$util.isString(message.license))
                                    return "license: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CitationSource message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CitationSource} CitationSource
                         */
                        CitationSource.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CitationSource)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CitationSource();
                            if (object.startIndex != null)
                                message.startIndex = object.startIndex | 0;
                            if (object.endIndex != null)
                                message.endIndex = object.endIndex | 0;
                            if (object.uri != null)
                                message.uri = String(object.uri);
                            if (object.license != null)
                                message.license = String(object.license);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CitationSource message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CitationSource} message CitationSource
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CitationSource.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.startIndex != null && message.hasOwnProperty("startIndex")) {
                                object.startIndex = message.startIndex;
                                if (options.oneofs)
                                    object._startIndex = "startIndex";
                            }
                            if (message.endIndex != null && message.hasOwnProperty("endIndex")) {
                                object.endIndex = message.endIndex;
                                if (options.oneofs)
                                    object._endIndex = "endIndex";
                            }
                            if (message.uri != null && message.hasOwnProperty("uri")) {
                                object.uri = message.uri;
                                if (options.oneofs)
                                    object._uri = "uri";
                            }
                            if (message.license != null && message.hasOwnProperty("license")) {
                                object.license = message.license;
                                if (options.oneofs)
                                    object._license = "license";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CitationSource to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CitationSource.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CitationSource
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CitationSource
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CitationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CitationSource";
                        };
    
                        return CitationSource;
                    })();
    
                    v1alpha.DiscussService = (function() {
    
                        /**
                         * Constructs a new DiscussService service.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a DiscussService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function DiscussService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (DiscussService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DiscussService;
    
                        /**
                         * Creates new DiscussService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.DiscussService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {DiscussService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        DiscussService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.DiscussService|generateMessage}.
                         * @memberof google.ai.generativelanguage.v1alpha.DiscussService
                         * @typedef GenerateMessageCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} [response] GenerateMessageResponse
                         */
    
                        /**
                         * Calls GenerateMessage.
                         * @function generateMessage
                         * @memberof google.ai.generativelanguage.v1alpha.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest} request GenerateMessageRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.DiscussService.GenerateMessageCallback} callback Node-style callback called with the error, if any, and GenerateMessageResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(DiscussService.prototype.generateMessage = function generateMessage(request, callback) {
                            return this.rpcCall(generateMessage, $root.google.ai.generativelanguage.v1alpha.GenerateMessageRequest, $root.google.ai.generativelanguage.v1alpha.GenerateMessageResponse, request, callback);
                        }, "name", { value: "GenerateMessage" });
    
                        /**
                         * Calls GenerateMessage.
                         * @function generateMessage
                         * @memberof google.ai.generativelanguage.v1alpha.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest} request GenerateMessageRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.GenerateMessageResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.DiscussService|countMessageTokens}.
                         * @memberof google.ai.generativelanguage.v1alpha.DiscussService
                         * @typedef CountMessageTokensCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} [response] CountMessageTokensResponse
                         */
    
                        /**
                         * Calls CountMessageTokens.
                         * @function countMessageTokens
                         * @memberof google.ai.generativelanguage.v1alpha.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.DiscussService.CountMessageTokensCallback} callback Node-style callback called with the error, if any, and CountMessageTokensResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(DiscussService.prototype.countMessageTokens = function countMessageTokens(request, callback) {
                            return this.rpcCall(countMessageTokens, $root.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest, $root.google.ai.generativelanguage.v1alpha.CountMessageTokensResponse, request, callback);
                        }, "name", { value: "CountMessageTokens" });
    
                        /**
                         * Calls CountMessageTokens.
                         * @function countMessageTokens
                         * @memberof google.ai.generativelanguage.v1alpha.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.CountMessageTokensResponse>} Promise
                         * @variation 2
                         */
    
                        return DiscussService;
                    })();
    
                    v1alpha.GenerateMessageRequest = (function() {
    
                        /**
                         * Properties of a GenerateMessageRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGenerateMessageRequest
                         * @property {string|null} [model] GenerateMessageRequest model
                         * @property {google.ai.generativelanguage.v1alpha.IMessagePrompt|null} [prompt] GenerateMessageRequest prompt
                         * @property {number|null} [temperature] GenerateMessageRequest temperature
                         * @property {number|null} [candidateCount] GenerateMessageRequest candidateCount
                         * @property {number|null} [topP] GenerateMessageRequest topP
                         * @property {number|null} [topK] GenerateMessageRequest topK
                         */
    
                        /**
                         * Constructs a new GenerateMessageRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GenerateMessageRequest.
                         * @implements IGenerateMessageRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest=} [properties] Properties to set
                         */
                        function GenerateMessageRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateMessageRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.model = "";
    
                        /**
                         * GenerateMessageRequest prompt.
                         * @member {google.ai.generativelanguage.v1alpha.IMessagePrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.prompt = null;
    
                        /**
                         * GenerateMessageRequest temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.temperature = null;
    
                        /**
                         * GenerateMessageRequest candidateCount.
                         * @member {number|null|undefined} candidateCount
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.candidateCount = null;
    
                        /**
                         * GenerateMessageRequest topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.topP = null;
    
                        /**
                         * GenerateMessageRequest topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.topK = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateMessageRequest _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _candidateCount.
                         * @member {"candidateCount"|undefined} _candidateCount
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_candidateCount", {
                            get: $util.oneOfGetter($oneOfFields = ["candidateCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateMessageRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageRequest} GenerateMessageRequest instance
                         */
                        GenerateMessageRequest.create = function create(properties) {
                            return new GenerateMessageRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateMessageRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1alpha.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature);
                            if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 5, wireType 5 =*/45).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.topK);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateMessageRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateMessageRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageRequest} GenerateMessageRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateMessageRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 4: {
                                        message.candidateCount = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 6: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateMessageRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageRequest} GenerateMessageRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateMessageRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateMessageRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                properties._candidateCount = 1;
                                if (!$util.isInteger(message.candidateCount))
                                    return "candidateCount: integer expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateMessageRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageRequest} GenerateMessageRequest
                         */
                        GenerateMessageRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateMessageRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GenerateMessageRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.fromObject(object.prompt);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.candidateCount != null)
                                message.candidateCount = object.candidateCount | 0;
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateMessageRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GenerateMessageRequest} message GenerateMessageRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateMessageRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.toObject(message.prompt, options);
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                object.candidateCount = message.candidateCount;
                                if (options.oneofs)
                                    object._candidateCount = "candidateCount";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateMessageRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateMessageRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateMessageRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateMessageRequest";
                        };
    
                        return GenerateMessageRequest;
                    })();
    
                    v1alpha.GenerateMessageResponse = (function() {
    
                        /**
                         * Properties of a GenerateMessageResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGenerateMessageResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IMessage>|null} [candidates] GenerateMessageResponse candidates
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IMessage>|null} [messages] GenerateMessageResponse messages
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IContentFilter>|null} [filters] GenerateMessageResponse filters
                         */
    
                        /**
                         * Constructs a new GenerateMessageResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GenerateMessageResponse.
                         * @implements IGenerateMessageResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageResponse=} [properties] Properties to set
                         */
                        function GenerateMessageResponse(properties) {
                            this.candidates = [];
                            this.messages = [];
                            this.filters = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateMessageResponse candidates.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IMessage>} candidates
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.candidates = $util.emptyArray;
    
                        /**
                         * GenerateMessageResponse messages.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IMessage>} messages
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.messages = $util.emptyArray;
    
                        /**
                         * GenerateMessageResponse filters.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IContentFilter>} filters
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.filters = $util.emptyArray;
    
                        /**
                         * Creates a new GenerateMessageResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} GenerateMessageResponse instance
                         */
                        GenerateMessageResponse.create = function create(properties) {
                            return new GenerateMessageResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateMessageResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidates != null && message.candidates.length)
                                for (var i = 0; i < message.candidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Message.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.messages != null && message.messages.length)
                                for (var i = 0; i < message.messages.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Message.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.filters != null && message.filters.length)
                                for (var i = 0; i < message.filters.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateMessageResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateMessageResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} GenerateMessageResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateMessageResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.candidates && message.candidates.length))
                                            message.candidates = [];
                                        message.candidates.push($root.google.ai.generativelanguage.v1alpha.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        if (!(message.messages && message.messages.length))
                                            message.messages = [];
                                        message.messages.push($root.google.ai.generativelanguage.v1alpha.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.filters && message.filters.length))
                                            message.filters = [];
                                        message.filters.push($root.google.ai.generativelanguage.v1alpha.ContentFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateMessageResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} GenerateMessageResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateMessageResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateMessageResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                if (!Array.isArray(message.candidates))
                                    return "candidates: array expected";
                                for (var i = 0; i < message.candidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Message.verify(message.candidates[i]);
                                    if (error)
                                        return "candidates." + error;
                                }
                            }
                            if (message.messages != null && message.hasOwnProperty("messages")) {
                                if (!Array.isArray(message.messages))
                                    return "messages: array expected";
                                for (var i = 0; i < message.messages.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Message.verify(message.messages[i]);
                                    if (error)
                                        return "messages." + error;
                                }
                            }
                            if (message.filters != null && message.hasOwnProperty("filters")) {
                                if (!Array.isArray(message.filters))
                                    return "filters: array expected";
                                for (var i = 0; i < message.filters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.ContentFilter.verify(message.filters[i]);
                                    if (error)
                                        return "filters." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateMessageResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} GenerateMessageResponse
                         */
                        GenerateMessageResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateMessageResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GenerateMessageResponse();
                            if (object.candidates) {
                                if (!Array.isArray(object.candidates))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.candidates: array expected");
                                message.candidates = [];
                                for (var i = 0; i < object.candidates.length; ++i) {
                                    if (typeof object.candidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.candidates: object expected");
                                    message.candidates[i] = $root.google.ai.generativelanguage.v1alpha.Message.fromObject(object.candidates[i]);
                                }
                            }
                            if (object.messages) {
                                if (!Array.isArray(object.messages))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.messages: array expected");
                                message.messages = [];
                                for (var i = 0; i < object.messages.length; ++i) {
                                    if (typeof object.messages[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.messages: object expected");
                                    message.messages[i] = $root.google.ai.generativelanguage.v1alpha.Message.fromObject(object.messages[i]);
                                }
                            }
                            if (object.filters) {
                                if (!Array.isArray(object.filters))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.filters: array expected");
                                message.filters = [];
                                for (var i = 0; i < object.filters.length; ++i) {
                                    if (typeof object.filters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.filters: object expected");
                                    message.filters[i] = $root.google.ai.generativelanguage.v1alpha.ContentFilter.fromObject(object.filters[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateMessageResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} message GenerateMessageResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateMessageResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.candidates = [];
                                object.messages = [];
                                object.filters = [];
                            }
                            if (message.candidates && message.candidates.length) {
                                object.candidates = [];
                                for (var j = 0; j < message.candidates.length; ++j)
                                    object.candidates[j] = $root.google.ai.generativelanguage.v1alpha.Message.toObject(message.candidates[j], options);
                            }
                            if (message.messages && message.messages.length) {
                                object.messages = [];
                                for (var j = 0; j < message.messages.length; ++j)
                                    object.messages[j] = $root.google.ai.generativelanguage.v1alpha.Message.toObject(message.messages[j], options);
                            }
                            if (message.filters && message.filters.length) {
                                object.filters = [];
                                for (var j = 0; j < message.filters.length; ++j)
                                    object.filters[j] = $root.google.ai.generativelanguage.v1alpha.ContentFilter.toObject(message.filters[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateMessageResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateMessageResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateMessageResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateMessageResponse";
                        };
    
                        return GenerateMessageResponse;
                    })();
    
                    v1alpha.Message = (function() {
    
                        /**
                         * Properties of a Message.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IMessage
                         * @property {string|null} [author] Message author
                         * @property {string|null} [content] Message content
                         * @property {google.ai.generativelanguage.v1alpha.ICitationMetadata|null} [citationMetadata] Message citationMetadata
                         */
    
                        /**
                         * Constructs a new Message.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Message.
                         * @implements IMessage
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IMessage=} [properties] Properties to set
                         */
                        function Message(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Message author.
                         * @member {string} author
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @instance
                         */
                        Message.prototype.author = "";
    
                        /**
                         * Message content.
                         * @member {string} content
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @instance
                         */
                        Message.prototype.content = "";
    
                        /**
                         * Message citationMetadata.
                         * @member {google.ai.generativelanguage.v1alpha.ICitationMetadata|null|undefined} citationMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @instance
                         */
                        Message.prototype.citationMetadata = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Message _citationMetadata.
                         * @member {"citationMetadata"|undefined} _citationMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @instance
                         */
                        Object.defineProperty(Message.prototype, "_citationMetadata", {
                            get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Message instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IMessage=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Message} Message instance
                         */
                        Message.create = function create(properties) {
                            return new Message(properties);
                        };
    
                        /**
                         * Encodes the specified Message message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Message.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IMessage} message Message message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Message.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.author != null && Object.hasOwnProperty.call(message, "author"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.author);
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.content);
                            if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata"))
                                $root.google.ai.generativelanguage.v1alpha.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Message message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Message.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IMessage} message Message message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Message.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Message message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Message} Message
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Message.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Message();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.author = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.content = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Message message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Message} Message
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Message.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Message message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Message.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.author != null && message.hasOwnProperty("author"))
                                if (!$util.isString(message.author))
                                    return "author: string expected";
                            if (message.content != null && message.hasOwnProperty("content"))
                                if (!$util.isString(message.content))
                                    return "content: string expected";
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                properties._citationMetadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.verify(message.citationMetadata);
                                    if (error)
                                        return "citationMetadata." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Message message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Message} Message
                         */
                        Message.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Message)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Message();
                            if (object.author != null)
                                message.author = String(object.author);
                            if (object.content != null)
                                message.content = String(object.content);
                            if (object.citationMetadata != null) {
                                if (typeof object.citationMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Message.citationMetadata: object expected");
                                message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.fromObject(object.citationMetadata);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Message message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Message} message Message
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Message.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.author = "";
                                object.content = "";
                            }
                            if (message.author != null && message.hasOwnProperty("author"))
                                object.author = message.author;
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = message.content;
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                object.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.toObject(message.citationMetadata, options);
                                if (options.oneofs)
                                    object._citationMetadata = "citationMetadata";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Message to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Message.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Message
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Message
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Message";
                        };
    
                        return Message;
                    })();
    
                    v1alpha.MessagePrompt = (function() {
    
                        /**
                         * Properties of a MessagePrompt.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IMessagePrompt
                         * @property {string|null} [context] MessagePrompt context
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IExample>|null} [examples] MessagePrompt examples
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IMessage>|null} [messages] MessagePrompt messages
                         */
    
                        /**
                         * Constructs a new MessagePrompt.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a MessagePrompt.
                         * @implements IMessagePrompt
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IMessagePrompt=} [properties] Properties to set
                         */
                        function MessagePrompt(properties) {
                            this.examples = [];
                            this.messages = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * MessagePrompt context.
                         * @member {string} context
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.context = "";
    
                        /**
                         * MessagePrompt examples.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IExample>} examples
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.examples = $util.emptyArray;
    
                        /**
                         * MessagePrompt messages.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IMessage>} messages
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.messages = $util.emptyArray;
    
                        /**
                         * Creates a new MessagePrompt instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IMessagePrompt=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.MessagePrompt} MessagePrompt instance
                         */
                        MessagePrompt.create = function create(properties) {
                            return new MessagePrompt(properties);
                        };
    
                        /**
                         * Encodes the specified MessagePrompt message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MessagePrompt.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IMessagePrompt} message MessagePrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MessagePrompt.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.context != null && Object.hasOwnProperty.call(message, "context"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.context);
                            if (message.examples != null && message.examples.length)
                                for (var i = 0; i < message.examples.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Example.encode(message.examples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.messages != null && message.messages.length)
                                for (var i = 0; i < message.messages.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Message.encode(message.messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified MessagePrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MessagePrompt.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IMessagePrompt} message MessagePrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MessagePrompt.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a MessagePrompt message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.MessagePrompt} MessagePrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MessagePrompt.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.MessagePrompt();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.context = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.examples && message.examples.length))
                                            message.examples = [];
                                        message.examples.push($root.google.ai.generativelanguage.v1alpha.Example.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.messages && message.messages.length))
                                            message.messages = [];
                                        message.messages.push($root.google.ai.generativelanguage.v1alpha.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a MessagePrompt message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.MessagePrompt} MessagePrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MessagePrompt.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a MessagePrompt message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        MessagePrompt.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.context != null && message.hasOwnProperty("context"))
                                if (!$util.isString(message.context))
                                    return "context: string expected";
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                if (!Array.isArray(message.examples))
                                    return "examples: array expected";
                                for (var i = 0; i < message.examples.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Example.verify(message.examples[i]);
                                    if (error)
                                        return "examples." + error;
                                }
                            }
                            if (message.messages != null && message.hasOwnProperty("messages")) {
                                if (!Array.isArray(message.messages))
                                    return "messages: array expected";
                                for (var i = 0; i < message.messages.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Message.verify(message.messages[i]);
                                    if (error)
                                        return "messages." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a MessagePrompt message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.MessagePrompt} MessagePrompt
                         */
                        MessagePrompt.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.MessagePrompt)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.MessagePrompt();
                            if (object.context != null)
                                message.context = String(object.context);
                            if (object.examples) {
                                if (!Array.isArray(object.examples))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.MessagePrompt.examples: array expected");
                                message.examples = [];
                                for (var i = 0; i < object.examples.length; ++i) {
                                    if (typeof object.examples[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.MessagePrompt.examples: object expected");
                                    message.examples[i] = $root.google.ai.generativelanguage.v1alpha.Example.fromObject(object.examples[i]);
                                }
                            }
                            if (object.messages) {
                                if (!Array.isArray(object.messages))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.MessagePrompt.messages: array expected");
                                message.messages = [];
                                for (var i = 0; i < object.messages.length; ++i) {
                                    if (typeof object.messages[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.MessagePrompt.messages: object expected");
                                    message.messages[i] = $root.google.ai.generativelanguage.v1alpha.Message.fromObject(object.messages[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a MessagePrompt message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.MessagePrompt} message MessagePrompt
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        MessagePrompt.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.examples = [];
                                object.messages = [];
                            }
                            if (options.defaults)
                                object.context = "";
                            if (message.context != null && message.hasOwnProperty("context"))
                                object.context = message.context;
                            if (message.examples && message.examples.length) {
                                object.examples = [];
                                for (var j = 0; j < message.examples.length; ++j)
                                    object.examples[j] = $root.google.ai.generativelanguage.v1alpha.Example.toObject(message.examples[j], options);
                            }
                            if (message.messages && message.messages.length) {
                                object.messages = [];
                                for (var j = 0; j < message.messages.length; ++j)
                                    object.messages[j] = $root.google.ai.generativelanguage.v1alpha.Message.toObject(message.messages[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this MessagePrompt to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        MessagePrompt.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for MessagePrompt
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        MessagePrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.MessagePrompt";
                        };
    
                        return MessagePrompt;
                    })();
    
                    v1alpha.Example = (function() {
    
                        /**
                         * Properties of an Example.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IExample
                         * @property {google.ai.generativelanguage.v1alpha.IMessage|null} [input] Example input
                         * @property {google.ai.generativelanguage.v1alpha.IMessage|null} [output] Example output
                         */
    
                        /**
                         * Constructs a new Example.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an Example.
                         * @implements IExample
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IExample=} [properties] Properties to set
                         */
                        function Example(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Example input.
                         * @member {google.ai.generativelanguage.v1alpha.IMessage|null|undefined} input
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @instance
                         */
                        Example.prototype.input = null;
    
                        /**
                         * Example output.
                         * @member {google.ai.generativelanguage.v1alpha.IMessage|null|undefined} output
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @instance
                         */
                        Example.prototype.output = null;
    
                        /**
                         * Creates a new Example instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IExample=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Example} Example instance
                         */
                        Example.create = function create(properties) {
                            return new Example(properties);
                        };
    
                        /**
                         * Encodes the specified Example message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Example.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IExample} message Example message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Example.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.input != null && Object.hasOwnProperty.call(message, "input"))
                                $root.google.ai.generativelanguage.v1alpha.Message.encode(message.input, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                $root.google.ai.generativelanguage.v1alpha.Message.encode(message.output, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Example message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Example.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IExample} message Example message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Example.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an Example message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Example} Example
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Example.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Example();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.input = $root.google.ai.generativelanguage.v1alpha.Message.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.output = $root.google.ai.generativelanguage.v1alpha.Message.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an Example message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Example} Example
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Example.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an Example message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Example.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.input != null && message.hasOwnProperty("input")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Message.verify(message.input);
                                if (error)
                                    return "input." + error;
                            }
                            if (message.output != null && message.hasOwnProperty("output")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Message.verify(message.output);
                                if (error)
                                    return "output." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an Example message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Example} Example
                         */
                        Example.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Example)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Example();
                            if (object.input != null) {
                                if (typeof object.input !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Example.input: object expected");
                                message.input = $root.google.ai.generativelanguage.v1alpha.Message.fromObject(object.input);
                            }
                            if (object.output != null) {
                                if (typeof object.output !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Example.output: object expected");
                                message.output = $root.google.ai.generativelanguage.v1alpha.Message.fromObject(object.output);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an Example message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Example} message Example
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Example.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.input = null;
                                object.output = null;
                            }
                            if (message.input != null && message.hasOwnProperty("input"))
                                object.input = $root.google.ai.generativelanguage.v1alpha.Message.toObject(message.input, options);
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = $root.google.ai.generativelanguage.v1alpha.Message.toObject(message.output, options);
                            return object;
                        };
    
                        /**
                         * Converts this Example to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Example.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Example
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Example
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Example";
                        };
    
                        return Example;
                    })();
    
                    v1alpha.CountMessageTokensRequest = (function() {
    
                        /**
                         * Properties of a CountMessageTokensRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICountMessageTokensRequest
                         * @property {string|null} [model] CountMessageTokensRequest model
                         * @property {google.ai.generativelanguage.v1alpha.IMessagePrompt|null} [prompt] CountMessageTokensRequest prompt
                         */
    
                        /**
                         * Constructs a new CountMessageTokensRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CountMessageTokensRequest.
                         * @implements ICountMessageTokensRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest=} [properties] Properties to set
                         */
                        function CountMessageTokensRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountMessageTokensRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @instance
                         */
                        CountMessageTokensRequest.prototype.model = "";
    
                        /**
                         * CountMessageTokensRequest prompt.
                         * @member {google.ai.generativelanguage.v1alpha.IMessagePrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @instance
                         */
                        CountMessageTokensRequest.prototype.prompt = null;
    
                        /**
                         * Creates a new CountMessageTokensRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensRequest} CountMessageTokensRequest instance
                         */
                        CountMessageTokensRequest.create = function create(properties) {
                            return new CountMessageTokensRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1alpha.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountMessageTokensRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensRequest} CountMessageTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountMessageTokensRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensRequest} CountMessageTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountMessageTokensRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountMessageTokensRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CountMessageTokensRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensRequest} CountMessageTokensRequest
                         */
                        CountMessageTokensRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CountMessageTokensRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.fromObject(object.prompt);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountMessageTokensRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CountMessageTokensRequest} message CountMessageTokensRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountMessageTokensRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.toObject(message.prompt, options);
                            return object;
                        };
    
                        /**
                         * Converts this CountMessageTokensRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountMessageTokensRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountMessageTokensRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountMessageTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountMessageTokensRequest";
                        };
    
                        return CountMessageTokensRequest;
                    })();
    
                    v1alpha.CountMessageTokensResponse = (function() {
    
                        /**
                         * Properties of a CountMessageTokensResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICountMessageTokensResponse
                         * @property {number|null} [tokenCount] CountMessageTokensResponse tokenCount
                         */
    
                        /**
                         * Constructs a new CountMessageTokensResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CountMessageTokensResponse.
                         * @implements ICountMessageTokensResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse=} [properties] Properties to set
                         */
                        function CountMessageTokensResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountMessageTokensResponse tokenCount.
                         * @member {number} tokenCount
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse
                         * @instance
                         */
                        CountMessageTokensResponse.prototype.tokenCount = 0;
    
                        /**
                         * Creates a new CountMessageTokensResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} CountMessageTokensResponse instance
                         */
                        CountMessageTokensResponse.create = function create(properties) {
                            return new CountMessageTokensResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tokenCount);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountMessageTokensResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} CountMessageTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CountMessageTokensResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tokenCount = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountMessageTokensResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} CountMessageTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountMessageTokensResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountMessageTokensResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                if (!$util.isInteger(message.tokenCount))
                                    return "tokenCount: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a CountMessageTokensResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} CountMessageTokensResponse
                         */
                        CountMessageTokensResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountMessageTokensResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CountMessageTokensResponse();
                            if (object.tokenCount != null)
                                message.tokenCount = object.tokenCount | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountMessageTokensResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} message CountMessageTokensResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountMessageTokensResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.tokenCount = 0;
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                object.tokenCount = message.tokenCount;
                            return object;
                        };
    
                        /**
                         * Converts this CountMessageTokensResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountMessageTokensResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountMessageTokensResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountMessageTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountMessageTokensResponse";
                        };
    
                        return CountMessageTokensResponse;
                    })();
    
                    /**
                     * HarmCategory enum.
                     * @name google.ai.generativelanguage.v1alpha.HarmCategory
                     * @enum {number}
                     * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value
                     * @property {number} HARM_CATEGORY_DEROGATORY=1 HARM_CATEGORY_DEROGATORY value
                     * @property {number} HARM_CATEGORY_TOXICITY=2 HARM_CATEGORY_TOXICITY value
                     * @property {number} HARM_CATEGORY_VIOLENCE=3 HARM_CATEGORY_VIOLENCE value
                     * @property {number} HARM_CATEGORY_SEXUAL=4 HARM_CATEGORY_SEXUAL value
                     * @property {number} HARM_CATEGORY_MEDICAL=5 HARM_CATEGORY_MEDICAL value
                     * @property {number} HARM_CATEGORY_DANGEROUS=6 HARM_CATEGORY_DANGEROUS value
                     * @property {number} HARM_CATEGORY_HARASSMENT=7 HARM_CATEGORY_HARASSMENT value
                     * @property {number} HARM_CATEGORY_HATE_SPEECH=8 HARM_CATEGORY_HATE_SPEECH value
                     * @property {number} HARM_CATEGORY_SEXUALLY_EXPLICIT=9 HARM_CATEGORY_SEXUALLY_EXPLICIT value
                     * @property {number} HARM_CATEGORY_DANGEROUS_CONTENT=10 HARM_CATEGORY_DANGEROUS_CONTENT value
                     * @property {number} HARM_CATEGORY_CIVIC_INTEGRITY=11 HARM_CATEGORY_CIVIC_INTEGRITY value
                     */
                    v1alpha.HarmCategory = (function() {
                        var valuesById = {}, values = Object.create(valuesById);
                        values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0;
                        values[valuesById[1] = "HARM_CATEGORY_DEROGATORY"] = 1;
                        values[valuesById[2] = "HARM_CATEGORY_TOXICITY"] = 2;
                        values[valuesById[3] = "HARM_CATEGORY_VIOLENCE"] = 3;
                        values[valuesById[4] = "HARM_CATEGORY_SEXUAL"] = 4;
                        values[valuesById[5] = "HARM_CATEGORY_MEDICAL"] = 5;
                        values[valuesById[6] = "HARM_CATEGORY_DANGEROUS"] = 6;
                        values[valuesById[7] = "HARM_CATEGORY_HARASSMENT"] = 7;
                        values[valuesById[8] = "HARM_CATEGORY_HATE_SPEECH"] = 8;
                        values[valuesById[9] = "HARM_CATEGORY_SEXUALLY_EXPLICIT"] = 9;
                        values[valuesById[10] = "HARM_CATEGORY_DANGEROUS_CONTENT"] = 10;
                        values[valuesById[11] = "HARM_CATEGORY_CIVIC_INTEGRITY"] = 11;
                        return values;
                    })();
    
                    v1alpha.ContentFilter = (function() {
    
                        /**
                         * Properties of a ContentFilter.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IContentFilter
                         * @property {google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason|null} [reason] ContentFilter reason
                         * @property {string|null} [message] ContentFilter message
                         */
    
                        /**
                         * Constructs a new ContentFilter.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ContentFilter.
                         * @implements IContentFilter
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IContentFilter=} [properties] Properties to set
                         */
                        function ContentFilter(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ContentFilter reason.
                         * @member {google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason} reason
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @instance
                         */
                        ContentFilter.prototype.reason = 0;
    
                        /**
                         * ContentFilter message.
                         * @member {string|null|undefined} message
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @instance
                         */
                        ContentFilter.prototype.message = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * ContentFilter _message.
                         * @member {"message"|undefined} _message
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @instance
                         */
                        Object.defineProperty(ContentFilter.prototype, "_message", {
                            get: $util.oneOfGetter($oneOfFields = ["message"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new ContentFilter instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IContentFilter=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ContentFilter} ContentFilter instance
                         */
                        ContentFilter.create = function create(properties) {
                            return new ContentFilter(properties);
                        };
    
                        /**
                         * Encodes the specified ContentFilter message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentFilter.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IContentFilter} message ContentFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentFilter.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.reason != null && Object.hasOwnProperty.call(message, "reason"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.reason);
                            if (message.message != null && Object.hasOwnProperty.call(message, "message"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.message);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentFilter.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IContentFilter} message ContentFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentFilter.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ContentFilter message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ContentFilter} ContentFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentFilter.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ContentFilter();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.reason = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.message = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ContentFilter message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ContentFilter} ContentFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentFilter.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ContentFilter message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ContentFilter.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.reason != null && message.hasOwnProperty("reason"))
                                switch (message.reason) {
                                default:
                                    return "reason: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                    break;
                                }
                            if (message.message != null && message.hasOwnProperty("message")) {
                                properties._message = 1;
                                if (!$util.isString(message.message))
                                    return "message: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ContentFilter} ContentFilter
                         */
                        ContentFilter.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ContentFilter)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ContentFilter();
                            switch (object.reason) {
                            default:
                                if (typeof object.reason === "number") {
                                    message.reason = object.reason;
                                    break;
                                }
                                break;
                            case "BLOCKED_REASON_UNSPECIFIED":
                            case 0:
                                message.reason = 0;
                                break;
                            case "SAFETY":
                            case 1:
                                message.reason = 1;
                                break;
                            case "OTHER":
                            case 2:
                                message.reason = 2;
                                break;
                            }
                            if (object.message != null)
                                message.message = String(object.message);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ContentFilter message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ContentFilter} message ContentFilter
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ContentFilter.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.reason = options.enums === String ? "BLOCKED_REASON_UNSPECIFIED" : 0;
                            if (message.reason != null && message.hasOwnProperty("reason"))
                                object.reason = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason[message.reason] === undefined ? message.reason : $root.google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason[message.reason] : message.reason;
                            if (message.message != null && message.hasOwnProperty("message")) {
                                object.message = message.message;
                                if (options.oneofs)
                                    object._message = "message";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this ContentFilter to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ContentFilter.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ContentFilter
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ContentFilter
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ContentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ContentFilter";
                        };
    
                        /**
                         * BlockedReason enum.
                         * @name google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason
                         * @enum {number}
                         * @property {number} BLOCKED_REASON_UNSPECIFIED=0 BLOCKED_REASON_UNSPECIFIED value
                         * @property {number} SAFETY=1 SAFETY value
                         * @property {number} OTHER=2 OTHER value
                         */
                        ContentFilter.BlockedReason = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "BLOCKED_REASON_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "SAFETY"] = 1;
                            values[valuesById[2] = "OTHER"] = 2;
                            return values;
                        })();
    
                        return ContentFilter;
                    })();
    
                    v1alpha.SafetyFeedback = (function() {
    
                        /**
                         * Properties of a SafetyFeedback.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ISafetyFeedback
                         * @property {google.ai.generativelanguage.v1alpha.ISafetyRating|null} [rating] SafetyFeedback rating
                         * @property {google.ai.generativelanguage.v1alpha.ISafetySetting|null} [setting] SafetyFeedback setting
                         */
    
                        /**
                         * Constructs a new SafetyFeedback.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a SafetyFeedback.
                         * @implements ISafetyFeedback
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ISafetyFeedback=} [properties] Properties to set
                         */
                        function SafetyFeedback(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetyFeedback rating.
                         * @member {google.ai.generativelanguage.v1alpha.ISafetyRating|null|undefined} rating
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @instance
                         */
                        SafetyFeedback.prototype.rating = null;
    
                        /**
                         * SafetyFeedback setting.
                         * @member {google.ai.generativelanguage.v1alpha.ISafetySetting|null|undefined} setting
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @instance
                         */
                        SafetyFeedback.prototype.setting = null;
    
                        /**
                         * Creates a new SafetyFeedback instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISafetyFeedback=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.SafetyFeedback} SafetyFeedback instance
                         */
                        SafetyFeedback.create = function create(properties) {
                            return new SafetyFeedback(properties);
                        };
    
                        /**
                         * Encodes the specified SafetyFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyFeedback.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISafetyFeedback} message SafetyFeedback message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyFeedback.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.rating != null && Object.hasOwnProperty.call(message, "rating"))
                                $root.google.ai.generativelanguage.v1alpha.SafetyRating.encode(message.rating, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.setting != null && Object.hasOwnProperty.call(message, "setting"))
                                $root.google.ai.generativelanguage.v1alpha.SafetySetting.encode(message.setting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetyFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyFeedback.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISafetyFeedback} message SafetyFeedback message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyFeedback.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetyFeedback message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.SafetyFeedback} SafetyFeedback
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyFeedback.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.SafetyFeedback();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.rating = $root.google.ai.generativelanguage.v1alpha.SafetyRating.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.setting = $root.google.ai.generativelanguage.v1alpha.SafetySetting.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetyFeedback message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.SafetyFeedback} SafetyFeedback
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyFeedback.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetyFeedback message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetyFeedback.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.rating != null && message.hasOwnProperty("rating")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.SafetyRating.verify(message.rating);
                                if (error)
                                    return "rating." + error;
                            }
                            if (message.setting != null && message.hasOwnProperty("setting")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.SafetySetting.verify(message.setting);
                                if (error)
                                    return "setting." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a SafetyFeedback message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.SafetyFeedback} SafetyFeedback
                         */
                        SafetyFeedback.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.SafetyFeedback)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.SafetyFeedback();
                            if (object.rating != null) {
                                if (typeof object.rating !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.SafetyFeedback.rating: object expected");
                                message.rating = $root.google.ai.generativelanguage.v1alpha.SafetyRating.fromObject(object.rating);
                            }
                            if (object.setting != null) {
                                if (typeof object.setting !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.SafetyFeedback.setting: object expected");
                                message.setting = $root.google.ai.generativelanguage.v1alpha.SafetySetting.fromObject(object.setting);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetyFeedback message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.SafetyFeedback} message SafetyFeedback
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetyFeedback.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.rating = null;
                                object.setting = null;
                            }
                            if (message.rating != null && message.hasOwnProperty("rating"))
                                object.rating = $root.google.ai.generativelanguage.v1alpha.SafetyRating.toObject(message.rating, options);
                            if (message.setting != null && message.hasOwnProperty("setting"))
                                object.setting = $root.google.ai.generativelanguage.v1alpha.SafetySetting.toObject(message.setting, options);
                            return object;
                        };
    
                        /**
                         * Converts this SafetyFeedback to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetyFeedback.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetyFeedback
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetyFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SafetyFeedback";
                        };
    
                        return SafetyFeedback;
                    })();
    
                    v1alpha.SafetyRating = (function() {
    
                        /**
                         * Properties of a SafetyRating.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ISafetyRating
                         * @property {google.ai.generativelanguage.v1alpha.HarmCategory|null} [category] SafetyRating category
                         * @property {google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability|null} [probability] SafetyRating probability
                         * @property {boolean|null} [blocked] SafetyRating blocked
                         */
    
                        /**
                         * Constructs a new SafetyRating.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a SafetyRating.
                         * @implements ISafetyRating
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ISafetyRating=} [properties] Properties to set
                         */
                        function SafetyRating(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetyRating category.
                         * @member {google.ai.generativelanguage.v1alpha.HarmCategory} category
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.category = 0;
    
                        /**
                         * SafetyRating probability.
                         * @member {google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability} probability
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.probability = 0;
    
                        /**
                         * SafetyRating blocked.
                         * @member {boolean} blocked
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.blocked = false;
    
                        /**
                         * Creates a new SafetyRating instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISafetyRating=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.SafetyRating} SafetyRating instance
                         */
                        SafetyRating.create = function create(properties) {
                            return new SafetyRating(properties);
                        };
    
                        /**
                         * Encodes the specified SafetyRating message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyRating.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISafetyRating} message SafetyRating message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyRating.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.category != null && Object.hasOwnProperty.call(message, "category"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category);
                            if (message.probability != null && Object.hasOwnProperty.call(message, "probability"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.probability);
                            if (message.blocked != null && Object.hasOwnProperty.call(message, "blocked"))
                                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blocked);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetyRating message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyRating.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISafetyRating} message SafetyRating message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyRating.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetyRating message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.SafetyRating} SafetyRating
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyRating.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.SafetyRating();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.category = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.probability = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.blocked = reader.bool();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetyRating message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.SafetyRating} SafetyRating
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyRating.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetyRating message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetyRating.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.category != null && message.hasOwnProperty("category"))
                                switch (message.category) {
                                default:
                                    return "category: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                case 8:
                                case 9:
                                case 10:
                                case 11:
                                    break;
                                }
                            if (message.probability != null && message.hasOwnProperty("probability"))
                                switch (message.probability) {
                                default:
                                    return "probability: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                    break;
                                }
                            if (message.blocked != null && message.hasOwnProperty("blocked"))
                                if (typeof message.blocked !== "boolean")
                                    return "blocked: boolean expected";
                            return null;
                        };
    
                        /**
                         * Creates a SafetyRating message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.SafetyRating} SafetyRating
                         */
                        SafetyRating.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.SafetyRating)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.SafetyRating();
                            switch (object.category) {
                            default:
                                if (typeof object.category === "number") {
                                    message.category = object.category;
                                    break;
                                }
                                break;
                            case "HARM_CATEGORY_UNSPECIFIED":
                            case 0:
                                message.category = 0;
                                break;
                            case "HARM_CATEGORY_DEROGATORY":
                            case 1:
                                message.category = 1;
                                break;
                            case "HARM_CATEGORY_TOXICITY":
                            case 2:
                                message.category = 2;
                                break;
                            case "HARM_CATEGORY_VIOLENCE":
                            case 3:
                                message.category = 3;
                                break;
                            case "HARM_CATEGORY_SEXUAL":
                            case 4:
                                message.category = 4;
                                break;
                            case "HARM_CATEGORY_MEDICAL":
                            case 5:
                                message.category = 5;
                                break;
                            case "HARM_CATEGORY_DANGEROUS":
                            case 6:
                                message.category = 6;
                                break;
                            case "HARM_CATEGORY_HARASSMENT":
                            case 7:
                                message.category = 7;
                                break;
                            case "HARM_CATEGORY_HATE_SPEECH":
                            case 8:
                                message.category = 8;
                                break;
                            case "HARM_CATEGORY_SEXUALLY_EXPLICIT":
                            case 9:
                                message.category = 9;
                                break;
                            case "HARM_CATEGORY_DANGEROUS_CONTENT":
                            case 10:
                                message.category = 10;
                                break;
                            case "HARM_CATEGORY_CIVIC_INTEGRITY":
                            case 11:
                                message.category = 11;
                                break;
                            }
                            switch (object.probability) {
                            default:
                                if (typeof object.probability === "number") {
                                    message.probability = object.probability;
                                    break;
                                }
                                break;
                            case "HARM_PROBABILITY_UNSPECIFIED":
                            case 0:
                                message.probability = 0;
                                break;
                            case "NEGLIGIBLE":
                            case 1:
                                message.probability = 1;
                                break;
                            case "LOW":
                            case 2:
                                message.probability = 2;
                                break;
                            case "MEDIUM":
                            case 3:
                                message.probability = 3;
                                break;
                            case "HIGH":
                            case 4:
                                message.probability = 4;
                                break;
                            }
                            if (object.blocked != null)
                                message.blocked = Boolean(object.blocked);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetyRating message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.SafetyRating} message SafetyRating
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetyRating.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0;
                                object.probability = options.enums === String ? "HARM_PROBABILITY_UNSPECIFIED" : 0;
                                object.blocked = false;
                            }
                            if (message.category != null && message.hasOwnProperty("category"))
                                object.category = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1alpha.HarmCategory[message.category] : message.category;
                            if (message.probability != null && message.hasOwnProperty("probability"))
                                object.probability = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability[message.probability] === undefined ? message.probability : $root.google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability[message.probability] : message.probability;
                            if (message.blocked != null && message.hasOwnProperty("blocked"))
                                object.blocked = message.blocked;
                            return object;
                        };
    
                        /**
                         * Converts this SafetyRating to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetyRating.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetyRating
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.SafetyRating
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetyRating.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SafetyRating";
                        };
    
                        /**
                         * HarmProbability enum.
                         * @name google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability
                         * @enum {number}
                         * @property {number} HARM_PROBABILITY_UNSPECIFIED=0 HARM_PROBABILITY_UNSPECIFIED value
                         * @property {number} NEGLIGIBLE=1 NEGLIGIBLE value
                         * @property {number} LOW=2 LOW value
                         * @property {number} MEDIUM=3 MEDIUM value
                         * @property {number} HIGH=4 HIGH value
                         */
                        SafetyRating.HarmProbability = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "HARM_PROBABILITY_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "NEGLIGIBLE"] = 1;
                            values[valuesById[2] = "LOW"] = 2;
                            values[valuesById[3] = "MEDIUM"] = 3;
                            values[valuesById[4] = "HIGH"] = 4;
                            return values;
                        })();
    
                        return SafetyRating;
                    })();
    
                    v1alpha.SafetySetting = (function() {
    
                        /**
                         * Properties of a SafetySetting.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ISafetySetting
                         * @property {google.ai.generativelanguage.v1alpha.HarmCategory|null} [category] SafetySetting category
                         * @property {google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold|null} [threshold] SafetySetting threshold
                         */
    
                        /**
                         * Constructs a new SafetySetting.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a SafetySetting.
                         * @implements ISafetySetting
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ISafetySetting=} [properties] Properties to set
                         */
                        function SafetySetting(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetySetting category.
                         * @member {google.ai.generativelanguage.v1alpha.HarmCategory} category
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @instance
                         */
                        SafetySetting.prototype.category = 0;
    
                        /**
                         * SafetySetting threshold.
                         * @member {google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold} threshold
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @instance
                         */
                        SafetySetting.prototype.threshold = 0;
    
                        /**
                         * Creates a new SafetySetting instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISafetySetting=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.SafetySetting} SafetySetting instance
                         */
                        SafetySetting.create = function create(properties) {
                            return new SafetySetting(properties);
                        };
    
                        /**
                         * Encodes the specified SafetySetting message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetySetting.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISafetySetting} message SafetySetting message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetySetting.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.category != null && Object.hasOwnProperty.call(message, "category"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category);
                            if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.threshold);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetySetting.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISafetySetting} message SafetySetting message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetySetting.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetySetting message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.SafetySetting} SafetySetting
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetySetting.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.SafetySetting();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.category = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.threshold = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetySetting message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.SafetySetting} SafetySetting
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetySetting.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetySetting message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetySetting.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.category != null && message.hasOwnProperty("category"))
                                switch (message.category) {
                                default:
                                    return "category: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                case 8:
                                case 9:
                                case 10:
                                case 11:
                                    break;
                                }
                            if (message.threshold != null && message.hasOwnProperty("threshold"))
                                switch (message.threshold) {
                                default:
                                    return "threshold: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                    break;
                                }
                            return null;
                        };
    
                        /**
                         * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.SafetySetting} SafetySetting
                         */
                        SafetySetting.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.SafetySetting)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.SafetySetting();
                            switch (object.category) {
                            default:
                                if (typeof object.category === "number") {
                                    message.category = object.category;
                                    break;
                                }
                                break;
                            case "HARM_CATEGORY_UNSPECIFIED":
                            case 0:
                                message.category = 0;
                                break;
                            case "HARM_CATEGORY_DEROGATORY":
                            case 1:
                                message.category = 1;
                                break;
                            case "HARM_CATEGORY_TOXICITY":
                            case 2:
                                message.category = 2;
                                break;
                            case "HARM_CATEGORY_VIOLENCE":
                            case 3:
                                message.category = 3;
                                break;
                            case "HARM_CATEGORY_SEXUAL":
                            case 4:
                                message.category = 4;
                                break;
                            case "HARM_CATEGORY_MEDICAL":
                            case 5:
                                message.category = 5;
                                break;
                            case "HARM_CATEGORY_DANGEROUS":
                            case 6:
                                message.category = 6;
                                break;
                            case "HARM_CATEGORY_HARASSMENT":
                            case 7:
                                message.category = 7;
                                break;
                            case "HARM_CATEGORY_HATE_SPEECH":
                            case 8:
                                message.category = 8;
                                break;
                            case "HARM_CATEGORY_SEXUALLY_EXPLICIT":
                            case 9:
                                message.category = 9;
                                break;
                            case "HARM_CATEGORY_DANGEROUS_CONTENT":
                            case 10:
                                message.category = 10;
                                break;
                            case "HARM_CATEGORY_CIVIC_INTEGRITY":
                            case 11:
                                message.category = 11;
                                break;
                            }
                            switch (object.threshold) {
                            default:
                                if (typeof object.threshold === "number") {
                                    message.threshold = object.threshold;
                                    break;
                                }
                                break;
                            case "HARM_BLOCK_THRESHOLD_UNSPECIFIED":
                            case 0:
                                message.threshold = 0;
                                break;
                            case "BLOCK_LOW_AND_ABOVE":
                            case 1:
                                message.threshold = 1;
                                break;
                            case "BLOCK_MEDIUM_AND_ABOVE":
                            case 2:
                                message.threshold = 2;
                                break;
                            case "BLOCK_ONLY_HIGH":
                            case 3:
                                message.threshold = 3;
                                break;
                            case "BLOCK_NONE":
                            case 4:
                                message.threshold = 4;
                                break;
                            case "OFF":
                            case 5:
                                message.threshold = 5;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetySetting message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.SafetySetting} message SafetySetting
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetySetting.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0;
                                object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0;
                            }
                            if (message.category != null && message.hasOwnProperty("category"))
                                object.category = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1alpha.HarmCategory[message.category] : message.category;
                            if (message.threshold != null && message.hasOwnProperty("threshold"))
                                object.threshold = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold[message.threshold] : message.threshold;
                            return object;
                        };
    
                        /**
                         * Converts this SafetySetting to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetySetting.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetySetting
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.SafetySetting
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SafetySetting";
                        };
    
                        /**
                         * HarmBlockThreshold enum.
                         * @name google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold
                         * @enum {number}
                         * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value
                         * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value
                         * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value
                         * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value
                         * @property {number} BLOCK_NONE=4 BLOCK_NONE value
                         * @property {number} OFF=5 OFF value
                         */
                        SafetySetting.HarmBlockThreshold = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1;
                            values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2;
                            values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3;
                            values[valuesById[4] = "BLOCK_NONE"] = 4;
                            values[valuesById[5] = "OFF"] = 5;
                            return values;
                        })();
    
                        return SafetySetting;
                    })();
    
                    v1alpha.File = (function() {
    
                        /**
                         * Properties of a File.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IFile
                         * @property {google.ai.generativelanguage.v1alpha.IVideoMetadata|null} [videoMetadata] File videoMetadata
                         * @property {string|null} [name] File name
                         * @property {string|null} [displayName] File displayName
                         * @property {string|null} [mimeType] File mimeType
                         * @property {number|Long|null} [sizeBytes] File sizeBytes
                         * @property {google.protobuf.ITimestamp|null} [createTime] File createTime
                         * @property {google.protobuf.ITimestamp|null} [updateTime] File updateTime
                         * @property {google.protobuf.ITimestamp|null} [expirationTime] File expirationTime
                         * @property {Uint8Array|null} [sha256Hash] File sha256Hash
                         * @property {string|null} [uri] File uri
                         * @property {google.ai.generativelanguage.v1alpha.File.State|null} [state] File state
                         * @property {google.rpc.IStatus|null} [error] File error
                         */
    
                        /**
                         * Constructs a new File.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a File.
                         * @implements IFile
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IFile=} [properties] Properties to set
                         */
                        function File(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * File videoMetadata.
                         * @member {google.ai.generativelanguage.v1alpha.IVideoMetadata|null|undefined} videoMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.videoMetadata = null;
    
                        /**
                         * File name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.name = "";
    
                        /**
                         * File displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.displayName = "";
    
                        /**
                         * File mimeType.
                         * @member {string} mimeType
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.mimeType = "";
    
                        /**
                         * File sizeBytes.
                         * @member {number|Long} sizeBytes
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
    
                        /**
                         * File createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.createTime = null;
    
                        /**
                         * File updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.updateTime = null;
    
                        /**
                         * File expirationTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} expirationTime
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.expirationTime = null;
    
                        /**
                         * File sha256Hash.
                         * @member {Uint8Array} sha256Hash
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.sha256Hash = $util.newBuffer([]);
    
                        /**
                         * File uri.
                         * @member {string} uri
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.uri = "";
    
                        /**
                         * File state.
                         * @member {google.ai.generativelanguage.v1alpha.File.State} state
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.state = 0;
    
                        /**
                         * File error.
                         * @member {google.rpc.IStatus|null|undefined} error
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        File.prototype.error = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * File metadata.
                         * @member {"videoMetadata"|undefined} metadata
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         */
                        Object.defineProperty(File.prototype, "metadata", {
                            get: $util.oneOfGetter($oneOfFields = ["videoMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new File instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFile=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.File} File instance
                         */
                        File.create = function create(properties) {
                            return new File(properties);
                        };
    
                        /**
                         * Encodes the specified File message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.File.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFile} message File message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        File.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName);
                            if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType);
                            if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.sizeBytes);
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime"))
                                $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                            if (message.sha256Hash != null && Object.hasOwnProperty.call(message, "sha256Hash"))
                                writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.sha256Hash);
                            if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
                                writer.uint32(/* id 9, wireType 2 =*/74).string(message.uri);
                            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                                writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state);
                            if (message.error != null && Object.hasOwnProperty.call(message, "error"))
                                $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
                            if (message.videoMetadata != null && Object.hasOwnProperty.call(message, "videoMetadata"))
                                $root.google.ai.generativelanguage.v1alpha.VideoMetadata.encode(message.videoMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified File message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.File.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IFile} message File message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        File.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a File message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.File} File
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        File.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.File();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 12: {
                                        message.videoMetadata = $root.google.ai.generativelanguage.v1alpha.VideoMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.mimeType = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.sizeBytes = reader.int64();
                                        break;
                                    }
                                case 5: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 6: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 7: {
                                        message.expirationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 8: {
                                        message.sha256Hash = reader.bytes();
                                        break;
                                    }
                                case 9: {
                                        message.uri = reader.string();
                                        break;
                                    }
                                case 10: {
                                        message.state = reader.int32();
                                        break;
                                    }
                                case 11: {
                                        message.error = $root.google.rpc.Status.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a File message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.File} File
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        File.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a File message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        File.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) {
                                properties.metadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.VideoMetadata.verify(message.videoMetadata);
                                    if (error)
                                        return "videoMetadata." + error;
                                }
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                if (!$util.isString(message.mimeType))
                                    return "mimeType: string expected";
                            if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes"))
                                if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high)))
                                    return "sizeBytes: integer|Long expected";
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.expirationTime);
                                if (error)
                                    return "expirationTime." + error;
                            }
                            if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash"))
                                if (!(message.sha256Hash && typeof message.sha256Hash.length === "number" || $util.isString(message.sha256Hash)))
                                    return "sha256Hash: buffer expected";
                            if (message.uri != null && message.hasOwnProperty("uri"))
                                if (!$util.isString(message.uri))
                                    return "uri: string expected";
                            if (message.state != null && message.hasOwnProperty("state"))
                                switch (message.state) {
                                default:
                                    return "state: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 10:
                                    break;
                                }
                            if (message.error != null && message.hasOwnProperty("error")) {
                                var error = $root.google.rpc.Status.verify(message.error);
                                if (error)
                                    return "error." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a File message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.File} File
                         */
                        File.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.File)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.File();
                            if (object.videoMetadata != null) {
                                if (typeof object.videoMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.File.videoMetadata: object expected");
                                message.videoMetadata = $root.google.ai.generativelanguage.v1alpha.VideoMetadata.fromObject(object.videoMetadata);
                            }
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.mimeType != null)
                                message.mimeType = String(object.mimeType);
                            if (object.sizeBytes != null)
                                if ($util.Long)
                                    (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false;
                                else if (typeof object.sizeBytes === "string")
                                    message.sizeBytes = parseInt(object.sizeBytes, 10);
                                else if (typeof object.sizeBytes === "number")
                                    message.sizeBytes = object.sizeBytes;
                                else if (typeof object.sizeBytes === "object")
                                    message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber();
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.File.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.File.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            if (object.expirationTime != null) {
                                if (typeof object.expirationTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.File.expirationTime: object expected");
                                message.expirationTime = $root.google.protobuf.Timestamp.fromObject(object.expirationTime);
                            }
                            if (object.sha256Hash != null)
                                if (typeof object.sha256Hash === "string")
                                    $util.base64.decode(object.sha256Hash, message.sha256Hash = $util.newBuffer($util.base64.length(object.sha256Hash)), 0);
                                else if (object.sha256Hash.length >= 0)
                                    message.sha256Hash = object.sha256Hash;
                            if (object.uri != null)
                                message.uri = String(object.uri);
                            switch (object.state) {
                            default:
                                if (typeof object.state === "number") {
                                    message.state = object.state;
                                    break;
                                }
                                break;
                            case "STATE_UNSPECIFIED":
                            case 0:
                                message.state = 0;
                                break;
                            case "PROCESSING":
                            case 1:
                                message.state = 1;
                                break;
                            case "ACTIVE":
                            case 2:
                                message.state = 2;
                                break;
                            case "FAILED":
                            case 10:
                                message.state = 10;
                                break;
                            }
                            if (object.error != null) {
                                if (typeof object.error !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.File.error: object expected");
                                message.error = $root.google.rpc.Status.fromObject(object.error);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a File message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.File} message File
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        File.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.displayName = "";
                                object.mimeType = "";
                                if ($util.Long) {
                                    var long = new $util.Long(0, 0, false);
                                    object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                                } else
                                    object.sizeBytes = options.longs === String ? "0" : 0;
                                object.createTime = null;
                                object.updateTime = null;
                                object.expirationTime = null;
                                if (options.bytes === String)
                                    object.sha256Hash = "";
                                else {
                                    object.sha256Hash = [];
                                    if (options.bytes !== Array)
                                        object.sha256Hash = $util.newBuffer(object.sha256Hash);
                                }
                                object.uri = "";
                                object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
                                object.error = null;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                object.mimeType = message.mimeType;
                            if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes"))
                                if (typeof message.sizeBytes === "number")
                                    object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes;
                                else
                                    object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes;
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            if (message.expirationTime != null && message.hasOwnProperty("expirationTime"))
                                object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options);
                            if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash"))
                                object.sha256Hash = options.bytes === String ? $util.base64.encode(message.sha256Hash, 0, message.sha256Hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.sha256Hash) : message.sha256Hash;
                            if (message.uri != null && message.hasOwnProperty("uri"))
                                object.uri = message.uri;
                            if (message.state != null && message.hasOwnProperty("state"))
                                object.state = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.File.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1alpha.File.State[message.state] : message.state;
                            if (message.error != null && message.hasOwnProperty("error"))
                                object.error = $root.google.rpc.Status.toObject(message.error, options);
                            if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) {
                                object.videoMetadata = $root.google.ai.generativelanguage.v1alpha.VideoMetadata.toObject(message.videoMetadata, options);
                                if (options.oneofs)
                                    object.metadata = "videoMetadata";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this File to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        File.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for File
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.File
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        File.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.File";
                        };
    
                        /**
                         * State enum.
                         * @name google.ai.generativelanguage.v1alpha.File.State
                         * @enum {number}
                         * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value
                         * @property {number} PROCESSING=1 PROCESSING value
                         * @property {number} ACTIVE=2 ACTIVE value
                         * @property {number} FAILED=10 FAILED value
                         */
                        File.State = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "STATE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "PROCESSING"] = 1;
                            values[valuesById[2] = "ACTIVE"] = 2;
                            values[valuesById[10] = "FAILED"] = 10;
                            return values;
                        })();
    
                        return File;
                    })();
    
                    v1alpha.VideoMetadata = (function() {
    
                        /**
                         * Properties of a VideoMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IVideoMetadata
                         * @property {google.protobuf.IDuration|null} [videoDuration] VideoMetadata videoDuration
                         */
    
                        /**
                         * Constructs a new VideoMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a VideoMetadata.
                         * @implements IVideoMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IVideoMetadata=} [properties] Properties to set
                         */
                        function VideoMetadata(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * VideoMetadata videoDuration.
                         * @member {google.protobuf.IDuration|null|undefined} videoDuration
                         * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata
                         * @instance
                         */
                        VideoMetadata.prototype.videoDuration = null;
    
                        /**
                         * Creates a new VideoMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IVideoMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.VideoMetadata} VideoMetadata instance
                         */
                        VideoMetadata.create = function create(properties) {
                            return new VideoMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VideoMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IVideoMetadata} message VideoMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        VideoMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.videoDuration != null && Object.hasOwnProperty.call(message, "videoDuration"))
                                $root.google.protobuf.Duration.encode(message.videoDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VideoMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IVideoMetadata} message VideoMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        VideoMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a VideoMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.VideoMetadata} VideoMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        VideoMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.VideoMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.videoDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a VideoMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.VideoMetadata} VideoMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        VideoMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a VideoMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        VideoMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.videoDuration != null && message.hasOwnProperty("videoDuration")) {
                                var error = $root.google.protobuf.Duration.verify(message.videoDuration);
                                if (error)
                                    return "videoDuration." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.VideoMetadata} VideoMetadata
                         */
                        VideoMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.VideoMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.VideoMetadata();
                            if (object.videoDuration != null) {
                                if (typeof object.videoDuration !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.VideoMetadata.videoDuration: object expected");
                                message.videoDuration = $root.google.protobuf.Duration.fromObject(object.videoDuration);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.VideoMetadata} message VideoMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        VideoMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.videoDuration = null;
                            if (message.videoDuration != null && message.hasOwnProperty("videoDuration"))
                                object.videoDuration = $root.google.protobuf.Duration.toObject(message.videoDuration, options);
                            return object;
                        };
    
                        /**
                         * Converts this VideoMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        VideoMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for VideoMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        VideoMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.VideoMetadata";
                        };
    
                        return VideoMetadata;
                    })();
    
                    v1alpha.FileService = (function() {
    
                        /**
                         * Constructs a new FileService service.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a FileService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function FileService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (FileService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = FileService;
    
                        /**
                         * Creates new FileService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {FileService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        FileService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|createFile}.
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @typedef CreateFileCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.CreateFileResponse} [response] CreateFileResponse
                         */
    
                        /**
                         * Calls CreateFile.
                         * @function createFile
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest} request CreateFileRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.FileService.CreateFileCallback} callback Node-style callback called with the error, if any, and CreateFileResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(FileService.prototype.createFile = function createFile(request, callback) {
                            return this.rpcCall(createFile, $root.google.ai.generativelanguage.v1alpha.CreateFileRequest, $root.google.ai.generativelanguage.v1alpha.CreateFileResponse, request, callback);
                        }, "name", { value: "CreateFile" });
    
                        /**
                         * Calls CreateFile.
                         * @function createFile
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest} request CreateFileRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.CreateFileResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|listFiles}.
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @typedef ListFilesCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.ListFilesResponse} [response] ListFilesResponse
                         */
    
                        /**
                         * Calls ListFiles.
                         * @function listFiles
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest} request ListFilesRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.FileService.ListFilesCallback} callback Node-style callback called with the error, if any, and ListFilesResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(FileService.prototype.listFiles = function listFiles(request, callback) {
                            return this.rpcCall(listFiles, $root.google.ai.generativelanguage.v1alpha.ListFilesRequest, $root.google.ai.generativelanguage.v1alpha.ListFilesResponse, request, callback);
                        }, "name", { value: "ListFiles" });
    
                        /**
                         * Calls ListFiles.
                         * @function listFiles
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest} request ListFilesRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.ListFilesResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|getFile}.
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @typedef GetFileCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.File} [response] File
                         */
    
                        /**
                         * Calls GetFile.
                         * @function getFile
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest} request GetFileRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.FileService.GetFileCallback} callback Node-style callback called with the error, if any, and File
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(FileService.prototype.getFile = function getFile(request, callback) {
                            return this.rpcCall(getFile, $root.google.ai.generativelanguage.v1alpha.GetFileRequest, $root.google.ai.generativelanguage.v1alpha.File, request, callback);
                        }, "name", { value: "GetFile" });
    
                        /**
                         * Calls GetFile.
                         * @function getFile
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest} request GetFileRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.File>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|deleteFile}.
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @typedef DeleteFileCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteFile.
                         * @function deleteFile
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest} request DeleteFileRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.FileService.DeleteFileCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(FileService.prototype.deleteFile = function deleteFile(request, callback) {
                            return this.rpcCall(deleteFile, $root.google.ai.generativelanguage.v1alpha.DeleteFileRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteFile" });
    
                        /**
                         * Calls DeleteFile.
                         * @function deleteFile
                         * @memberof google.ai.generativelanguage.v1alpha.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest} request DeleteFileRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        return FileService;
                    })();
    
                    v1alpha.CreateFileRequest = (function() {
    
                        /**
                         * Properties of a CreateFileRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICreateFileRequest
                         * @property {google.ai.generativelanguage.v1alpha.IFile|null} [file] CreateFileRequest file
                         */
    
                        /**
                         * Constructs a new CreateFileRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CreateFileRequest.
                         * @implements ICreateFileRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest=} [properties] Properties to set
                         */
                        function CreateFileRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateFileRequest file.
                         * @member {google.ai.generativelanguage.v1alpha.IFile|null|undefined} file
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest
                         * @instance
                         */
                        CreateFileRequest.prototype.file = null;
    
                        /**
                         * Creates a new CreateFileRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CreateFileRequest} CreateFileRequest instance
                         */
                        CreateFileRequest.create = function create(properties) {
                            return new CreateFileRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest} message CreateFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateFileRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.file != null && Object.hasOwnProperty.call(message, "file"))
                                $root.google.ai.generativelanguage.v1alpha.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest} message CreateFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateFileRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateFileRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CreateFileRequest} CreateFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateFileRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateFileRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.file = $root.google.ai.generativelanguage.v1alpha.File.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateFileRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CreateFileRequest} CreateFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateFileRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateFileRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateFileRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.file != null && message.hasOwnProperty("file")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.File.verify(message.file);
                                if (error)
                                    return "file." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateFileRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CreateFileRequest} CreateFileRequest
                         */
                        CreateFileRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateFileRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CreateFileRequest();
                            if (object.file != null) {
                                if (typeof object.file !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CreateFileRequest.file: object expected");
                                message.file = $root.google.ai.generativelanguage.v1alpha.File.fromObject(object.file);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateFileRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CreateFileRequest} message CreateFileRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateFileRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.file = null;
                            if (message.file != null && message.hasOwnProperty("file"))
                                object.file = $root.google.ai.generativelanguage.v1alpha.File.toObject(message.file, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateFileRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateFileRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateFileRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateFileRequest";
                        };
    
                        return CreateFileRequest;
                    })();
    
                    v1alpha.CreateFileResponse = (function() {
    
                        /**
                         * Properties of a CreateFileResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICreateFileResponse
                         * @property {google.ai.generativelanguage.v1alpha.IFile|null} [file] CreateFileResponse file
                         */
    
                        /**
                         * Constructs a new CreateFileResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CreateFileResponse.
                         * @implements ICreateFileResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICreateFileResponse=} [properties] Properties to set
                         */
                        function CreateFileResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateFileResponse file.
                         * @member {google.ai.generativelanguage.v1alpha.IFile|null|undefined} file
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse
                         * @instance
                         */
                        CreateFileResponse.prototype.file = null;
    
                        /**
                         * Creates a new CreateFileResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateFileResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CreateFileResponse} CreateFileResponse instance
                         */
                        CreateFileResponse.create = function create(properties) {
                            return new CreateFileResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CreateFileResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateFileResponse} message CreateFileResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateFileResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.file != null && Object.hasOwnProperty.call(message, "file"))
                                $root.google.ai.generativelanguage.v1alpha.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateFileResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateFileResponse} message CreateFileResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateFileResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateFileResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CreateFileResponse} CreateFileResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateFileResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateFileResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.file = $root.google.ai.generativelanguage.v1alpha.File.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateFileResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CreateFileResponse} CreateFileResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateFileResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateFileResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateFileResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.file != null && message.hasOwnProperty("file")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.File.verify(message.file);
                                if (error)
                                    return "file." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateFileResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CreateFileResponse} CreateFileResponse
                         */
                        CreateFileResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateFileResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CreateFileResponse();
                            if (object.file != null) {
                                if (typeof object.file !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CreateFileResponse.file: object expected");
                                message.file = $root.google.ai.generativelanguage.v1alpha.File.fromObject(object.file);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateFileResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CreateFileResponse} message CreateFileResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateFileResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.file = null;
                            if (message.file != null && message.hasOwnProperty("file"))
                                object.file = $root.google.ai.generativelanguage.v1alpha.File.toObject(message.file, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateFileResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateFileResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateFileResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateFileResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateFileResponse";
                        };
    
                        return CreateFileResponse;
                    })();
    
                    v1alpha.ListFilesRequest = (function() {
    
                        /**
                         * Properties of a ListFilesRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListFilesRequest
                         * @property {number|null} [pageSize] ListFilesRequest pageSize
                         * @property {string|null} [pageToken] ListFilesRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListFilesRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListFilesRequest.
                         * @implements IListFilesRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest=} [properties] Properties to set
                         */
                        function ListFilesRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListFilesRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @instance
                         */
                        ListFilesRequest.prototype.pageSize = 0;
    
                        /**
                         * ListFilesRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @instance
                         */
                        ListFilesRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListFilesRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListFilesRequest} ListFilesRequest instance
                         */
                        ListFilesRequest.create = function create(properties) {
                            return new ListFilesRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListFilesRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest} message ListFilesRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListFilesRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListFilesRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest} message ListFilesRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListFilesRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListFilesRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListFilesRequest} ListFilesRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListFilesRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListFilesRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListFilesRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListFilesRequest} ListFilesRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListFilesRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListFilesRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListFilesRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListFilesRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListFilesRequest} ListFilesRequest
                         */
                        ListFilesRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListFilesRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListFilesRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListFilesRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListFilesRequest} message ListFilesRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListFilesRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListFilesRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListFilesRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListFilesRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListFilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListFilesRequest";
                        };
    
                        return ListFilesRequest;
                    })();
    
                    v1alpha.ListFilesResponse = (function() {
    
                        /**
                         * Properties of a ListFilesResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListFilesResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IFile>|null} [files] ListFilesResponse files
                         * @property {string|null} [nextPageToken] ListFilesResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListFilesResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListFilesResponse.
                         * @implements IListFilesResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListFilesResponse=} [properties] Properties to set
                         */
                        function ListFilesResponse(properties) {
                            this.files = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListFilesResponse files.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IFile>} files
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @instance
                         */
                        ListFilesResponse.prototype.files = $util.emptyArray;
    
                        /**
                         * ListFilesResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @instance
                         */
                        ListFilesResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListFilesResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListFilesResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListFilesResponse} ListFilesResponse instance
                         */
                        ListFilesResponse.create = function create(properties) {
                            return new ListFilesResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListFilesResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListFilesResponse} message ListFilesResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListFilesResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.files != null && message.files.length)
                                for (var i = 0; i < message.files.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.File.encode(message.files[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListFilesResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListFilesResponse} message ListFilesResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListFilesResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListFilesResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListFilesResponse} ListFilesResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListFilesResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListFilesResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.files && message.files.length))
                                            message.files = [];
                                        message.files.push($root.google.ai.generativelanguage.v1alpha.File.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListFilesResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListFilesResponse} ListFilesResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListFilesResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListFilesResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListFilesResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.files != null && message.hasOwnProperty("files")) {
                                if (!Array.isArray(message.files))
                                    return "files: array expected";
                                for (var i = 0; i < message.files.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.File.verify(message.files[i]);
                                    if (error)
                                        return "files." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListFilesResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListFilesResponse} ListFilesResponse
                         */
                        ListFilesResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListFilesResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListFilesResponse();
                            if (object.files) {
                                if (!Array.isArray(object.files))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.ListFilesResponse.files: array expected");
                                message.files = [];
                                for (var i = 0; i < object.files.length; ++i) {
                                    if (typeof object.files[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.ListFilesResponse.files: object expected");
                                    message.files[i] = $root.google.ai.generativelanguage.v1alpha.File.fromObject(object.files[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListFilesResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListFilesResponse} message ListFilesResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListFilesResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.files = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.files && message.files.length) {
                                object.files = [];
                                for (var j = 0; j < message.files.length; ++j)
                                    object.files[j] = $root.google.ai.generativelanguage.v1alpha.File.toObject(message.files[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListFilesResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListFilesResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListFilesResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListFilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListFilesResponse";
                        };
    
                        return ListFilesResponse;
                    })();
    
                    v1alpha.GetFileRequest = (function() {
    
                        /**
                         * Properties of a GetFileRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGetFileRequest
                         * @property {string|null} [name] GetFileRequest name
                         */
    
                        /**
                         * Constructs a new GetFileRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GetFileRequest.
                         * @implements IGetFileRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest=} [properties] Properties to set
                         */
                        function GetFileRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetFileRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest
                         * @instance
                         */
                        GetFileRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetFileRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GetFileRequest} GetFileRequest instance
                         */
                        GetFileRequest.create = function create(properties) {
                            return new GetFileRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetFileRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest} message GetFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetFileRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetFileRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest} message GetFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetFileRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetFileRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GetFileRequest} GetFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetFileRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetFileRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetFileRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GetFileRequest} GetFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetFileRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetFileRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetFileRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetFileRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GetFileRequest} GetFileRequest
                         */
                        GetFileRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetFileRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GetFileRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetFileRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GetFileRequest} message GetFileRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetFileRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetFileRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetFileRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetFileRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetFileRequest";
                        };
    
                        return GetFileRequest;
                    })();
    
                    v1alpha.DeleteFileRequest = (function() {
    
                        /**
                         * Properties of a DeleteFileRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IDeleteFileRequest
                         * @property {string|null} [name] DeleteFileRequest name
                         */
    
                        /**
                         * Constructs a new DeleteFileRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a DeleteFileRequest.
                         * @implements IDeleteFileRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest=} [properties] Properties to set
                         */
                        function DeleteFileRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteFileRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest
                         * @instance
                         */
                        DeleteFileRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeleteFileRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteFileRequest} DeleteFileRequest instance
                         */
                        DeleteFileRequest.create = function create(properties) {
                            return new DeleteFileRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteFileRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteFileRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteFileRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteFileRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteFileRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteFileRequest} DeleteFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteFileRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DeleteFileRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteFileRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteFileRequest} DeleteFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteFileRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteFileRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteFileRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteFileRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteFileRequest} DeleteFileRequest
                         */
                        DeleteFileRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteFileRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.DeleteFileRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteFileRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.DeleteFileRequest} message DeleteFileRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteFileRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteFileRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteFileRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteFileRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteFileRequest";
                        };
    
                        return DeleteFileRequest;
                    })();
    
                    v1alpha.GenerativeService = (function() {
    
                        /**
                         * Constructs a new GenerativeService service.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GenerativeService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function GenerativeService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (GenerativeService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GenerativeService;
    
                        /**
                         * Creates new GenerativeService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {GenerativeService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        GenerativeService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|generateContent}.
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @typedef GenerateContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse} [response] GenerateContentResponse
                         */
    
                        /**
                         * Calls GenerateContent.
                         * @function generateContent
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.GenerativeService.GenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.generateContent = function generateContent(request, callback) {
                            return this.rpcCall(generateContent, $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest, $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse, request, callback);
                        }, "name", { value: "GenerateContent" });
    
                        /**
                         * Calls GenerateContent.
                         * @function generateContent
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.GenerateContentResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|generateAnswer}.
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @typedef GenerateAnswerCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} [response] GenerateAnswerResponse
                         */
    
                        /**
                         * Calls GenerateAnswer.
                         * @function generateAnswer
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest} request GenerateAnswerRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.GenerativeService.GenerateAnswerCallback} callback Node-style callback called with the error, if any, and GenerateAnswerResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.generateAnswer = function generateAnswer(request, callback) {
                            return this.rpcCall(generateAnswer, $root.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest, $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse, request, callback);
                        }, "name", { value: "GenerateAnswer" });
    
                        /**
                         * Calls GenerateAnswer.
                         * @function generateAnswer
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest} request GenerateAnswerRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.GenerateAnswerResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|streamGenerateContent}.
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @typedef StreamGenerateContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse} [response] GenerateContentResponse
                         */
    
                        /**
                         * Calls StreamGenerateContent.
                         * @function streamGenerateContent
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.GenerativeService.StreamGenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.streamGenerateContent = function streamGenerateContent(request, callback) {
                            return this.rpcCall(streamGenerateContent, $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest, $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse, request, callback);
                        }, "name", { value: "StreamGenerateContent" });
    
                        /**
                         * Calls StreamGenerateContent.
                         * @function streamGenerateContent
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.GenerateContentResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|embedContent}.
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @typedef EmbedContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.EmbedContentResponse} [response] EmbedContentResponse
                         */
    
                        /**
                         * Calls EmbedContent.
                         * @function embedContent
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest} request EmbedContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.GenerativeService.EmbedContentCallback} callback Node-style callback called with the error, if any, and EmbedContentResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.embedContent = function embedContent(request, callback) {
                            return this.rpcCall(embedContent, $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest, $root.google.ai.generativelanguage.v1alpha.EmbedContentResponse, request, callback);
                        }, "name", { value: "EmbedContent" });
    
                        /**
                         * Calls EmbedContent.
                         * @function embedContent
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest} request EmbedContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.EmbedContentResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|batchEmbedContents}.
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @typedef BatchEmbedContentsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} [response] BatchEmbedContentsResponse
                         */
    
                        /**
                         * Calls BatchEmbedContents.
                         * @function batchEmbedContents
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.GenerativeService.BatchEmbedContentsCallback} callback Node-style callback called with the error, if any, and BatchEmbedContentsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.batchEmbedContents = function batchEmbedContents(request, callback) {
                            return this.rpcCall(batchEmbedContents, $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest, $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse, request, callback);
                        }, "name", { value: "BatchEmbedContents" });
    
                        /**
                         * Calls BatchEmbedContents.
                         * @function batchEmbedContents
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|countTokens}.
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @typedef CountTokensCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.CountTokensResponse} [response] CountTokensResponse
                         */
    
                        /**
                         * Calls CountTokens.
                         * @function countTokens
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest} request CountTokensRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.GenerativeService.CountTokensCallback} callback Node-style callback called with the error, if any, and CountTokensResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.countTokens = function countTokens(request, callback) {
                            return this.rpcCall(countTokens, $root.google.ai.generativelanguage.v1alpha.CountTokensRequest, $root.google.ai.generativelanguage.v1alpha.CountTokensResponse, request, callback);
                        }, "name", { value: "CountTokens" });
    
                        /**
                         * Calls CountTokens.
                         * @function countTokens
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest} request CountTokensRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.CountTokensResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|bidiGenerateContent}.
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @typedef BidiGenerateContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} [response] BidiGenerateContentServerMessage
                         */
    
                        /**
                         * Calls BidiGenerateContent.
                         * @function bidiGenerateContent
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage} request BidiGenerateContentClientMessage message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContentCallback} callback Node-style callback called with the error, if any, and BidiGenerateContentServerMessage
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.bidiGenerateContent = function bidiGenerateContent(request, callback) {
                            return this.rpcCall(bidiGenerateContent, $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage, $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage, request, callback);
                        }, "name", { value: "BidiGenerateContent" });
    
                        /**
                         * Calls BidiGenerateContent.
                         * @function bidiGenerateContent
                         * @memberof google.ai.generativelanguage.v1alpha.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage} request BidiGenerateContentClientMessage message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage>} Promise
                         * @variation 2
                         */
    
                        return GenerativeService;
                    })();
    
                    /**
                     * TaskType enum.
                     * @name google.ai.generativelanguage.v1alpha.TaskType
                     * @enum {number}
                     * @property {number} TASK_TYPE_UNSPECIFIED=0 TASK_TYPE_UNSPECIFIED value
                     * @property {number} RETRIEVAL_QUERY=1 RETRIEVAL_QUERY value
                     * @property {number} RETRIEVAL_DOCUMENT=2 RETRIEVAL_DOCUMENT value
                     * @property {number} SEMANTIC_SIMILARITY=3 SEMANTIC_SIMILARITY value
                     * @property {number} CLASSIFICATION=4 CLASSIFICATION value
                     * @property {number} CLUSTERING=5 CLUSTERING value
                     * @property {number} QUESTION_ANSWERING=6 QUESTION_ANSWERING value
                     * @property {number} FACT_VERIFICATION=7 FACT_VERIFICATION value
                     */
                    v1alpha.TaskType = (function() {
                        var valuesById = {}, values = Object.create(valuesById);
                        values[valuesById[0] = "TASK_TYPE_UNSPECIFIED"] = 0;
                        values[valuesById[1] = "RETRIEVAL_QUERY"] = 1;
                        values[valuesById[2] = "RETRIEVAL_DOCUMENT"] = 2;
                        values[valuesById[3] = "SEMANTIC_SIMILARITY"] = 3;
                        values[valuesById[4] = "CLASSIFICATION"] = 4;
                        values[valuesById[5] = "CLUSTERING"] = 5;
                        values[valuesById[6] = "QUESTION_ANSWERING"] = 6;
                        values[valuesById[7] = "FACT_VERIFICATION"] = 7;
                        return values;
                    })();
    
                    v1alpha.GenerateContentRequest = (function() {
    
                        /**
                         * Properties of a GenerateContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGenerateContentRequest
                         * @property {string|null} [model] GenerateContentRequest model
                         * @property {google.ai.generativelanguage.v1alpha.IContent|null} [systemInstruction] GenerateContentRequest systemInstruction
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IContent>|null} [contents] GenerateContentRequest contents
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ITool>|null} [tools] GenerateContentRequest tools
                         * @property {google.ai.generativelanguage.v1alpha.IToolConfig|null} [toolConfig] GenerateContentRequest toolConfig
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ISafetySetting>|null} [safetySettings] GenerateContentRequest safetySettings
                         * @property {google.ai.generativelanguage.v1alpha.IGenerationConfig|null} [generationConfig] GenerateContentRequest generationConfig
                         * @property {string|null} [cachedContent] GenerateContentRequest cachedContent
                         */
    
                        /**
                         * Constructs a new GenerateContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GenerateContentRequest.
                         * @implements IGenerateContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest=} [properties] Properties to set
                         */
                        function GenerateContentRequest(properties) {
                            this.contents = [];
                            this.tools = [];
                            this.safetySettings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateContentRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.model = "";
    
                        /**
                         * GenerateContentRequest systemInstruction.
                         * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} systemInstruction
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.systemInstruction = null;
    
                        /**
                         * GenerateContentRequest contents.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IContent>} contents
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.contents = $util.emptyArray;
    
                        /**
                         * GenerateContentRequest tools.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ITool>} tools
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.tools = $util.emptyArray;
    
                        /**
                         * GenerateContentRequest toolConfig.
                         * @member {google.ai.generativelanguage.v1alpha.IToolConfig|null|undefined} toolConfig
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.toolConfig = null;
    
                        /**
                         * GenerateContentRequest safetySettings.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ISafetySetting>} safetySettings
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.safetySettings = $util.emptyArray;
    
                        /**
                         * GenerateContentRequest generationConfig.
                         * @member {google.ai.generativelanguage.v1alpha.IGenerationConfig|null|undefined} generationConfig
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.generationConfig = null;
    
                        /**
                         * GenerateContentRequest cachedContent.
                         * @member {string|null|undefined} cachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.cachedContent = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateContentRequest _systemInstruction.
                         * @member {"systemInstruction"|undefined} _systemInstruction
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateContentRequest.prototype, "_systemInstruction", {
                            get: $util.oneOfGetter($oneOfFields = ["systemInstruction"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateContentRequest _generationConfig.
                         * @member {"generationConfig"|undefined} _generationConfig
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateContentRequest.prototype, "_generationConfig", {
                            get: $util.oneOfGetter($oneOfFields = ["generationConfig"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateContentRequest _cachedContent.
                         * @member {"cachedContent"|undefined} _cachedContent
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateContentRequest.prototype, "_cachedContent", {
                            get: $util.oneOfGetter($oneOfFields = ["cachedContent"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateContentRequest} GenerateContentRequest instance
                         */
                        GenerateContentRequest.create = function create(properties) {
                            return new GenerateContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.contents != null && message.contents.length)
                                for (var i = 0; i < message.contents.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.safetySettings != null && message.safetySettings.length)
                                for (var i = 0; i < message.safetySettings.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.generationConfig != null && Object.hasOwnProperty.call(message, "generationConfig"))
                                $root.google.ai.generativelanguage.v1alpha.GenerationConfig.encode(message.generationConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.tools != null && message.tools.length)
                                for (var i = 0; i < message.tools.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Tool.encode(message.tools[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.toolConfig != null && Object.hasOwnProperty.call(message, "toolConfig"))
                                $root.google.ai.generativelanguage.v1alpha.ToolConfig.encode(message.toolConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                            if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction"))
                                $root.google.ai.generativelanguage.v1alpha.Content.encode(message.systemInstruction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.cachedContent != null && Object.hasOwnProperty.call(message, "cachedContent"))
                                writer.uint32(/* id 9, wireType 2 =*/74).string(message.cachedContent);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateContentRequest} GenerateContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 8: {
                                        message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        if (!(message.contents && message.contents.length))
                                            message.contents = [];
                                        message.contents.push($root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 5: {
                                        if (!(message.tools && message.tools.length))
                                            message.tools = [];
                                        message.tools.push($root.google.ai.generativelanguage.v1alpha.Tool.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 7: {
                                        message.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.safetySettings && message.safetySettings.length))
                                            message.safetySettings = [];
                                        message.safetySettings.push($root.google.ai.generativelanguage.v1alpha.SafetySetting.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 9: {
                                        message.cachedContent = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateContentRequest} GenerateContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) {
                                properties._systemInstruction = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.systemInstruction);
                                    if (error)
                                        return "systemInstruction." + error;
                                }
                            }
                            if (message.contents != null && message.hasOwnProperty("contents")) {
                                if (!Array.isArray(message.contents))
                                    return "contents: array expected";
                                for (var i = 0; i < message.contents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.contents[i]);
                                    if (error)
                                        return "contents." + error;
                                }
                            }
                            if (message.tools != null && message.hasOwnProperty("tools")) {
                                if (!Array.isArray(message.tools))
                                    return "tools: array expected";
                                for (var i = 0; i < message.tools.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Tool.verify(message.tools[i]);
                                    if (error)
                                        return "tools." + error;
                                }
                            }
                            if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.ToolConfig.verify(message.toolConfig);
                                if (error)
                                    return "toolConfig." + error;
                            }
                            if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) {
                                if (!Array.isArray(message.safetySettings))
                                    return "safetySettings: array expected";
                                for (var i = 0; i < message.safetySettings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.SafetySetting.verify(message.safetySettings[i]);
                                    if (error)
                                        return "safetySettings." + error;
                                }
                            }
                            if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) {
                                properties._generationConfig = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.verify(message.generationConfig);
                                    if (error)
                                        return "generationConfig." + error;
                                }
                            }
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) {
                                properties._cachedContent = 1;
                                if (!$util.isString(message.cachedContent))
                                    return "cachedContent: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateContentRequest} GenerateContentRequest
                         */
                        GenerateContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.systemInstruction != null) {
                                if (typeof object.systemInstruction !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.systemInstruction: object expected");
                                message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.systemInstruction);
                            }
                            if (object.contents) {
                                if (!Array.isArray(object.contents))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.contents: array expected");
                                message.contents = [];
                                for (var i = 0; i < object.contents.length; ++i) {
                                    if (typeof object.contents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.contents: object expected");
                                    message.contents[i] = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.contents[i]);
                                }
                            }
                            if (object.tools) {
                                if (!Array.isArray(object.tools))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.tools: array expected");
                                message.tools = [];
                                for (var i = 0; i < object.tools.length; ++i) {
                                    if (typeof object.tools[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.tools: object expected");
                                    message.tools[i] = $root.google.ai.generativelanguage.v1alpha.Tool.fromObject(object.tools[i]);
                                }
                            }
                            if (object.toolConfig != null) {
                                if (typeof object.toolConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.toolConfig: object expected");
                                message.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.fromObject(object.toolConfig);
                            }
                            if (object.safetySettings) {
                                if (!Array.isArray(object.safetySettings))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.safetySettings: array expected");
                                message.safetySettings = [];
                                for (var i = 0; i < object.safetySettings.length; ++i) {
                                    if (typeof object.safetySettings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.safetySettings: object expected");
                                    message.safetySettings[i] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.fromObject(object.safetySettings[i]);
                                }
                            }
                            if (object.generationConfig != null) {
                                if (typeof object.generationConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.generationConfig: object expected");
                                message.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.fromObject(object.generationConfig);
                            }
                            if (object.cachedContent != null)
                                message.cachedContent = String(object.cachedContent);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GenerateContentRequest} message GenerateContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.contents = [];
                                object.safetySettings = [];
                                object.tools = [];
                            }
                            if (options.defaults) {
                                object.model = "";
                                object.toolConfig = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.contents && message.contents.length) {
                                object.contents = [];
                                for (var j = 0; j < message.contents.length; ++j)
                                    object.contents[j] = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.contents[j], options);
                            }
                            if (message.safetySettings && message.safetySettings.length) {
                                object.safetySettings = [];
                                for (var j = 0; j < message.safetySettings.length; ++j)
                                    object.safetySettings[j] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.toObject(message.safetySettings[j], options);
                            }
                            if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) {
                                object.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.toObject(message.generationConfig, options);
                                if (options.oneofs)
                                    object._generationConfig = "generationConfig";
                            }
                            if (message.tools && message.tools.length) {
                                object.tools = [];
                                for (var j = 0; j < message.tools.length; ++j)
                                    object.tools[j] = $root.google.ai.generativelanguage.v1alpha.Tool.toObject(message.tools[j], options);
                            }
                            if (message.toolConfig != null && message.hasOwnProperty("toolConfig"))
                                object.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.toObject(message.toolConfig, options);
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) {
                                object.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.systemInstruction, options);
                                if (options.oneofs)
                                    object._systemInstruction = "systemInstruction";
                            }
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) {
                                object.cachedContent = message.cachedContent;
                                if (options.oneofs)
                                    object._cachedContent = "cachedContent";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateContentRequest";
                        };
    
                        return GenerateContentRequest;
                    })();
    
                    v1alpha.PrebuiltVoiceConfig = (function() {
    
                        /**
                         * Properties of a PrebuiltVoiceConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IPrebuiltVoiceConfig
                         * @property {string|null} [voiceName] PrebuiltVoiceConfig voiceName
                         */
    
                        /**
                         * Constructs a new PrebuiltVoiceConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a PrebuiltVoiceConfig.
                         * @implements IPrebuiltVoiceConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig=} [properties] Properties to set
                         */
                        function PrebuiltVoiceConfig(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * PrebuiltVoiceConfig voiceName.
                         * @member {string|null|undefined} voiceName
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @instance
                         */
                        PrebuiltVoiceConfig.prototype.voiceName = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * PrebuiltVoiceConfig _voiceName.
                         * @member {"voiceName"|undefined} _voiceName
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @instance
                         */
                        Object.defineProperty(PrebuiltVoiceConfig.prototype, "_voiceName", {
                            get: $util.oneOfGetter($oneOfFields = ["voiceName"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new PrebuiltVoiceConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig} PrebuiltVoiceConfig instance
                         */
                        PrebuiltVoiceConfig.create = function create(properties) {
                            return new PrebuiltVoiceConfig(properties);
                        };
    
                        /**
                         * Encodes the specified PrebuiltVoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig} message PrebuiltVoiceConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PrebuiltVoiceConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.voiceName != null && Object.hasOwnProperty.call(message, "voiceName"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.voiceName);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified PrebuiltVoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig} message PrebuiltVoiceConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PrebuiltVoiceConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig} PrebuiltVoiceConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PrebuiltVoiceConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.voiceName = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig} PrebuiltVoiceConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PrebuiltVoiceConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a PrebuiltVoiceConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        PrebuiltVoiceConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.voiceName != null && message.hasOwnProperty("voiceName")) {
                                properties._voiceName = 1;
                                if (!$util.isString(message.voiceName))
                                    return "voiceName: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a PrebuiltVoiceConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig} PrebuiltVoiceConfig
                         */
                        PrebuiltVoiceConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig();
                            if (object.voiceName != null)
                                message.voiceName = String(object.voiceName);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a PrebuiltVoiceConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig} message PrebuiltVoiceConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        PrebuiltVoiceConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.voiceName != null && message.hasOwnProperty("voiceName")) {
                                object.voiceName = message.voiceName;
                                if (options.oneofs)
                                    object._voiceName = "voiceName";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this PrebuiltVoiceConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        PrebuiltVoiceConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for PrebuiltVoiceConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        PrebuiltVoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig";
                        };
    
                        return PrebuiltVoiceConfig;
                    })();
    
                    v1alpha.VoiceConfig = (function() {
    
                        /**
                         * Properties of a VoiceConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IVoiceConfig
                         * @property {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig|null} [prebuiltVoiceConfig] VoiceConfig prebuiltVoiceConfig
                         */
    
                        /**
                         * Constructs a new VoiceConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a VoiceConfig.
                         * @implements IVoiceConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IVoiceConfig=} [properties] Properties to set
                         */
                        function VoiceConfig(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * VoiceConfig prebuiltVoiceConfig.
                         * @member {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig|null|undefined} prebuiltVoiceConfig
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @instance
                         */
                        VoiceConfig.prototype.prebuiltVoiceConfig = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * VoiceConfig voiceConfig.
                         * @member {"prebuiltVoiceConfig"|undefined} voiceConfig
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @instance
                         */
                        Object.defineProperty(VoiceConfig.prototype, "voiceConfig", {
                            get: $util.oneOfGetter($oneOfFields = ["prebuiltVoiceConfig"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new VoiceConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IVoiceConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.VoiceConfig} VoiceConfig instance
                         */
                        VoiceConfig.create = function create(properties) {
                            return new VoiceConfig(properties);
                        };
    
                        /**
                         * Encodes the specified VoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VoiceConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IVoiceConfig} message VoiceConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        VoiceConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.prebuiltVoiceConfig != null && Object.hasOwnProperty.call(message, "prebuiltVoiceConfig"))
                                $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.encode(message.prebuiltVoiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified VoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VoiceConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IVoiceConfig} message VoiceConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        VoiceConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a VoiceConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.VoiceConfig} VoiceConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        VoiceConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.VoiceConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a VoiceConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.VoiceConfig} VoiceConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        VoiceConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a VoiceConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        VoiceConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.prebuiltVoiceConfig != null && message.hasOwnProperty("prebuiltVoiceConfig")) {
                                properties.voiceConfig = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.verify(message.prebuiltVoiceConfig);
                                    if (error)
                                        return "prebuiltVoiceConfig." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a VoiceConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.VoiceConfig} VoiceConfig
                         */
                        VoiceConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.VoiceConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.VoiceConfig();
                            if (object.prebuiltVoiceConfig != null) {
                                if (typeof object.prebuiltVoiceConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.VoiceConfig.prebuiltVoiceConfig: object expected");
                                message.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.fromObject(object.prebuiltVoiceConfig);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a VoiceConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.VoiceConfig} message VoiceConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        VoiceConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.prebuiltVoiceConfig != null && message.hasOwnProperty("prebuiltVoiceConfig")) {
                                object.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.toObject(message.prebuiltVoiceConfig, options);
                                if (options.oneofs)
                                    object.voiceConfig = "prebuiltVoiceConfig";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this VoiceConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        VoiceConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for VoiceConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        VoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.VoiceConfig";
                        };
    
                        return VoiceConfig;
                    })();
    
                    v1alpha.SpeechConfig = (function() {
    
                        /**
                         * Properties of a SpeechConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ISpeechConfig
                         * @property {google.ai.generativelanguage.v1alpha.IVoiceConfig|null} [voiceConfig] SpeechConfig voiceConfig
                         */
    
                        /**
                         * Constructs a new SpeechConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a SpeechConfig.
                         * @implements ISpeechConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ISpeechConfig=} [properties] Properties to set
                         */
                        function SpeechConfig(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SpeechConfig voiceConfig.
                         * @member {google.ai.generativelanguage.v1alpha.IVoiceConfig|null|undefined} voiceConfig
                         * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig
                         * @instance
                         */
                        SpeechConfig.prototype.voiceConfig = null;
    
                        /**
                         * Creates a new SpeechConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISpeechConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.SpeechConfig} SpeechConfig instance
                         */
                        SpeechConfig.create = function create(properties) {
                            return new SpeechConfig(properties);
                        };
    
                        /**
                         * Encodes the specified SpeechConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SpeechConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISpeechConfig} message SpeechConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SpeechConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.voiceConfig != null && Object.hasOwnProperty.call(message, "voiceConfig"))
                                $root.google.ai.generativelanguage.v1alpha.VoiceConfig.encode(message.voiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SpeechConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISpeechConfig} message SpeechConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SpeechConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SpeechConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.SpeechConfig} SpeechConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SpeechConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.SpeechConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.voiceConfig = $root.google.ai.generativelanguage.v1alpha.VoiceConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SpeechConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.SpeechConfig} SpeechConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SpeechConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SpeechConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SpeechConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.VoiceConfig.verify(message.voiceConfig);
                                if (error)
                                    return "voiceConfig." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.SpeechConfig} SpeechConfig
                         */
                        SpeechConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.SpeechConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.SpeechConfig();
                            if (object.voiceConfig != null) {
                                if (typeof object.voiceConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.SpeechConfig.voiceConfig: object expected");
                                message.voiceConfig = $root.google.ai.generativelanguage.v1alpha.VoiceConfig.fromObject(object.voiceConfig);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.SpeechConfig} message SpeechConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SpeechConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.voiceConfig = null;
                            if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig"))
                                object.voiceConfig = $root.google.ai.generativelanguage.v1alpha.VoiceConfig.toObject(message.voiceConfig, options);
                            return object;
                        };
    
                        /**
                         * Converts this SpeechConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SpeechConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SpeechConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SpeechConfig";
                        };
    
                        return SpeechConfig;
                    })();
    
                    v1alpha.GenerationConfig = (function() {
    
                        /**
                         * Properties of a GenerationConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGenerationConfig
                         * @property {number|null} [candidateCount] GenerationConfig candidateCount
                         * @property {Array.<string>|null} [stopSequences] GenerationConfig stopSequences
                         * @property {number|null} [maxOutputTokens] GenerationConfig maxOutputTokens
                         * @property {number|null} [temperature] GenerationConfig temperature
                         * @property {number|null} [topP] GenerationConfig topP
                         * @property {number|null} [topK] GenerationConfig topK
                         * @property {string|null} [responseMimeType] GenerationConfig responseMimeType
                         * @property {google.ai.generativelanguage.v1alpha.ISchema|null} [responseSchema] GenerationConfig responseSchema
                         * @property {number|null} [presencePenalty] GenerationConfig presencePenalty
                         * @property {number|null} [frequencyPenalty] GenerationConfig frequencyPenalty
                         * @property {boolean|null} [responseLogprobs] GenerationConfig responseLogprobs
                         * @property {number|null} [logprobs] GenerationConfig logprobs
                         * @property {boolean|null} [enableEnhancedCivicAnswers] GenerationConfig enableEnhancedCivicAnswers
                         * @property {Array.<google.ai.generativelanguage.v1alpha.GenerationConfig.Modality>|null} [responseModalities] GenerationConfig responseModalities
                         * @property {google.ai.generativelanguage.v1alpha.ISpeechConfig|null} [speechConfig] GenerationConfig speechConfig
                         */
    
                        /**
                         * Constructs a new GenerationConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GenerationConfig.
                         * @implements IGenerationConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGenerationConfig=} [properties] Properties to set
                         */
                        function GenerationConfig(properties) {
                            this.stopSequences = [];
                            this.responseModalities = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerationConfig candidateCount.
                         * @member {number|null|undefined} candidateCount
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.candidateCount = null;
    
                        /**
                         * GenerationConfig stopSequences.
                         * @member {Array.<string>} stopSequences
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.stopSequences = $util.emptyArray;
    
                        /**
                         * GenerationConfig maxOutputTokens.
                         * @member {number|null|undefined} maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.maxOutputTokens = null;
    
                        /**
                         * GenerationConfig temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.temperature = null;
    
                        /**
                         * GenerationConfig topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.topP = null;
    
                        /**
                         * GenerationConfig topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.topK = null;
    
                        /**
                         * GenerationConfig responseMimeType.
                         * @member {string} responseMimeType
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.responseMimeType = "";
    
                        /**
                         * GenerationConfig responseSchema.
                         * @member {google.ai.generativelanguage.v1alpha.ISchema|null|undefined} responseSchema
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.responseSchema = null;
    
                        /**
                         * GenerationConfig presencePenalty.
                         * @member {number|null|undefined} presencePenalty
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.presencePenalty = null;
    
                        /**
                         * GenerationConfig frequencyPenalty.
                         * @member {number|null|undefined} frequencyPenalty
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.frequencyPenalty = null;
    
                        /**
                         * GenerationConfig responseLogprobs.
                         * @member {boolean|null|undefined} responseLogprobs
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.responseLogprobs = null;
    
                        /**
                         * GenerationConfig logprobs.
                         * @member {number|null|undefined} logprobs
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.logprobs = null;
    
                        /**
                         * GenerationConfig enableEnhancedCivicAnswers.
                         * @member {boolean|null|undefined} enableEnhancedCivicAnswers
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.enableEnhancedCivicAnswers = null;
    
                        /**
                         * GenerationConfig responseModalities.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.GenerationConfig.Modality>} responseModalities
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.responseModalities = $util.emptyArray;
    
                        /**
                         * GenerationConfig speechConfig.
                         * @member {google.ai.generativelanguage.v1alpha.ISpeechConfig|null|undefined} speechConfig
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.speechConfig = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerationConfig _candidateCount.
                         * @member {"candidateCount"|undefined} _candidateCount
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_candidateCount", {
                            get: $util.oneOfGetter($oneOfFields = ["candidateCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _maxOutputTokens.
                         * @member {"maxOutputTokens"|undefined} _maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_maxOutputTokens", {
                            get: $util.oneOfGetter($oneOfFields = ["maxOutputTokens"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _presencePenalty.
                         * @member {"presencePenalty"|undefined} _presencePenalty
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_presencePenalty", {
                            get: $util.oneOfGetter($oneOfFields = ["presencePenalty"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _frequencyPenalty.
                         * @member {"frequencyPenalty"|undefined} _frequencyPenalty
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_frequencyPenalty", {
                            get: $util.oneOfGetter($oneOfFields = ["frequencyPenalty"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _responseLogprobs.
                         * @member {"responseLogprobs"|undefined} _responseLogprobs
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_responseLogprobs", {
                            get: $util.oneOfGetter($oneOfFields = ["responseLogprobs"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _logprobs.
                         * @member {"logprobs"|undefined} _logprobs
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_logprobs", {
                            get: $util.oneOfGetter($oneOfFields = ["logprobs"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _enableEnhancedCivicAnswers.
                         * @member {"enableEnhancedCivicAnswers"|undefined} _enableEnhancedCivicAnswers
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_enableEnhancedCivicAnswers", {
                            get: $util.oneOfGetter($oneOfFields = ["enableEnhancedCivicAnswers"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _speechConfig.
                         * @member {"speechConfig"|undefined} _speechConfig
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_speechConfig", {
                            get: $util.oneOfGetter($oneOfFields = ["speechConfig"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerationConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerationConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GenerationConfig} GenerationConfig instance
                         */
                        GenerationConfig.create = function create(properties) {
                            return new GenerationConfig(properties);
                        };
    
                        /**
                         * Encodes the specified GenerationConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerationConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerationConfig} message GenerationConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerationConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.candidateCount);
                            if (message.stopSequences != null && message.stopSequences.length)
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.stopSequences[i]);
                            if (message.maxOutputTokens != null && Object.hasOwnProperty.call(message, "maxOutputTokens"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxOutputTokens);
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 5, wireType 5 =*/45).float(message.temperature);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 6, wireType 5 =*/53).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.topK);
                            if (message.responseMimeType != null && Object.hasOwnProperty.call(message, "responseMimeType"))
                                writer.uint32(/* id 13, wireType 2 =*/106).string(message.responseMimeType);
                            if (message.responseSchema != null && Object.hasOwnProperty.call(message, "responseSchema"))
                                $root.google.ai.generativelanguage.v1alpha.Schema.encode(message.responseSchema, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
                            if (message.presencePenalty != null && Object.hasOwnProperty.call(message, "presencePenalty"))
                                writer.uint32(/* id 15, wireType 5 =*/125).float(message.presencePenalty);
                            if (message.frequencyPenalty != null && Object.hasOwnProperty.call(message, "frequencyPenalty"))
                                writer.uint32(/* id 16, wireType 5 =*/133).float(message.frequencyPenalty);
                            if (message.responseLogprobs != null && Object.hasOwnProperty.call(message, "responseLogprobs"))
                                writer.uint32(/* id 17, wireType 0 =*/136).bool(message.responseLogprobs);
                            if (message.logprobs != null && Object.hasOwnProperty.call(message, "logprobs"))
                                writer.uint32(/* id 18, wireType 0 =*/144).int32(message.logprobs);
                            if (message.enableEnhancedCivicAnswers != null && Object.hasOwnProperty.call(message, "enableEnhancedCivicAnswers"))
                                writer.uint32(/* id 19, wireType 0 =*/152).bool(message.enableEnhancedCivicAnswers);
                            if (message.responseModalities != null && message.responseModalities.length) {
                                writer.uint32(/* id 20, wireType 2 =*/162).fork();
                                for (var i = 0; i < message.responseModalities.length; ++i)
                                    writer.int32(message.responseModalities[i]);
                                writer.ldelim();
                            }
                            if (message.speechConfig != null && Object.hasOwnProperty.call(message, "speechConfig"))
                                $root.google.ai.generativelanguage.v1alpha.SpeechConfig.encode(message.speechConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerationConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerationConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerationConfig} message GenerationConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerationConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerationConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GenerationConfig} GenerationConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerationConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerationConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.candidateCount = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.stopSequences && message.stopSequences.length))
                                            message.stopSequences = [];
                                        message.stopSequences.push(reader.string());
                                        break;
                                    }
                                case 4: {
                                        message.maxOutputTokens = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 6: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 7: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                case 13: {
                                        message.responseMimeType = reader.string();
                                        break;
                                    }
                                case 14: {
                                        message.responseSchema = $root.google.ai.generativelanguage.v1alpha.Schema.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 15: {
                                        message.presencePenalty = reader.float();
                                        break;
                                    }
                                case 16: {
                                        message.frequencyPenalty = reader.float();
                                        break;
                                    }
                                case 17: {
                                        message.responseLogprobs = reader.bool();
                                        break;
                                    }
                                case 18: {
                                        message.logprobs = reader.int32();
                                        break;
                                    }
                                case 19: {
                                        message.enableEnhancedCivicAnswers = reader.bool();
                                        break;
                                    }
                                case 20: {
                                        if (!(message.responseModalities && message.responseModalities.length))
                                            message.responseModalities = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.responseModalities.push(reader.int32());
                                        } else
                                            message.responseModalities.push(reader.int32());
                                        break;
                                    }
                                case 21: {
                                        message.speechConfig = $root.google.ai.generativelanguage.v1alpha.SpeechConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerationConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GenerationConfig} GenerationConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerationConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerationConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerationConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                properties._candidateCount = 1;
                                if (!$util.isInteger(message.candidateCount))
                                    return "candidateCount: integer expected";
                            }
                            if (message.stopSequences != null && message.hasOwnProperty("stopSequences")) {
                                if (!Array.isArray(message.stopSequences))
                                    return "stopSequences: array expected";
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    if (!$util.isString(message.stopSequences[i]))
                                        return "stopSequences: string[] expected";
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                properties._maxOutputTokens = 1;
                                if (!$util.isInteger(message.maxOutputTokens))
                                    return "maxOutputTokens: integer expected";
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            if (message.responseMimeType != null && message.hasOwnProperty("responseMimeType"))
                                if (!$util.isString(message.responseMimeType))
                                    return "responseMimeType: string expected";
                            if (message.responseSchema != null && message.hasOwnProperty("responseSchema")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Schema.verify(message.responseSchema);
                                if (error)
                                    return "responseSchema." + error;
                            }
                            if (message.presencePenalty != null && message.hasOwnProperty("presencePenalty")) {
                                properties._presencePenalty = 1;
                                if (typeof message.presencePenalty !== "number")
                                    return "presencePenalty: number expected";
                            }
                            if (message.frequencyPenalty != null && message.hasOwnProperty("frequencyPenalty")) {
                                properties._frequencyPenalty = 1;
                                if (typeof message.frequencyPenalty !== "number")
                                    return "frequencyPenalty: number expected";
                            }
                            if (message.responseLogprobs != null && message.hasOwnProperty("responseLogprobs")) {
                                properties._responseLogprobs = 1;
                                if (typeof message.responseLogprobs !== "boolean")
                                    return "responseLogprobs: boolean expected";
                            }
                            if (message.logprobs != null && message.hasOwnProperty("logprobs")) {
                                properties._logprobs = 1;
                                if (!$util.isInteger(message.logprobs))
                                    return "logprobs: integer expected";
                            }
                            if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) {
                                properties._enableEnhancedCivicAnswers = 1;
                                if (typeof message.enableEnhancedCivicAnswers !== "boolean")
                                    return "enableEnhancedCivicAnswers: boolean expected";
                            }
                            if (message.responseModalities != null && message.hasOwnProperty("responseModalities")) {
                                if (!Array.isArray(message.responseModalities))
                                    return "responseModalities: array expected";
                                for (var i = 0; i < message.responseModalities.length; ++i)
                                    switch (message.responseModalities[i]) {
                                    default:
                                        return "responseModalities: enum value[] expected";
                                    case 0:
                                    case 1:
                                    case 2:
                                    case 3:
                                        break;
                                    }
                            }
                            if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) {
                                properties._speechConfig = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.SpeechConfig.verify(message.speechConfig);
                                    if (error)
                                        return "speechConfig." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerationConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GenerationConfig} GenerationConfig
                         */
                        GenerationConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerationConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GenerationConfig();
                            if (object.candidateCount != null)
                                message.candidateCount = object.candidateCount | 0;
                            if (object.stopSequences) {
                                if (!Array.isArray(object.stopSequences))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerationConfig.stopSequences: array expected");
                                message.stopSequences = [];
                                for (var i = 0; i < object.stopSequences.length; ++i)
                                    message.stopSequences[i] = String(object.stopSequences[i]);
                            }
                            if (object.maxOutputTokens != null)
                                message.maxOutputTokens = object.maxOutputTokens | 0;
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            if (object.responseMimeType != null)
                                message.responseMimeType = String(object.responseMimeType);
                            if (object.responseSchema != null) {
                                if (typeof object.responseSchema !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerationConfig.responseSchema: object expected");
                                message.responseSchema = $root.google.ai.generativelanguage.v1alpha.Schema.fromObject(object.responseSchema);
                            }
                            if (object.presencePenalty != null)
                                message.presencePenalty = Number(object.presencePenalty);
                            if (object.frequencyPenalty != null)
                                message.frequencyPenalty = Number(object.frequencyPenalty);
                            if (object.responseLogprobs != null)
                                message.responseLogprobs = Boolean(object.responseLogprobs);
                            if (object.logprobs != null)
                                message.logprobs = object.logprobs | 0;
                            if (object.enableEnhancedCivicAnswers != null)
                                message.enableEnhancedCivicAnswers = Boolean(object.enableEnhancedCivicAnswers);
                            if (object.responseModalities) {
                                if (!Array.isArray(object.responseModalities))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerationConfig.responseModalities: array expected");
                                message.responseModalities = [];
                                for (var i = 0; i < object.responseModalities.length; ++i)
                                    switch (object.responseModalities[i]) {
                                    default:
                                        if (typeof object.responseModalities[i] === "number") {
                                            message.responseModalities[i] = object.responseModalities[i];
                                            break;
                                        }
                                    case "MODALITY_UNSPECIFIED":
                                    case 0:
                                        message.responseModalities[i] = 0;
                                        break;
                                    case "TEXT":
                                    case 1:
                                        message.responseModalities[i] = 1;
                                        break;
                                    case "IMAGE":
                                    case 2:
                                        message.responseModalities[i] = 2;
                                        break;
                                    case "AUDIO":
                                    case 3:
                                        message.responseModalities[i] = 3;
                                        break;
                                    }
                            }
                            if (object.speechConfig != null) {
                                if (typeof object.speechConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerationConfig.speechConfig: object expected");
                                message.speechConfig = $root.google.ai.generativelanguage.v1alpha.SpeechConfig.fromObject(object.speechConfig);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerationConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GenerationConfig} message GenerationConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerationConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.stopSequences = [];
                                object.responseModalities = [];
                            }
                            if (options.defaults) {
                                object.responseMimeType = "";
                                object.responseSchema = null;
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                object.candidateCount = message.candidateCount;
                                if (options.oneofs)
                                    object._candidateCount = "candidateCount";
                            }
                            if (message.stopSequences && message.stopSequences.length) {
                                object.stopSequences = [];
                                for (var j = 0; j < message.stopSequences.length; ++j)
                                    object.stopSequences[j] = message.stopSequences[j];
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                object.maxOutputTokens = message.maxOutputTokens;
                                if (options.oneofs)
                                    object._maxOutputTokens = "maxOutputTokens";
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.responseMimeType != null && message.hasOwnProperty("responseMimeType"))
                                object.responseMimeType = message.responseMimeType;
                            if (message.responseSchema != null && message.hasOwnProperty("responseSchema"))
                                object.responseSchema = $root.google.ai.generativelanguage.v1alpha.Schema.toObject(message.responseSchema, options);
                            if (message.presencePenalty != null && message.hasOwnProperty("presencePenalty")) {
                                object.presencePenalty = options.json && !isFinite(message.presencePenalty) ? String(message.presencePenalty) : message.presencePenalty;
                                if (options.oneofs)
                                    object._presencePenalty = "presencePenalty";
                            }
                            if (message.frequencyPenalty != null && message.hasOwnProperty("frequencyPenalty")) {
                                object.frequencyPenalty = options.json && !isFinite(message.frequencyPenalty) ? String(message.frequencyPenalty) : message.frequencyPenalty;
                                if (options.oneofs)
                                    object._frequencyPenalty = "frequencyPenalty";
                            }
                            if (message.responseLogprobs != null && message.hasOwnProperty("responseLogprobs")) {
                                object.responseLogprobs = message.responseLogprobs;
                                if (options.oneofs)
                                    object._responseLogprobs = "responseLogprobs";
                            }
                            if (message.logprobs != null && message.hasOwnProperty("logprobs")) {
                                object.logprobs = message.logprobs;
                                if (options.oneofs)
                                    object._logprobs = "logprobs";
                            }
                            if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) {
                                object.enableEnhancedCivicAnswers = message.enableEnhancedCivicAnswers;
                                if (options.oneofs)
                                    object._enableEnhancedCivicAnswers = "enableEnhancedCivicAnswers";
                            }
                            if (message.responseModalities && message.responseModalities.length) {
                                object.responseModalities = [];
                                for (var j = 0; j < message.responseModalities.length; ++j)
                                    object.responseModalities[j] = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.GenerationConfig.Modality[message.responseModalities[j]] === undefined ? message.responseModalities[j] : $root.google.ai.generativelanguage.v1alpha.GenerationConfig.Modality[message.responseModalities[j]] : message.responseModalities[j];
                            }
                            if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) {
                                object.speechConfig = $root.google.ai.generativelanguage.v1alpha.SpeechConfig.toObject(message.speechConfig, options);
                                if (options.oneofs)
                                    object._speechConfig = "speechConfig";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerationConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerationConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerationConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerationConfig";
                        };
    
                        /**
                         * Modality enum.
                         * @name google.ai.generativelanguage.v1alpha.GenerationConfig.Modality
                         * @enum {number}
                         * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value
                         * @property {number} TEXT=1 TEXT value
                         * @property {number} IMAGE=2 IMAGE value
                         * @property {number} AUDIO=3 AUDIO value
                         */
                        GenerationConfig.Modality = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "TEXT"] = 1;
                            values[valuesById[2] = "IMAGE"] = 2;
                            values[valuesById[3] = "AUDIO"] = 3;
                            return values;
                        })();
    
                        return GenerationConfig;
                    })();
    
                    v1alpha.SemanticRetrieverConfig = (function() {
    
                        /**
                         * Properties of a SemanticRetrieverConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ISemanticRetrieverConfig
                         * @property {string|null} [source] SemanticRetrieverConfig source
                         * @property {google.ai.generativelanguage.v1alpha.IContent|null} [query] SemanticRetrieverConfig query
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IMetadataFilter>|null} [metadataFilters] SemanticRetrieverConfig metadataFilters
                         * @property {number|null} [maxChunksCount] SemanticRetrieverConfig maxChunksCount
                         * @property {number|null} [minimumRelevanceScore] SemanticRetrieverConfig minimumRelevanceScore
                         */
    
                        /**
                         * Constructs a new SemanticRetrieverConfig.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a SemanticRetrieverConfig.
                         * @implements ISemanticRetrieverConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig=} [properties] Properties to set
                         */
                        function SemanticRetrieverConfig(properties) {
                            this.metadataFilters = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SemanticRetrieverConfig source.
                         * @member {string} source
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @instance
                         */
                        SemanticRetrieverConfig.prototype.source = "";
    
                        /**
                         * SemanticRetrieverConfig query.
                         * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} query
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @instance
                         */
                        SemanticRetrieverConfig.prototype.query = null;
    
                        /**
                         * SemanticRetrieverConfig metadataFilters.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IMetadataFilter>} metadataFilters
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @instance
                         */
                        SemanticRetrieverConfig.prototype.metadataFilters = $util.emptyArray;
    
                        /**
                         * SemanticRetrieverConfig maxChunksCount.
                         * @member {number|null|undefined} maxChunksCount
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @instance
                         */
                        SemanticRetrieverConfig.prototype.maxChunksCount = null;
    
                        /**
                         * SemanticRetrieverConfig minimumRelevanceScore.
                         * @member {number|null|undefined} minimumRelevanceScore
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @instance
                         */
                        SemanticRetrieverConfig.prototype.minimumRelevanceScore = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * SemanticRetrieverConfig _maxChunksCount.
                         * @member {"maxChunksCount"|undefined} _maxChunksCount
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @instance
                         */
                        Object.defineProperty(SemanticRetrieverConfig.prototype, "_maxChunksCount", {
                            get: $util.oneOfGetter($oneOfFields = ["maxChunksCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * SemanticRetrieverConfig _minimumRelevanceScore.
                         * @member {"minimumRelevanceScore"|undefined} _minimumRelevanceScore
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @instance
                         */
                        Object.defineProperty(SemanticRetrieverConfig.prototype, "_minimumRelevanceScore", {
                            get: $util.oneOfGetter($oneOfFields = ["minimumRelevanceScore"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new SemanticRetrieverConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig} SemanticRetrieverConfig instance
                         */
                        SemanticRetrieverConfig.create = function create(properties) {
                            return new SemanticRetrieverConfig(properties);
                        };
    
                        /**
                         * Encodes the specified SemanticRetrieverConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig} message SemanticRetrieverConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SemanticRetrieverConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.source != null && Object.hasOwnProperty.call(message, "source"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.source);
                            if (message.query != null && Object.hasOwnProperty.call(message, "query"))
                                $root.google.ai.generativelanguage.v1alpha.Content.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.metadataFilters != null && message.metadataFilters.length)
                                for (var i = 0; i < message.metadataFilters.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.MetadataFilter.encode(message.metadataFilters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.maxChunksCount != null && Object.hasOwnProperty.call(message, "maxChunksCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxChunksCount);
                            if (message.minimumRelevanceScore != null && Object.hasOwnProperty.call(message, "minimumRelevanceScore"))
                                writer.uint32(/* id 5, wireType 5 =*/45).float(message.minimumRelevanceScore);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SemanticRetrieverConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig} message SemanticRetrieverConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SemanticRetrieverConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SemanticRetrieverConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig} SemanticRetrieverConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SemanticRetrieverConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.source = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.query = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.metadataFilters && message.metadataFilters.length))
                                            message.metadataFilters = [];
                                        message.metadataFilters.push($root.google.ai.generativelanguage.v1alpha.MetadataFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.maxChunksCount = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.minimumRelevanceScore = reader.float();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SemanticRetrieverConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig} SemanticRetrieverConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SemanticRetrieverConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SemanticRetrieverConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SemanticRetrieverConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.source != null && message.hasOwnProperty("source"))
                                if (!$util.isString(message.source))
                                    return "source: string expected";
                            if (message.query != null && message.hasOwnProperty("query")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.query);
                                if (error)
                                    return "query." + error;
                            }
                            if (message.metadataFilters != null && message.hasOwnProperty("metadataFilters")) {
                                if (!Array.isArray(message.metadataFilters))
                                    return "metadataFilters: array expected";
                                for (var i = 0; i < message.metadataFilters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.verify(message.metadataFilters[i]);
                                    if (error)
                                        return "metadataFilters." + error;
                                }
                            }
                            if (message.maxChunksCount != null && message.hasOwnProperty("maxChunksCount")) {
                                properties._maxChunksCount = 1;
                                if (!$util.isInteger(message.maxChunksCount))
                                    return "maxChunksCount: integer expected";
                            }
                            if (message.minimumRelevanceScore != null && message.hasOwnProperty("minimumRelevanceScore")) {
                                properties._minimumRelevanceScore = 1;
                                if (typeof message.minimumRelevanceScore !== "number")
                                    return "minimumRelevanceScore: number expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a SemanticRetrieverConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig} SemanticRetrieverConfig
                         */
                        SemanticRetrieverConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig();
                            if (object.source != null)
                                message.source = String(object.source);
                            if (object.query != null) {
                                if (typeof object.query !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.query: object expected");
                                message.query = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.query);
                            }
                            if (object.metadataFilters) {
                                if (!Array.isArray(object.metadataFilters))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.metadataFilters: array expected");
                                message.metadataFilters = [];
                                for (var i = 0; i < object.metadataFilters.length; ++i) {
                                    if (typeof object.metadataFilters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.metadataFilters: object expected");
                                    message.metadataFilters[i] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.fromObject(object.metadataFilters[i]);
                                }
                            }
                            if (object.maxChunksCount != null)
                                message.maxChunksCount = object.maxChunksCount | 0;
                            if (object.minimumRelevanceScore != null)
                                message.minimumRelevanceScore = Number(object.minimumRelevanceScore);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SemanticRetrieverConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig} message SemanticRetrieverConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SemanticRetrieverConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.metadataFilters = [];
                            if (options.defaults) {
                                object.source = "";
                                object.query = null;
                            }
                            if (message.source != null && message.hasOwnProperty("source"))
                                object.source = message.source;
                            if (message.query != null && message.hasOwnProperty("query"))
                                object.query = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.query, options);
                            if (message.metadataFilters && message.metadataFilters.length) {
                                object.metadataFilters = [];
                                for (var j = 0; j < message.metadataFilters.length; ++j)
                                    object.metadataFilters[j] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.toObject(message.metadataFilters[j], options);
                            }
                            if (message.maxChunksCount != null && message.hasOwnProperty("maxChunksCount")) {
                                object.maxChunksCount = message.maxChunksCount;
                                if (options.oneofs)
                                    object._maxChunksCount = "maxChunksCount";
                            }
                            if (message.minimumRelevanceScore != null && message.hasOwnProperty("minimumRelevanceScore")) {
                                object.minimumRelevanceScore = options.json && !isFinite(message.minimumRelevanceScore) ? String(message.minimumRelevanceScore) : message.minimumRelevanceScore;
                                if (options.oneofs)
                                    object._minimumRelevanceScore = "minimumRelevanceScore";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this SemanticRetrieverConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SemanticRetrieverConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SemanticRetrieverConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SemanticRetrieverConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig";
                        };
    
                        return SemanticRetrieverConfig;
                    })();
    
                    v1alpha.GenerateContentResponse = (function() {
    
                        /**
                         * Properties of a GenerateContentResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGenerateContentResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ICandidate>|null} [candidates] GenerateContentResponse candidates
                         * @property {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback|null} [promptFeedback] GenerateContentResponse promptFeedback
                         * @property {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IUsageMetadata|null} [usageMetadata] GenerateContentResponse usageMetadata
                         * @property {string|null} [modelVersion] GenerateContentResponse modelVersion
                         */
    
                        /**
                         * Constructs a new GenerateContentResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GenerateContentResponse.
                         * @implements IGenerateContentResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentResponse=} [properties] Properties to set
                         */
                        function GenerateContentResponse(properties) {
                            this.candidates = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateContentResponse candidates.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ICandidate>} candidates
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.candidates = $util.emptyArray;
    
                        /**
                         * GenerateContentResponse promptFeedback.
                         * @member {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback|null|undefined} promptFeedback
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.promptFeedback = null;
    
                        /**
                         * GenerateContentResponse usageMetadata.
                         * @member {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IUsageMetadata|null|undefined} usageMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.usageMetadata = null;
    
                        /**
                         * GenerateContentResponse modelVersion.
                         * @member {string} modelVersion
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.modelVersion = "";
    
                        /**
                         * Creates a new GenerateContentResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse} GenerateContentResponse instance
                         */
                        GenerateContentResponse.create = function create(properties) {
                            return new GenerateContentResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateContentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentResponse} message GenerateContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidates != null && message.candidates.length)
                                for (var i = 0; i < message.candidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Candidate.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.promptFeedback != null && Object.hasOwnProperty.call(message, "promptFeedback"))
                                $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.encode(message.promptFeedback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.usageMetadata != null && Object.hasOwnProperty.call(message, "usageMetadata"))
                                $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelVersion);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateContentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateContentResponse} message GenerateContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateContentResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse} GenerateContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.candidates && message.candidates.length))
                                            message.candidates = [];
                                        message.candidates.push($root.google.ai.generativelanguage.v1alpha.Candidate.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.promptFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.usageMetadata = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.modelVersion = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateContentResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse} GenerateContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateContentResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateContentResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                if (!Array.isArray(message.candidates))
                                    return "candidates: array expected";
                                for (var i = 0; i < message.candidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Candidate.verify(message.candidates[i]);
                                    if (error)
                                        return "candidates." + error;
                                }
                            }
                            if (message.promptFeedback != null && message.hasOwnProperty("promptFeedback")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.verify(message.promptFeedback);
                                if (error)
                                    return "promptFeedback." + error;
                            }
                            if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.verify(message.usageMetadata);
                                if (error)
                                    return "usageMetadata." + error;
                            }
                            if (message.modelVersion != null && message.hasOwnProperty("modelVersion"))
                                if (!$util.isString(message.modelVersion))
                                    return "modelVersion: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GenerateContentResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse} GenerateContentResponse
                         */
                        GenerateContentResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse();
                            if (object.candidates) {
                                if (!Array.isArray(object.candidates))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.candidates: array expected");
                                message.candidates = [];
                                for (var i = 0; i < object.candidates.length; ++i) {
                                    if (typeof object.candidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.candidates: object expected");
                                    message.candidates[i] = $root.google.ai.generativelanguage.v1alpha.Candidate.fromObject(object.candidates[i]);
                                }
                            }
                            if (object.promptFeedback != null) {
                                if (typeof object.promptFeedback !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.promptFeedback: object expected");
                                message.promptFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.fromObject(object.promptFeedback);
                            }
                            if (object.usageMetadata != null) {
                                if (typeof object.usageMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.usageMetadata: object expected");
                                message.usageMetadata = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.fromObject(object.usageMetadata);
                            }
                            if (object.modelVersion != null)
                                message.modelVersion = String(object.modelVersion);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateContentResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse} message GenerateContentResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateContentResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.candidates = [];
                            if (options.defaults) {
                                object.promptFeedback = null;
                                object.usageMetadata = null;
                                object.modelVersion = "";
                            }
                            if (message.candidates && message.candidates.length) {
                                object.candidates = [];
                                for (var j = 0; j < message.candidates.length; ++j)
                                    object.candidates[j] = $root.google.ai.generativelanguage.v1alpha.Candidate.toObject(message.candidates[j], options);
                            }
                            if (message.promptFeedback != null && message.hasOwnProperty("promptFeedback"))
                                object.promptFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.toObject(message.promptFeedback, options);
                            if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata"))
                                object.usageMetadata = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.toObject(message.usageMetadata, options);
                            if (message.modelVersion != null && message.hasOwnProperty("modelVersion"))
                                object.modelVersion = message.modelVersion;
                            return object;
                        };
    
                        /**
                         * Converts this GenerateContentResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateContentResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateContentResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateContentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateContentResponse";
                        };
    
                        GenerateContentResponse.PromptFeedback = (function() {
    
                            /**
                             * Properties of a PromptFeedback.
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                             * @interface IPromptFeedback
                             * @property {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason|null} [blockReason] PromptFeedback blockReason
                             * @property {Array.<google.ai.generativelanguage.v1alpha.ISafetyRating>|null} [safetyRatings] PromptFeedback safetyRatings
                             */
    
                            /**
                             * Constructs a new PromptFeedback.
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                             * @classdesc Represents a PromptFeedback.
                             * @implements IPromptFeedback
                             * @constructor
                             * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback=} [properties] Properties to set
                             */
                            function PromptFeedback(properties) {
                                this.safetyRatings = [];
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * PromptFeedback blockReason.
                             * @member {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason} blockReason
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @instance
                             */
                            PromptFeedback.prototype.blockReason = 0;
    
                            /**
                             * PromptFeedback safetyRatings.
                             * @member {Array.<google.ai.generativelanguage.v1alpha.ISafetyRating>} safetyRatings
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @instance
                             */
                            PromptFeedback.prototype.safetyRatings = $util.emptyArray;
    
                            /**
                             * Creates a new PromptFeedback instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback} PromptFeedback instance
                             */
                            PromptFeedback.create = function create(properties) {
                                return new PromptFeedback(properties);
                            };
    
                            /**
                             * Encodes the specified PromptFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback} message PromptFeedback message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            PromptFeedback.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.blockReason != null && Object.hasOwnProperty.call(message, "blockReason"))
                                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.blockReason);
                                if (message.safetyRatings != null && message.safetyRatings.length)
                                    for (var i = 0; i < message.safetyRatings.length; ++i)
                                        $root.google.ai.generativelanguage.v1alpha.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                                return writer;
                            };
    
                            /**
                             * Encodes the specified PromptFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback} message PromptFeedback message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            PromptFeedback.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a PromptFeedback message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback} PromptFeedback
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            PromptFeedback.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.blockReason = reader.int32();
                                            break;
                                        }
                                    case 2: {
                                            if (!(message.safetyRatings && message.safetyRatings.length))
                                                message.safetyRatings = [];
                                            message.safetyRatings.push($root.google.ai.generativelanguage.v1alpha.SafetyRating.decode(reader, reader.uint32()));
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a PromptFeedback message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback} PromptFeedback
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            PromptFeedback.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a PromptFeedback message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            PromptFeedback.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.blockReason != null && message.hasOwnProperty("blockReason"))
                                    switch (message.blockReason) {
                                    default:
                                        return "blockReason: enum value expected";
                                    case 0:
                                    case 1:
                                    case 2:
                                    case 3:
                                    case 4:
                                    case 5:
                                        break;
                                    }
                                if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                    if (!Array.isArray(message.safetyRatings))
                                        return "safetyRatings: array expected";
                                    for (var i = 0; i < message.safetyRatings.length; ++i) {
                                        var error = $root.google.ai.generativelanguage.v1alpha.SafetyRating.verify(message.safetyRatings[i]);
                                        if (error)
                                            return "safetyRatings." + error;
                                    }
                                }
                                return null;
                            };
    
                            /**
                             * Creates a PromptFeedback message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback} PromptFeedback
                             */
                            PromptFeedback.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback();
                                switch (object.blockReason) {
                                default:
                                    if (typeof object.blockReason === "number") {
                                        message.blockReason = object.blockReason;
                                        break;
                                    }
                                    break;
                                case "BLOCK_REASON_UNSPECIFIED":
                                case 0:
                                    message.blockReason = 0;
                                    break;
                                case "SAFETY":
                                case 1:
                                    message.blockReason = 1;
                                    break;
                                case "OTHER":
                                case 2:
                                    message.blockReason = 2;
                                    break;
                                case "BLOCKLIST":
                                case 3:
                                    message.blockReason = 3;
                                    break;
                                case "PROHIBITED_CONTENT":
                                case 4:
                                    message.blockReason = 4;
                                    break;
                                case "IMAGE_SAFETY":
                                case 5:
                                    message.blockReason = 5;
                                    break;
                                }
                                if (object.safetyRatings) {
                                    if (!Array.isArray(object.safetyRatings))
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.safetyRatings: array expected");
                                    message.safetyRatings = [];
                                    for (var i = 0; i < object.safetyRatings.length; ++i) {
                                        if (typeof object.safetyRatings[i] !== "object")
                                            throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.safetyRatings: object expected");
                                        message.safetyRatings[i] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.fromObject(object.safetyRatings[i]);
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a PromptFeedback message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback} message PromptFeedback
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            PromptFeedback.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.arrays || options.defaults)
                                    object.safetyRatings = [];
                                if (options.defaults)
                                    object.blockReason = options.enums === String ? "BLOCK_REASON_UNSPECIFIED" : 0;
                                if (message.blockReason != null && message.hasOwnProperty("blockReason"))
                                    object.blockReason = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason[message.blockReason] === undefined ? message.blockReason : $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason[message.blockReason] : message.blockReason;
                                if (message.safetyRatings && message.safetyRatings.length) {
                                    object.safetyRatings = [];
                                    for (var j = 0; j < message.safetyRatings.length; ++j)
                                        object.safetyRatings[j] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.toObject(message.safetyRatings[j], options);
                                }
                                return object;
                            };
    
                            /**
                             * Converts this PromptFeedback to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            PromptFeedback.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for PromptFeedback
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            PromptFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback";
                            };
    
                            /**
                             * BlockReason enum.
                             * @name google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason
                             * @enum {number}
                             * @property {number} BLOCK_REASON_UNSPECIFIED=0 BLOCK_REASON_UNSPECIFIED value
                             * @property {number} SAFETY=1 SAFETY value
                             * @property {number} OTHER=2 OTHER value
                             * @property {number} BLOCKLIST=3 BLOCKLIST value
                             * @property {number} PROHIBITED_CONTENT=4 PROHIBITED_CONTENT value
                             * @property {number} IMAGE_SAFETY=5 IMAGE_SAFETY value
                             */
                            PromptFeedback.BlockReason = (function() {
                                var valuesById = {}, values = Object.create(valuesById);
                                values[valuesById[0] = "BLOCK_REASON_UNSPECIFIED"] = 0;
                                values[valuesById[1] = "SAFETY"] = 1;
                                values[valuesById[2] = "OTHER"] = 2;
                                values[valuesById[3] = "BLOCKLIST"] = 3;
                                values[valuesById[4] = "PROHIBITED_CONTENT"] = 4;
                                values[valuesById[5] = "IMAGE_SAFETY"] = 5;
                                return values;
                            })();
    
                            return PromptFeedback;
                        })();
    
                        GenerateContentResponse.UsageMetadata = (function() {
    
                            /**
                             * Properties of a UsageMetadata.
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                             * @interface IUsageMetadata
                             * @property {number|null} [promptTokenCount] UsageMetadata promptTokenCount
                             * @property {number|null} [cachedContentTokenCount] UsageMetadata cachedContentTokenCount
                             * @property {number|null} [candidatesTokenCount] UsageMetadata candidatesTokenCount
                             * @property {number|null} [totalTokenCount] UsageMetadata totalTokenCount
                             */
    
                            /**
                             * Constructs a new UsageMetadata.
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse
                             * @classdesc Represents a UsageMetadata.
                             * @implements IUsageMetadata
                             * @constructor
                             * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IUsageMetadata=} [properties] Properties to set
                             */
                            function UsageMetadata(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * UsageMetadata promptTokenCount.
                             * @member {number} promptTokenCount
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.promptTokenCount = 0;
    
                            /**
                             * UsageMetadata cachedContentTokenCount.
                             * @member {number} cachedContentTokenCount
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.cachedContentTokenCount = 0;
    
                            /**
                             * UsageMetadata candidatesTokenCount.
                             * @member {number} candidatesTokenCount
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.candidatesTokenCount = 0;
    
                            /**
                             * UsageMetadata totalTokenCount.
                             * @member {number} totalTokenCount
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.totalTokenCount = 0;
    
                            /**
                             * Creates a new UsageMetadata instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IUsageMetadata=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata} UsageMetadata instance
                             */
                            UsageMetadata.create = function create(properties) {
                                return new UsageMetadata(properties);
                            };
    
                            /**
                             * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IUsageMetadata} message UsageMetadata message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            UsageMetadata.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.promptTokenCount != null && Object.hasOwnProperty.call(message, "promptTokenCount"))
                                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.promptTokenCount);
                                if (message.candidatesTokenCount != null && Object.hasOwnProperty.call(message, "candidatesTokenCount"))
                                    writer.uint32(/* id 2, wireType 0 =*/16).int32(message.candidatesTokenCount);
                                if (message.totalTokenCount != null && Object.hasOwnProperty.call(message, "totalTokenCount"))
                                    writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalTokenCount);
                                if (message.cachedContentTokenCount != null && Object.hasOwnProperty.call(message, "cachedContentTokenCount"))
                                    writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cachedContentTokenCount);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IUsageMetadata} message UsageMetadata message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            UsageMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a UsageMetadata message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata} UsageMetadata
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            UsageMetadata.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.promptTokenCount = reader.int32();
                                            break;
                                        }
                                    case 4: {
                                            message.cachedContentTokenCount = reader.int32();
                                            break;
                                        }
                                    case 2: {
                                            message.candidatesTokenCount = reader.int32();
                                            break;
                                        }
                                    case 3: {
                                            message.totalTokenCount = reader.int32();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a UsageMetadata message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata} UsageMetadata
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            UsageMetadata.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a UsageMetadata message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            UsageMetadata.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.promptTokenCount != null && message.hasOwnProperty("promptTokenCount"))
                                    if (!$util.isInteger(message.promptTokenCount))
                                        return "promptTokenCount: integer expected";
                                if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount"))
                                    if (!$util.isInteger(message.cachedContentTokenCount))
                                        return "cachedContentTokenCount: integer expected";
                                if (message.candidatesTokenCount != null && message.hasOwnProperty("candidatesTokenCount"))
                                    if (!$util.isInteger(message.candidatesTokenCount))
                                        return "candidatesTokenCount: integer expected";
                                if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount"))
                                    if (!$util.isInteger(message.totalTokenCount))
                                        return "totalTokenCount: integer expected";
                                return null;
                            };
    
                            /**
                             * Creates a UsageMetadata message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata} UsageMetadata
                             */
                            UsageMetadata.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata();
                                if (object.promptTokenCount != null)
                                    message.promptTokenCount = object.promptTokenCount | 0;
                                if (object.cachedContentTokenCount != null)
                                    message.cachedContentTokenCount = object.cachedContentTokenCount | 0;
                                if (object.candidatesTokenCount != null)
                                    message.candidatesTokenCount = object.candidatesTokenCount | 0;
                                if (object.totalTokenCount != null)
                                    message.totalTokenCount = object.totalTokenCount | 0;
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a UsageMetadata message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata} message UsageMetadata
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            UsageMetadata.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.defaults) {
                                    object.promptTokenCount = 0;
                                    object.candidatesTokenCount = 0;
                                    object.totalTokenCount = 0;
                                    object.cachedContentTokenCount = 0;
                                }
                                if (message.promptTokenCount != null && message.hasOwnProperty("promptTokenCount"))
                                    object.promptTokenCount = message.promptTokenCount;
                                if (message.candidatesTokenCount != null && message.hasOwnProperty("candidatesTokenCount"))
                                    object.candidatesTokenCount = message.candidatesTokenCount;
                                if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount"))
                                    object.totalTokenCount = message.totalTokenCount;
                                if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount"))
                                    object.cachedContentTokenCount = message.cachedContentTokenCount;
                                return object;
                            };
    
                            /**
                             * Converts this UsageMetadata to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            UsageMetadata.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for UsageMetadata
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            UsageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata";
                            };
    
                            return UsageMetadata;
                        })();
    
                        return GenerateContentResponse;
                    })();
    
                    v1alpha.Candidate = (function() {
    
                        /**
                         * Properties of a Candidate.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICandidate
                         * @property {number|null} [index] Candidate index
                         * @property {google.ai.generativelanguage.v1alpha.IContent|null} [content] Candidate content
                         * @property {google.ai.generativelanguage.v1alpha.Candidate.FinishReason|null} [finishReason] Candidate finishReason
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ISafetyRating>|null} [safetyRatings] Candidate safetyRatings
                         * @property {google.ai.generativelanguage.v1alpha.ICitationMetadata|null} [citationMetadata] Candidate citationMetadata
                         * @property {number|null} [tokenCount] Candidate tokenCount
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IGroundingAttribution>|null} [groundingAttributions] Candidate groundingAttributions
                         * @property {google.ai.generativelanguage.v1alpha.IGroundingMetadata|null} [groundingMetadata] Candidate groundingMetadata
                         * @property {number|null} [avgLogprobs] Candidate avgLogprobs
                         * @property {google.ai.generativelanguage.v1alpha.ILogprobsResult|null} [logprobsResult] Candidate logprobsResult
                         */
    
                        /**
                         * Constructs a new Candidate.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Candidate.
                         * @implements ICandidate
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICandidate=} [properties] Properties to set
                         */
                        function Candidate(properties) {
                            this.safetyRatings = [];
                            this.groundingAttributions = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Candidate index.
                         * @member {number|null|undefined} index
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         */
                        Candidate.prototype.index = null;
    
                        /**
                         * Candidate content.
                         * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} content
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         */
                        Candidate.prototype.content = null;
    
                        /**
                         * Candidate finishReason.
                         * @member {google.ai.generativelanguage.v1alpha.Candidate.FinishReason} finishReason
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         */
                        Candidate.prototype.finishReason = 0;
    
                        /**
                         * Candidate safetyRatings.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ISafetyRating>} safetyRatings
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         */
                        Candidate.prototype.safetyRatings = $util.emptyArray;
    
                        /**
                         * Candidate citationMetadata.
                         * @member {google.ai.generativelanguage.v1alpha.ICitationMetadata|null|undefined} citationMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         */
                        Candidate.prototype.citationMetadata = null;
    
                        /**
                         * Candidate tokenCount.
                         * @member {number} tokenCount
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         */
                        Candidate.prototype.tokenCount = 0;
    
                        /**
                         * Candidate groundingAttributions.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IGroundingAttribution>} groundingAttributions
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         */
                        Candidate.prototype.groundingAttributions = $util.emptyArray;
    
                        /**
                         * Candidate groundingMetadata.
                         * @member {google.ai.generativelanguage.v1alpha.IGroundingMetadata|null|undefined} groundingMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         */
                        Candidate.prototype.groundingMetadata = null;
    
                        /**
                         * Candidate avgLogprobs.
                         * @member {number} avgLogprobs
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         */
                        Candidate.prototype.avgLogprobs = 0;
    
                        /**
                         * Candidate logprobsResult.
                         * @member {google.ai.generativelanguage.v1alpha.ILogprobsResult|null|undefined} logprobsResult
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         */
                        Candidate.prototype.logprobsResult = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Candidate _index.
                         * @member {"index"|undefined} _index
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         */
                        Object.defineProperty(Candidate.prototype, "_index", {
                            get: $util.oneOfGetter($oneOfFields = ["index"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Candidate instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICandidate=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Candidate} Candidate instance
                         */
                        Candidate.create = function create(properties) {
                            return new Candidate(properties);
                        };
    
                        /**
                         * Encodes the specified Candidate message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Candidate.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICandidate} message Candidate message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Candidate.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                $root.google.ai.generativelanguage.v1alpha.Content.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.finishReason != null && Object.hasOwnProperty.call(message, "finishReason"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.finishReason);
                            if (message.index != null && Object.hasOwnProperty.call(message, "index"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.index);
                            if (message.safetyRatings != null && message.safetyRatings.length)
                                for (var i = 0; i < message.safetyRatings.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata"))
                                $root.google.ai.generativelanguage.v1alpha.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.tokenCount);
                            if (message.groundingAttributions != null && message.groundingAttributions.length)
                                for (var i = 0; i < message.groundingAttributions.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.GroundingAttribution.encode(message.groundingAttributions[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.groundingMetadata != null && Object.hasOwnProperty.call(message, "groundingMetadata"))
                                $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.encode(message.groundingMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                            if (message.avgLogprobs != null && Object.hasOwnProperty.call(message, "avgLogprobs"))
                                writer.uint32(/* id 10, wireType 1 =*/81).double(message.avgLogprobs);
                            if (message.logprobsResult != null && Object.hasOwnProperty.call(message, "logprobsResult"))
                                $root.google.ai.generativelanguage.v1alpha.LogprobsResult.encode(message.logprobsResult, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Candidate.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICandidate} message Candidate message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Candidate.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Candidate message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Candidate} Candidate
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Candidate.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Candidate();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.index = reader.int32();
                                        break;
                                    }
                                case 1: {
                                        message.content = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.finishReason = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        if (!(message.safetyRatings && message.safetyRatings.length))
                                            message.safetyRatings = [];
                                        message.safetyRatings.push($root.google.ai.generativelanguage.v1alpha.SafetyRating.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 6: {
                                        message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 7: {
                                        message.tokenCount = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        if (!(message.groundingAttributions && message.groundingAttributions.length))
                                            message.groundingAttributions = [];
                                        message.groundingAttributions.push($root.google.ai.generativelanguage.v1alpha.GroundingAttribution.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 9: {
                                        message.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 10: {
                                        message.avgLogprobs = reader.double();
                                        break;
                                    }
                                case 11: {
                                        message.logprobsResult = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Candidate message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Candidate} Candidate
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Candidate.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Candidate message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Candidate.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.index != null && message.hasOwnProperty("index")) {
                                properties._index = 1;
                                if (!$util.isInteger(message.index))
                                    return "index: integer expected";
                            }
                            if (message.content != null && message.hasOwnProperty("content")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.content);
                                if (error)
                                    return "content." + error;
                            }
                            if (message.finishReason != null && message.hasOwnProperty("finishReason"))
                                switch (message.finishReason) {
                                default:
                                    return "finishReason: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 6:
                                case 5:
                                case 7:
                                case 8:
                                case 9:
                                case 10:
                                case 11:
                                    break;
                                }
                            if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                if (!Array.isArray(message.safetyRatings))
                                    return "safetyRatings: array expected";
                                for (var i = 0; i < message.safetyRatings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.SafetyRating.verify(message.safetyRatings[i]);
                                    if (error)
                                        return "safetyRatings." + error;
                                }
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.verify(message.citationMetadata);
                                if (error)
                                    return "citationMetadata." + error;
                            }
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                if (!$util.isInteger(message.tokenCount))
                                    return "tokenCount: integer expected";
                            if (message.groundingAttributions != null && message.hasOwnProperty("groundingAttributions")) {
                                if (!Array.isArray(message.groundingAttributions))
                                    return "groundingAttributions: array expected";
                                for (var i = 0; i < message.groundingAttributions.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.GroundingAttribution.verify(message.groundingAttributions[i]);
                                    if (error)
                                        return "groundingAttributions." + error;
                                }
                            }
                            if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.verify(message.groundingMetadata);
                                if (error)
                                    return "groundingMetadata." + error;
                            }
                            if (message.avgLogprobs != null && message.hasOwnProperty("avgLogprobs"))
                                if (typeof message.avgLogprobs !== "number")
                                    return "avgLogprobs: number expected";
                            if (message.logprobsResult != null && message.hasOwnProperty("logprobsResult")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.verify(message.logprobsResult);
                                if (error)
                                    return "logprobsResult." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Candidate message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Candidate} Candidate
                         */
                        Candidate.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Candidate)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Candidate();
                            if (object.index != null)
                                message.index = object.index | 0;
                            if (object.content != null) {
                                if (typeof object.content !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.content: object expected");
                                message.content = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.content);
                            }
                            switch (object.finishReason) {
                            default:
                                if (typeof object.finishReason === "number") {
                                    message.finishReason = object.finishReason;
                                    break;
                                }
                                break;
                            case "FINISH_REASON_UNSPECIFIED":
                            case 0:
                                message.finishReason = 0;
                                break;
                            case "STOP":
                            case 1:
                                message.finishReason = 1;
                                break;
                            case "MAX_TOKENS":
                            case 2:
                                message.finishReason = 2;
                                break;
                            case "SAFETY":
                            case 3:
                                message.finishReason = 3;
                                break;
                            case "RECITATION":
                            case 4:
                                message.finishReason = 4;
                                break;
                            case "LANGUAGE":
                            case 6:
                                message.finishReason = 6;
                                break;
                            case "OTHER":
                            case 5:
                                message.finishReason = 5;
                                break;
                            case "BLOCKLIST":
                            case 7:
                                message.finishReason = 7;
                                break;
                            case "PROHIBITED_CONTENT":
                            case 8:
                                message.finishReason = 8;
                                break;
                            case "SPII":
                            case 9:
                                message.finishReason = 9;
                                break;
                            case "MALFORMED_FUNCTION_CALL":
                            case 10:
                                message.finishReason = 10;
                                break;
                            case "IMAGE_SAFETY":
                            case 11:
                                message.finishReason = 11;
                                break;
                            }
                            if (object.safetyRatings) {
                                if (!Array.isArray(object.safetyRatings))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.safetyRatings: array expected");
                                message.safetyRatings = [];
                                for (var i = 0; i < object.safetyRatings.length; ++i) {
                                    if (typeof object.safetyRatings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.safetyRatings: object expected");
                                    message.safetyRatings[i] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.fromObject(object.safetyRatings[i]);
                                }
                            }
                            if (object.citationMetadata != null) {
                                if (typeof object.citationMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.citationMetadata: object expected");
                                message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.fromObject(object.citationMetadata);
                            }
                            if (object.tokenCount != null)
                                message.tokenCount = object.tokenCount | 0;
                            if (object.groundingAttributions) {
                                if (!Array.isArray(object.groundingAttributions))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.groundingAttributions: array expected");
                                message.groundingAttributions = [];
                                for (var i = 0; i < object.groundingAttributions.length; ++i) {
                                    if (typeof object.groundingAttributions[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.groundingAttributions: object expected");
                                    message.groundingAttributions[i] = $root.google.ai.generativelanguage.v1alpha.GroundingAttribution.fromObject(object.groundingAttributions[i]);
                                }
                            }
                            if (object.groundingMetadata != null) {
                                if (typeof object.groundingMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.groundingMetadata: object expected");
                                message.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.fromObject(object.groundingMetadata);
                            }
                            if (object.avgLogprobs != null)
                                message.avgLogprobs = Number(object.avgLogprobs);
                            if (object.logprobsResult != null) {
                                if (typeof object.logprobsResult !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.logprobsResult: object expected");
                                message.logprobsResult = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.fromObject(object.logprobsResult);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Candidate message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Candidate} message Candidate
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Candidate.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.safetyRatings = [];
                                object.groundingAttributions = [];
                            }
                            if (options.defaults) {
                                object.content = null;
                                object.finishReason = options.enums === String ? "FINISH_REASON_UNSPECIFIED" : 0;
                                object.citationMetadata = null;
                                object.tokenCount = 0;
                                object.groundingMetadata = null;
                                object.avgLogprobs = 0;
                                object.logprobsResult = null;
                            }
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.content, options);
                            if (message.finishReason != null && message.hasOwnProperty("finishReason"))
                                object.finishReason = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Candidate.FinishReason[message.finishReason] === undefined ? message.finishReason : $root.google.ai.generativelanguage.v1alpha.Candidate.FinishReason[message.finishReason] : message.finishReason;
                            if (message.index != null && message.hasOwnProperty("index")) {
                                object.index = message.index;
                                if (options.oneofs)
                                    object._index = "index";
                            }
                            if (message.safetyRatings && message.safetyRatings.length) {
                                object.safetyRatings = [];
                                for (var j = 0; j < message.safetyRatings.length; ++j)
                                    object.safetyRatings[j] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.toObject(message.safetyRatings[j], options);
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata"))
                                object.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.toObject(message.citationMetadata, options);
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                object.tokenCount = message.tokenCount;
                            if (message.groundingAttributions && message.groundingAttributions.length) {
                                object.groundingAttributions = [];
                                for (var j = 0; j < message.groundingAttributions.length; ++j)
                                    object.groundingAttributions[j] = $root.google.ai.generativelanguage.v1alpha.GroundingAttribution.toObject(message.groundingAttributions[j], options);
                            }
                            if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata"))
                                object.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.toObject(message.groundingMetadata, options);
                            if (message.avgLogprobs != null && message.hasOwnProperty("avgLogprobs"))
                                object.avgLogprobs = options.json && !isFinite(message.avgLogprobs) ? String(message.avgLogprobs) : message.avgLogprobs;
                            if (message.logprobsResult != null && message.hasOwnProperty("logprobsResult"))
                                object.logprobsResult = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.toObject(message.logprobsResult, options);
                            return object;
                        };
    
                        /**
                         * Converts this Candidate to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Candidate.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Candidate
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Candidate
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Candidate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Candidate";
                        };
    
                        /**
                         * FinishReason enum.
                         * @name google.ai.generativelanguage.v1alpha.Candidate.FinishReason
                         * @enum {number}
                         * @property {number} FINISH_REASON_UNSPECIFIED=0 FINISH_REASON_UNSPECIFIED value
                         * @property {number} STOP=1 STOP value
                         * @property {number} MAX_TOKENS=2 MAX_TOKENS value
                         * @property {number} SAFETY=3 SAFETY value
                         * @property {number} RECITATION=4 RECITATION value
                         * @property {number} LANGUAGE=6 LANGUAGE value
                         * @property {number} OTHER=5 OTHER value
                         * @property {number} BLOCKLIST=7 BLOCKLIST value
                         * @property {number} PROHIBITED_CONTENT=8 PROHIBITED_CONTENT value
                         * @property {number} SPII=9 SPII value
                         * @property {number} MALFORMED_FUNCTION_CALL=10 MALFORMED_FUNCTION_CALL value
                         * @property {number} IMAGE_SAFETY=11 IMAGE_SAFETY value
                         */
                        Candidate.FinishReason = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "FINISH_REASON_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "STOP"] = 1;
                            values[valuesById[2] = "MAX_TOKENS"] = 2;
                            values[valuesById[3] = "SAFETY"] = 3;
                            values[valuesById[4] = "RECITATION"] = 4;
                            values[valuesById[6] = "LANGUAGE"] = 6;
                            values[valuesById[5] = "OTHER"] = 5;
                            values[valuesById[7] = "BLOCKLIST"] = 7;
                            values[valuesById[8] = "PROHIBITED_CONTENT"] = 8;
                            values[valuesById[9] = "SPII"] = 9;
                            values[valuesById[10] = "MALFORMED_FUNCTION_CALL"] = 10;
                            values[valuesById[11] = "IMAGE_SAFETY"] = 11;
                            return values;
                        })();
    
                        return Candidate;
                    })();
    
                    v1alpha.LogprobsResult = (function() {
    
                        /**
                         * Properties of a LogprobsResult.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ILogprobsResult
                         * @property {Array.<google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates>|null} [topCandidates] LogprobsResult topCandidates
                         * @property {Array.<google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate>|null} [chosenCandidates] LogprobsResult chosenCandidates
                         */
    
                        /**
                         * Constructs a new LogprobsResult.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a LogprobsResult.
                         * @implements ILogprobsResult
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ILogprobsResult=} [properties] Properties to set
                         */
                        function LogprobsResult(properties) {
                            this.topCandidates = [];
                            this.chosenCandidates = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * LogprobsResult topCandidates.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates>} topCandidates
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @instance
                         */
                        LogprobsResult.prototype.topCandidates = $util.emptyArray;
    
                        /**
                         * LogprobsResult chosenCandidates.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate>} chosenCandidates
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @instance
                         */
                        LogprobsResult.prototype.chosenCandidates = $util.emptyArray;
    
                        /**
                         * Creates a new LogprobsResult instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ILogprobsResult=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult} LogprobsResult instance
                         */
                        LogprobsResult.create = function create(properties) {
                            return new LogprobsResult(properties);
                        };
    
                        /**
                         * Encodes the specified LogprobsResult message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ILogprobsResult} message LogprobsResult message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        LogprobsResult.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.topCandidates != null && message.topCandidates.length)
                                for (var i = 0; i < message.topCandidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.encode(message.topCandidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.chosenCandidates != null && message.chosenCandidates.length)
                                for (var i = 0; i < message.chosenCandidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.encode(message.chosenCandidates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified LogprobsResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ILogprobsResult} message LogprobsResult message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        LogprobsResult.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a LogprobsResult message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult} LogprobsResult
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        LogprobsResult.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.LogprobsResult();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.topCandidates && message.topCandidates.length))
                                            message.topCandidates = [];
                                        message.topCandidates.push($root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        if (!(message.chosenCandidates && message.chosenCandidates.length))
                                            message.chosenCandidates = [];
                                        message.chosenCandidates.push($root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a LogprobsResult message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult} LogprobsResult
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        LogprobsResult.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a LogprobsResult message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        LogprobsResult.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.topCandidates != null && message.hasOwnProperty("topCandidates")) {
                                if (!Array.isArray(message.topCandidates))
                                    return "topCandidates: array expected";
                                for (var i = 0; i < message.topCandidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.verify(message.topCandidates[i]);
                                    if (error)
                                        return "topCandidates." + error;
                                }
                            }
                            if (message.chosenCandidates != null && message.hasOwnProperty("chosenCandidates")) {
                                if (!Array.isArray(message.chosenCandidates))
                                    return "chosenCandidates: array expected";
                                for (var i = 0; i < message.chosenCandidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.verify(message.chosenCandidates[i]);
                                    if (error)
                                        return "chosenCandidates." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a LogprobsResult message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult} LogprobsResult
                         */
                        LogprobsResult.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.LogprobsResult)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.LogprobsResult();
                            if (object.topCandidates) {
                                if (!Array.isArray(object.topCandidates))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.topCandidates: array expected");
                                message.topCandidates = [];
                                for (var i = 0; i < object.topCandidates.length; ++i) {
                                    if (typeof object.topCandidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.topCandidates: object expected");
                                    message.topCandidates[i] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.fromObject(object.topCandidates[i]);
                                }
                            }
                            if (object.chosenCandidates) {
                                if (!Array.isArray(object.chosenCandidates))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.chosenCandidates: array expected");
                                message.chosenCandidates = [];
                                for (var i = 0; i < object.chosenCandidates.length; ++i) {
                                    if (typeof object.chosenCandidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.chosenCandidates: object expected");
                                    message.chosenCandidates[i] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.fromObject(object.chosenCandidates[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a LogprobsResult message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.LogprobsResult} message LogprobsResult
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        LogprobsResult.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.topCandidates = [];
                                object.chosenCandidates = [];
                            }
                            if (message.topCandidates && message.topCandidates.length) {
                                object.topCandidates = [];
                                for (var j = 0; j < message.topCandidates.length; ++j)
                                    object.topCandidates[j] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.toObject(message.topCandidates[j], options);
                            }
                            if (message.chosenCandidates && message.chosenCandidates.length) {
                                object.chosenCandidates = [];
                                for (var j = 0; j < message.chosenCandidates.length; ++j)
                                    object.chosenCandidates[j] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.toObject(message.chosenCandidates[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this LogprobsResult to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        LogprobsResult.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for LogprobsResult
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        LogprobsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.LogprobsResult";
                        };
    
                        LogprobsResult.Candidate = (function() {
    
                            /**
                             * Properties of a Candidate.
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                             * @interface ICandidate
                             * @property {string|null} [token] Candidate token
                             * @property {number|null} [tokenId] Candidate tokenId
                             * @property {number|null} [logProbability] Candidate logProbability
                             */
    
                            /**
                             * Constructs a new Candidate.
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                             * @classdesc Represents a Candidate.
                             * @implements ICandidate
                             * @constructor
                             * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate=} [properties] Properties to set
                             */
                            function Candidate(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * Candidate token.
                             * @member {string|null|undefined} token
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @instance
                             */
                            Candidate.prototype.token = null;
    
                            /**
                             * Candidate tokenId.
                             * @member {number|null|undefined} tokenId
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @instance
                             */
                            Candidate.prototype.tokenId = null;
    
                            /**
                             * Candidate logProbability.
                             * @member {number|null|undefined} logProbability
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @instance
                             */
                            Candidate.prototype.logProbability = null;
    
                            // OneOf field names bound to virtual getters and setters
                            var $oneOfFields;
    
                            /**
                             * Candidate _token.
                             * @member {"token"|undefined} _token
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @instance
                             */
                            Object.defineProperty(Candidate.prototype, "_token", {
                                get: $util.oneOfGetter($oneOfFields = ["token"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Candidate _tokenId.
                             * @member {"tokenId"|undefined} _tokenId
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @instance
                             */
                            Object.defineProperty(Candidate.prototype, "_tokenId", {
                                get: $util.oneOfGetter($oneOfFields = ["tokenId"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Candidate _logProbability.
                             * @member {"logProbability"|undefined} _logProbability
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @instance
                             */
                            Object.defineProperty(Candidate.prototype, "_logProbability", {
                                get: $util.oneOfGetter($oneOfFields = ["logProbability"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Creates a new Candidate instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate} Candidate instance
                             */
                            Candidate.create = function create(properties) {
                                return new Candidate(properties);
                            };
    
                            /**
                             * Encodes the specified Candidate message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate} message Candidate message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Candidate.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.token != null && Object.hasOwnProperty.call(message, "token"))
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.token);
                                if (message.logProbability != null && Object.hasOwnProperty.call(message, "logProbability"))
                                    writer.uint32(/* id 2, wireType 5 =*/21).float(message.logProbability);
                                if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId"))
                                    writer.uint32(/* id 3, wireType 0 =*/24).int32(message.tokenId);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate} message Candidate message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Candidate.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a Candidate message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate} Candidate
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Candidate.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.token = reader.string();
                                            break;
                                        }
                                    case 3: {
                                            message.tokenId = reader.int32();
                                            break;
                                        }
                                    case 2: {
                                            message.logProbability = reader.float();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a Candidate message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate} Candidate
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Candidate.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a Candidate message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            Candidate.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                var properties = {};
                                if (message.token != null && message.hasOwnProperty("token")) {
                                    properties._token = 1;
                                    if (!$util.isString(message.token))
                                        return "token: string expected";
                                }
                                if (message.tokenId != null && message.hasOwnProperty("tokenId")) {
                                    properties._tokenId = 1;
                                    if (!$util.isInteger(message.tokenId))
                                        return "tokenId: integer expected";
                                }
                                if (message.logProbability != null && message.hasOwnProperty("logProbability")) {
                                    properties._logProbability = 1;
                                    if (typeof message.logProbability !== "number")
                                        return "logProbability: number expected";
                                }
                                return null;
                            };
    
                            /**
                             * Creates a Candidate message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate} Candidate
                             */
                            Candidate.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate();
                                if (object.token != null)
                                    message.token = String(object.token);
                                if (object.tokenId != null)
                                    message.tokenId = object.tokenId | 0;
                                if (object.logProbability != null)
                                    message.logProbability = Number(object.logProbability);
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a Candidate message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate} message Candidate
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            Candidate.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (message.token != null && message.hasOwnProperty("token")) {
                                    object.token = message.token;
                                    if (options.oneofs)
                                        object._token = "token";
                                }
                                if (message.logProbability != null && message.hasOwnProperty("logProbability")) {
                                    object.logProbability = options.json && !isFinite(message.logProbability) ? String(message.logProbability) : message.logProbability;
                                    if (options.oneofs)
                                        object._logProbability = "logProbability";
                                }
                                if (message.tokenId != null && message.hasOwnProperty("tokenId")) {
                                    object.tokenId = message.tokenId;
                                    if (options.oneofs)
                                        object._tokenId = "tokenId";
                                }
                                return object;
                            };
    
                            /**
                             * Converts this Candidate to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            Candidate.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for Candidate
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            Candidate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate";
                            };
    
                            return Candidate;
                        })();
    
                        LogprobsResult.TopCandidates = (function() {
    
                            /**
                             * Properties of a TopCandidates.
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                             * @interface ITopCandidates
                             * @property {Array.<google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate>|null} [candidates] TopCandidates candidates
                             */
    
                            /**
                             * Constructs a new TopCandidates.
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult
                             * @classdesc Represents a TopCandidates.
                             * @implements ITopCandidates
                             * @constructor
                             * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates=} [properties] Properties to set
                             */
                            function TopCandidates(properties) {
                                this.candidates = [];
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * TopCandidates candidates.
                             * @member {Array.<google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate>} candidates
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates
                             * @instance
                             */
                            TopCandidates.prototype.candidates = $util.emptyArray;
    
                            /**
                             * Creates a new TopCandidates instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates} TopCandidates instance
                             */
                            TopCandidates.create = function create(properties) {
                                return new TopCandidates(properties);
                            };
    
                            /**
                             * Encodes the specified TopCandidates message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates} message TopCandidates message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            TopCandidates.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.candidates != null && message.candidates.length)
                                    for (var i = 0; i < message.candidates.length; ++i)
                                        $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                                return writer;
                            };
    
                            /**
                             * Encodes the specified TopCandidates message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates} message TopCandidates message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            TopCandidates.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a TopCandidates message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates} TopCandidates
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            TopCandidates.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            if (!(message.candidates && message.candidates.length))
                                                message.candidates = [];
                                            message.candidates.push($root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.decode(reader, reader.uint32()));
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a TopCandidates message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates} TopCandidates
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            TopCandidates.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a TopCandidates message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            TopCandidates.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                    if (!Array.isArray(message.candidates))
                                        return "candidates: array expected";
                                    for (var i = 0; i < message.candidates.length; ++i) {
                                        var error = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.verify(message.candidates[i]);
                                        if (error)
                                            return "candidates." + error;
                                    }
                                }
                                return null;
                            };
    
                            /**
                             * Creates a TopCandidates message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates} TopCandidates
                             */
                            TopCandidates.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates();
                                if (object.candidates) {
                                    if (!Array.isArray(object.candidates))
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.candidates: array expected");
                                    message.candidates = [];
                                    for (var i = 0; i < object.candidates.length; ++i) {
                                        if (typeof object.candidates[i] !== "object")
                                            throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.candidates: object expected");
                                        message.candidates[i] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.fromObject(object.candidates[i]);
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a TopCandidates message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates} message TopCandidates
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            TopCandidates.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.arrays || options.defaults)
                                    object.candidates = [];
                                if (message.candidates && message.candidates.length) {
                                    object.candidates = [];
                                    for (var j = 0; j < message.candidates.length; ++j)
                                        object.candidates[j] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.toObject(message.candidates[j], options);
                                }
                                return object;
                            };
    
                            /**
                             * Converts this TopCandidates to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            TopCandidates.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for TopCandidates
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            TopCandidates.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates";
                            };
    
                            return TopCandidates;
                        })();
    
                        return LogprobsResult;
                    })();
    
                    v1alpha.AttributionSourceId = (function() {
    
                        /**
                         * Properties of an AttributionSourceId.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IAttributionSourceId
                         * @property {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId|null} [groundingPassage] AttributionSourceId groundingPassage
                         * @property {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk|null} [semanticRetrieverChunk] AttributionSourceId semanticRetrieverChunk
                         */
    
                        /**
                         * Constructs a new AttributionSourceId.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an AttributionSourceId.
                         * @implements IAttributionSourceId
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IAttributionSourceId=} [properties] Properties to set
                         */
                        function AttributionSourceId(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * AttributionSourceId groundingPassage.
                         * @member {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId|null|undefined} groundingPassage
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @instance
                         */
                        AttributionSourceId.prototype.groundingPassage = null;
    
                        /**
                         * AttributionSourceId semanticRetrieverChunk.
                         * @member {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk|null|undefined} semanticRetrieverChunk
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @instance
                         */
                        AttributionSourceId.prototype.semanticRetrieverChunk = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * AttributionSourceId source.
                         * @member {"groundingPassage"|"semanticRetrieverChunk"|undefined} source
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @instance
                         */
                        Object.defineProperty(AttributionSourceId.prototype, "source", {
                            get: $util.oneOfGetter($oneOfFields = ["groundingPassage", "semanticRetrieverChunk"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new AttributionSourceId instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IAttributionSourceId=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId} AttributionSourceId instance
                         */
                        AttributionSourceId.create = function create(properties) {
                            return new AttributionSourceId(properties);
                        };
    
                        /**
                         * Encodes the specified AttributionSourceId message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IAttributionSourceId} message AttributionSourceId message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        AttributionSourceId.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.groundingPassage != null && Object.hasOwnProperty.call(message, "groundingPassage"))
                                $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.encode(message.groundingPassage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.semanticRetrieverChunk != null && Object.hasOwnProperty.call(message, "semanticRetrieverChunk"))
                                $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.encode(message.semanticRetrieverChunk, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified AttributionSourceId message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IAttributionSourceId} message AttributionSourceId message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        AttributionSourceId.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an AttributionSourceId message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId} AttributionSourceId
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        AttributionSourceId.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.AttributionSourceId();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.groundingPassage = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.semanticRetrieverChunk = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an AttributionSourceId message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId} AttributionSourceId
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        AttributionSourceId.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an AttributionSourceId message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        AttributionSourceId.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.groundingPassage != null && message.hasOwnProperty("groundingPassage")) {
                                properties.source = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.verify(message.groundingPassage);
                                    if (error)
                                        return "groundingPassage." + error;
                                }
                            }
                            if (message.semanticRetrieverChunk != null && message.hasOwnProperty("semanticRetrieverChunk")) {
                                if (properties.source === 1)
                                    return "source: multiple values";
                                properties.source = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.verify(message.semanticRetrieverChunk);
                                    if (error)
                                        return "semanticRetrieverChunk." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates an AttributionSourceId message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId} AttributionSourceId
                         */
                        AttributionSourceId.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.AttributionSourceId)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.AttributionSourceId();
                            if (object.groundingPassage != null) {
                                if (typeof object.groundingPassage !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.AttributionSourceId.groundingPassage: object expected");
                                message.groundingPassage = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.fromObject(object.groundingPassage);
                            }
                            if (object.semanticRetrieverChunk != null) {
                                if (typeof object.semanticRetrieverChunk !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.AttributionSourceId.semanticRetrieverChunk: object expected");
                                message.semanticRetrieverChunk = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.fromObject(object.semanticRetrieverChunk);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an AttributionSourceId message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId} message AttributionSourceId
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        AttributionSourceId.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.groundingPassage != null && message.hasOwnProperty("groundingPassage")) {
                                object.groundingPassage = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.toObject(message.groundingPassage, options);
                                if (options.oneofs)
                                    object.source = "groundingPassage";
                            }
                            if (message.semanticRetrieverChunk != null && message.hasOwnProperty("semanticRetrieverChunk")) {
                                object.semanticRetrieverChunk = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.toObject(message.semanticRetrieverChunk, options);
                                if (options.oneofs)
                                    object.source = "semanticRetrieverChunk";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this AttributionSourceId to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        AttributionSourceId.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for AttributionSourceId
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        AttributionSourceId.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.AttributionSourceId";
                        };
    
                        AttributionSourceId.GroundingPassageId = (function() {
    
                            /**
                             * Properties of a GroundingPassageId.
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                             * @interface IGroundingPassageId
                             * @property {string|null} [passageId] GroundingPassageId passageId
                             * @property {number|null} [partIndex] GroundingPassageId partIndex
                             */
    
                            /**
                             * Constructs a new GroundingPassageId.
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                             * @classdesc Represents a GroundingPassageId.
                             * @implements IGroundingPassageId
                             * @constructor
                             * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId=} [properties] Properties to set
                             */
                            function GroundingPassageId(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * GroundingPassageId passageId.
                             * @member {string} passageId
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @instance
                             */
                            GroundingPassageId.prototype.passageId = "";
    
                            /**
                             * GroundingPassageId partIndex.
                             * @member {number} partIndex
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @instance
                             */
                            GroundingPassageId.prototype.partIndex = 0;
    
                            /**
                             * Creates a new GroundingPassageId instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId} GroundingPassageId instance
                             */
                            GroundingPassageId.create = function create(properties) {
                                return new GroundingPassageId(properties);
                            };
    
                            /**
                             * Encodes the specified GroundingPassageId message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId} message GroundingPassageId message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            GroundingPassageId.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.passageId != null && Object.hasOwnProperty.call(message, "passageId"))
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.passageId);
                                if (message.partIndex != null && Object.hasOwnProperty.call(message, "partIndex"))
                                    writer.uint32(/* id 2, wireType 0 =*/16).int32(message.partIndex);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified GroundingPassageId message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId} message GroundingPassageId message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            GroundingPassageId.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a GroundingPassageId message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId} GroundingPassageId
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            GroundingPassageId.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.passageId = reader.string();
                                            break;
                                        }
                                    case 2: {
                                            message.partIndex = reader.int32();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a GroundingPassageId message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId} GroundingPassageId
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            GroundingPassageId.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a GroundingPassageId message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            GroundingPassageId.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.passageId != null && message.hasOwnProperty("passageId"))
                                    if (!$util.isString(message.passageId))
                                        return "passageId: string expected";
                                if (message.partIndex != null && message.hasOwnProperty("partIndex"))
                                    if (!$util.isInteger(message.partIndex))
                                        return "partIndex: integer expected";
                                return null;
                            };
    
                            /**
                             * Creates a GroundingPassageId message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId} GroundingPassageId
                             */
                            GroundingPassageId.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId();
                                if (object.passageId != null)
                                    message.passageId = String(object.passageId);
                                if (object.partIndex != null)
                                    message.partIndex = object.partIndex | 0;
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a GroundingPassageId message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId} message GroundingPassageId
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            GroundingPassageId.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.defaults) {
                                    object.passageId = "";
                                    object.partIndex = 0;
                                }
                                if (message.passageId != null && message.hasOwnProperty("passageId"))
                                    object.passageId = message.passageId;
                                if (message.partIndex != null && message.hasOwnProperty("partIndex"))
                                    object.partIndex = message.partIndex;
                                return object;
                            };
    
                            /**
                             * Converts this GroundingPassageId to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            GroundingPassageId.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for GroundingPassageId
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            GroundingPassageId.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId";
                            };
    
                            return GroundingPassageId;
                        })();
    
                        AttributionSourceId.SemanticRetrieverChunk = (function() {
    
                            /**
                             * Properties of a SemanticRetrieverChunk.
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                             * @interface ISemanticRetrieverChunk
                             * @property {string|null} [source] SemanticRetrieverChunk source
                             * @property {string|null} [chunk] SemanticRetrieverChunk chunk
                             */
    
                            /**
                             * Constructs a new SemanticRetrieverChunk.
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId
                             * @classdesc Represents a SemanticRetrieverChunk.
                             * @implements ISemanticRetrieverChunk
                             * @constructor
                             * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk=} [properties] Properties to set
                             */
                            function SemanticRetrieverChunk(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * SemanticRetrieverChunk source.
                             * @member {string} source
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @instance
                             */
                            SemanticRetrieverChunk.prototype.source = "";
    
                            /**
                             * SemanticRetrieverChunk chunk.
                             * @member {string} chunk
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @instance
                             */
                            SemanticRetrieverChunk.prototype.chunk = "";
    
                            /**
                             * Creates a new SemanticRetrieverChunk instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk instance
                             */
                            SemanticRetrieverChunk.create = function create(properties) {
                                return new SemanticRetrieverChunk(properties);
                            };
    
                            /**
                             * Encodes the specified SemanticRetrieverChunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk} message SemanticRetrieverChunk message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            SemanticRetrieverChunk.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.source != null && Object.hasOwnProperty.call(message, "source"))
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.source);
                                if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk"))
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.chunk);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified SemanticRetrieverChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk} message SemanticRetrieverChunk message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            SemanticRetrieverChunk.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a SemanticRetrieverChunk message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            SemanticRetrieverChunk.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.source = reader.string();
                                            break;
                                        }
                                    case 2: {
                                            message.chunk = reader.string();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a SemanticRetrieverChunk message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            SemanticRetrieverChunk.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a SemanticRetrieverChunk message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            SemanticRetrieverChunk.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.source != null && message.hasOwnProperty("source"))
                                    if (!$util.isString(message.source))
                                        return "source: string expected";
                                if (message.chunk != null && message.hasOwnProperty("chunk"))
                                    if (!$util.isString(message.chunk))
                                        return "chunk: string expected";
                                return null;
                            };
    
                            /**
                             * Creates a SemanticRetrieverChunk message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk
                             */
                            SemanticRetrieverChunk.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk();
                                if (object.source != null)
                                    message.source = String(object.source);
                                if (object.chunk != null)
                                    message.chunk = String(object.chunk);
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a SemanticRetrieverChunk message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk} message SemanticRetrieverChunk
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            SemanticRetrieverChunk.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.defaults) {
                                    object.source = "";
                                    object.chunk = "";
                                }
                                if (message.source != null && message.hasOwnProperty("source"))
                                    object.source = message.source;
                                if (message.chunk != null && message.hasOwnProperty("chunk"))
                                    object.chunk = message.chunk;
                                return object;
                            };
    
                            /**
                             * Converts this SemanticRetrieverChunk to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            SemanticRetrieverChunk.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for SemanticRetrieverChunk
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            SemanticRetrieverChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk";
                            };
    
                            return SemanticRetrieverChunk;
                        })();
    
                        return AttributionSourceId;
                    })();
    
                    v1alpha.GroundingAttribution = (function() {
    
                        /**
                         * Properties of a GroundingAttribution.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGroundingAttribution
                         * @property {google.ai.generativelanguage.v1alpha.IAttributionSourceId|null} [sourceId] GroundingAttribution sourceId
                         * @property {google.ai.generativelanguage.v1alpha.IContent|null} [content] GroundingAttribution content
                         */
    
                        /**
                         * Constructs a new GroundingAttribution.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GroundingAttribution.
                         * @implements IGroundingAttribution
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingAttribution=} [properties] Properties to set
                         */
                        function GroundingAttribution(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingAttribution sourceId.
                         * @member {google.ai.generativelanguage.v1alpha.IAttributionSourceId|null|undefined} sourceId
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @instance
                         */
                        GroundingAttribution.prototype.sourceId = null;
    
                        /**
                         * GroundingAttribution content.
                         * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} content
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @instance
                         */
                        GroundingAttribution.prototype.content = null;
    
                        /**
                         * Creates a new GroundingAttribution instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingAttribution=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingAttribution} GroundingAttribution instance
                         */
                        GroundingAttribution.create = function create(properties) {
                            return new GroundingAttribution(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingAttribution message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingAttribution.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingAttribution} message GroundingAttribution message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingAttribution.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                $root.google.ai.generativelanguage.v1alpha.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.sourceId != null && Object.hasOwnProperty.call(message, "sourceId"))
                                $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.encode(message.sourceId, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingAttribution message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingAttribution.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingAttribution} message GroundingAttribution message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingAttribution.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingAttribution message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingAttribution} GroundingAttribution
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingAttribution.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GroundingAttribution();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.sourceId = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.content = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingAttribution message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingAttribution} GroundingAttribution
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingAttribution.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingAttribution message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingAttribution.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.sourceId != null && message.hasOwnProperty("sourceId")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.verify(message.sourceId);
                                if (error)
                                    return "sourceId." + error;
                            }
                            if (message.content != null && message.hasOwnProperty("content")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.content);
                                if (error)
                                    return "content." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingAttribution message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingAttribution} GroundingAttribution
                         */
                        GroundingAttribution.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingAttribution)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GroundingAttribution();
                            if (object.sourceId != null) {
                                if (typeof object.sourceId !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingAttribution.sourceId: object expected");
                                message.sourceId = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.fromObject(object.sourceId);
                            }
                            if (object.content != null) {
                                if (typeof object.content !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingAttribution.content: object expected");
                                message.content = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.content);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingAttribution message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GroundingAttribution} message GroundingAttribution
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingAttribution.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.content = null;
                                object.sourceId = null;
                            }
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.content, options);
                            if (message.sourceId != null && message.hasOwnProperty("sourceId"))
                                object.sourceId = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.toObject(message.sourceId, options);
                            return object;
                        };
    
                        /**
                         * Converts this GroundingAttribution to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingAttribution.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingAttribution
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingAttribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GroundingAttribution";
                        };
    
                        return GroundingAttribution;
                    })();
    
                    v1alpha.RetrievalMetadata = (function() {
    
                        /**
                         * Properties of a RetrievalMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IRetrievalMetadata
                         * @property {number|null} [googleSearchDynamicRetrievalScore] RetrievalMetadata googleSearchDynamicRetrievalScore
                         */
    
                        /**
                         * Constructs a new RetrievalMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a RetrievalMetadata.
                         * @implements IRetrievalMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IRetrievalMetadata=} [properties] Properties to set
                         */
                        function RetrievalMetadata(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * RetrievalMetadata googleSearchDynamicRetrievalScore.
                         * @member {number} googleSearchDynamicRetrievalScore
                         * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata
                         * @instance
                         */
                        RetrievalMetadata.prototype.googleSearchDynamicRetrievalScore = 0;
    
                        /**
                         * Creates a new RetrievalMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IRetrievalMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.RetrievalMetadata} RetrievalMetadata instance
                         */
                        RetrievalMetadata.create = function create(properties) {
                            return new RetrievalMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified RetrievalMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RetrievalMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IRetrievalMetadata} message RetrievalMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        RetrievalMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.googleSearchDynamicRetrievalScore != null && Object.hasOwnProperty.call(message, "googleSearchDynamicRetrievalScore"))
                                writer.uint32(/* id 2, wireType 5 =*/21).float(message.googleSearchDynamicRetrievalScore);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified RetrievalMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RetrievalMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IRetrievalMetadata} message RetrievalMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        RetrievalMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a RetrievalMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.RetrievalMetadata} RetrievalMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        RetrievalMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.googleSearchDynamicRetrievalScore = reader.float();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a RetrievalMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.RetrievalMetadata} RetrievalMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        RetrievalMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a RetrievalMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        RetrievalMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.googleSearchDynamicRetrievalScore != null && message.hasOwnProperty("googleSearchDynamicRetrievalScore"))
                                if (typeof message.googleSearchDynamicRetrievalScore !== "number")
                                    return "googleSearchDynamicRetrievalScore: number expected";
                            return null;
                        };
    
                        /**
                         * Creates a RetrievalMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.RetrievalMetadata} RetrievalMetadata
                         */
                        RetrievalMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata();
                            if (object.googleSearchDynamicRetrievalScore != null)
                                message.googleSearchDynamicRetrievalScore = Number(object.googleSearchDynamicRetrievalScore);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a RetrievalMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.RetrievalMetadata} message RetrievalMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        RetrievalMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.googleSearchDynamicRetrievalScore = 0;
                            if (message.googleSearchDynamicRetrievalScore != null && message.hasOwnProperty("googleSearchDynamicRetrievalScore"))
                                object.googleSearchDynamicRetrievalScore = options.json && !isFinite(message.googleSearchDynamicRetrievalScore) ? String(message.googleSearchDynamicRetrievalScore) : message.googleSearchDynamicRetrievalScore;
                            return object;
                        };
    
                        /**
                         * Converts this RetrievalMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        RetrievalMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for RetrievalMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        RetrievalMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.RetrievalMetadata";
                        };
    
                        return RetrievalMetadata;
                    })();
    
                    v1alpha.GroundingMetadata = (function() {
    
                        /**
                         * Properties of a GroundingMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGroundingMetadata
                         * @property {google.ai.generativelanguage.v1alpha.ISearchEntryPoint|null} [searchEntryPoint] GroundingMetadata searchEntryPoint
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IGroundingChunk>|null} [groundingChunks] GroundingMetadata groundingChunks
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IGroundingSupport>|null} [groundingSupports] GroundingMetadata groundingSupports
                         * @property {google.ai.generativelanguage.v1alpha.IRetrievalMetadata|null} [retrievalMetadata] GroundingMetadata retrievalMetadata
                         * @property {Array.<string>|null} [webSearchQueries] GroundingMetadata webSearchQueries
                         */
    
                        /**
                         * Constructs a new GroundingMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GroundingMetadata.
                         * @implements IGroundingMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingMetadata=} [properties] Properties to set
                         */
                        function GroundingMetadata(properties) {
                            this.groundingChunks = [];
                            this.groundingSupports = [];
                            this.webSearchQueries = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingMetadata searchEntryPoint.
                         * @member {google.ai.generativelanguage.v1alpha.ISearchEntryPoint|null|undefined} searchEntryPoint
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.searchEntryPoint = null;
    
                        /**
                         * GroundingMetadata groundingChunks.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IGroundingChunk>} groundingChunks
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.groundingChunks = $util.emptyArray;
    
                        /**
                         * GroundingMetadata groundingSupports.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IGroundingSupport>} groundingSupports
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.groundingSupports = $util.emptyArray;
    
                        /**
                         * GroundingMetadata retrievalMetadata.
                         * @member {google.ai.generativelanguage.v1alpha.IRetrievalMetadata|null|undefined} retrievalMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.retrievalMetadata = null;
    
                        /**
                         * GroundingMetadata webSearchQueries.
                         * @member {Array.<string>} webSearchQueries
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.webSearchQueries = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GroundingMetadata _searchEntryPoint.
                         * @member {"searchEntryPoint"|undefined} _searchEntryPoint
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @instance
                         */
                        Object.defineProperty(GroundingMetadata.prototype, "_searchEntryPoint", {
                            get: $util.oneOfGetter($oneOfFields = ["searchEntryPoint"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GroundingMetadata _retrievalMetadata.
                         * @member {"retrievalMetadata"|undefined} _retrievalMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @instance
                         */
                        Object.defineProperty(GroundingMetadata.prototype, "_retrievalMetadata", {
                            get: $util.oneOfGetter($oneOfFields = ["retrievalMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GroundingMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingMetadata} GroundingMetadata instance
                         */
                        GroundingMetadata.create = function create(properties) {
                            return new GroundingMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingMetadata} message GroundingMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.searchEntryPoint != null && Object.hasOwnProperty.call(message, "searchEntryPoint"))
                                $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint.encode(message.searchEntryPoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.groundingChunks != null && message.groundingChunks.length)
                                for (var i = 0; i < message.groundingChunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.GroundingChunk.encode(message.groundingChunks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.groundingSupports != null && message.groundingSupports.length)
                                for (var i = 0; i < message.groundingSupports.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.GroundingSupport.encode(message.groundingSupports[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.retrievalMetadata != null && Object.hasOwnProperty.call(message, "retrievalMetadata"))
                                $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata.encode(message.retrievalMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.webSearchQueries != null && message.webSearchQueries.length)
                                for (var i = 0; i < message.webSearchQueries.length; ++i)
                                    writer.uint32(/* id 5, wireType 2 =*/42).string(message.webSearchQueries[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingMetadata} message GroundingMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingMetadata} GroundingMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GroundingMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.searchEntryPoint = $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        if (!(message.groundingChunks && message.groundingChunks.length))
                                            message.groundingChunks = [];
                                        message.groundingChunks.push($root.google.ai.generativelanguage.v1alpha.GroundingChunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.groundingSupports && message.groundingSupports.length))
                                            message.groundingSupports = [];
                                        message.groundingSupports.push($root.google.ai.generativelanguage.v1alpha.GroundingSupport.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.retrievalMetadata = $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        if (!(message.webSearchQueries && message.webSearchQueries.length))
                                            message.webSearchQueries = [];
                                        message.webSearchQueries.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingMetadata} GroundingMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.searchEntryPoint != null && message.hasOwnProperty("searchEntryPoint")) {
                                properties._searchEntryPoint = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint.verify(message.searchEntryPoint);
                                    if (error)
                                        return "searchEntryPoint." + error;
                                }
                            }
                            if (message.groundingChunks != null && message.hasOwnProperty("groundingChunks")) {
                                if (!Array.isArray(message.groundingChunks))
                                    return "groundingChunks: array expected";
                                for (var i = 0; i < message.groundingChunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.verify(message.groundingChunks[i]);
                                    if (error)
                                        return "groundingChunks." + error;
                                }
                            }
                            if (message.groundingSupports != null && message.hasOwnProperty("groundingSupports")) {
                                if (!Array.isArray(message.groundingSupports))
                                    return "groundingSupports: array expected";
                                for (var i = 0; i < message.groundingSupports.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.GroundingSupport.verify(message.groundingSupports[i]);
                                    if (error)
                                        return "groundingSupports." + error;
                                }
                            }
                            if (message.retrievalMetadata != null && message.hasOwnProperty("retrievalMetadata")) {
                                properties._retrievalMetadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata.verify(message.retrievalMetadata);
                                    if (error)
                                        return "retrievalMetadata." + error;
                                }
                            }
                            if (message.webSearchQueries != null && message.hasOwnProperty("webSearchQueries")) {
                                if (!Array.isArray(message.webSearchQueries))
                                    return "webSearchQueries: array expected";
                                for (var i = 0; i < message.webSearchQueries.length; ++i)
                                    if (!$util.isString(message.webSearchQueries[i]))
                                        return "webSearchQueries: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingMetadata} GroundingMetadata
                         */
                        GroundingMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GroundingMetadata();
                            if (object.searchEntryPoint != null) {
                                if (typeof object.searchEntryPoint !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.searchEntryPoint: object expected");
                                message.searchEntryPoint = $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint.fromObject(object.searchEntryPoint);
                            }
                            if (object.groundingChunks) {
                                if (!Array.isArray(object.groundingChunks))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.groundingChunks: array expected");
                                message.groundingChunks = [];
                                for (var i = 0; i < object.groundingChunks.length; ++i) {
                                    if (typeof object.groundingChunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.groundingChunks: object expected");
                                    message.groundingChunks[i] = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.fromObject(object.groundingChunks[i]);
                                }
                            }
                            if (object.groundingSupports) {
                                if (!Array.isArray(object.groundingSupports))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.groundingSupports: array expected");
                                message.groundingSupports = [];
                                for (var i = 0; i < object.groundingSupports.length; ++i) {
                                    if (typeof object.groundingSupports[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.groundingSupports: object expected");
                                    message.groundingSupports[i] = $root.google.ai.generativelanguage.v1alpha.GroundingSupport.fromObject(object.groundingSupports[i]);
                                }
                            }
                            if (object.retrievalMetadata != null) {
                                if (typeof object.retrievalMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.retrievalMetadata: object expected");
                                message.retrievalMetadata = $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata.fromObject(object.retrievalMetadata);
                            }
                            if (object.webSearchQueries) {
                                if (!Array.isArray(object.webSearchQueries))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.webSearchQueries: array expected");
                                message.webSearchQueries = [];
                                for (var i = 0; i < object.webSearchQueries.length; ++i)
                                    message.webSearchQueries[i] = String(object.webSearchQueries[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GroundingMetadata} message GroundingMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.groundingChunks = [];
                                object.groundingSupports = [];
                                object.webSearchQueries = [];
                            }
                            if (message.searchEntryPoint != null && message.hasOwnProperty("searchEntryPoint")) {
                                object.searchEntryPoint = $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint.toObject(message.searchEntryPoint, options);
                                if (options.oneofs)
                                    object._searchEntryPoint = "searchEntryPoint";
                            }
                            if (message.groundingChunks && message.groundingChunks.length) {
                                object.groundingChunks = [];
                                for (var j = 0; j < message.groundingChunks.length; ++j)
                                    object.groundingChunks[j] = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.toObject(message.groundingChunks[j], options);
                            }
                            if (message.groundingSupports && message.groundingSupports.length) {
                                object.groundingSupports = [];
                                for (var j = 0; j < message.groundingSupports.length; ++j)
                                    object.groundingSupports[j] = $root.google.ai.generativelanguage.v1alpha.GroundingSupport.toObject(message.groundingSupports[j], options);
                            }
                            if (message.retrievalMetadata != null && message.hasOwnProperty("retrievalMetadata")) {
                                object.retrievalMetadata = $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata.toObject(message.retrievalMetadata, options);
                                if (options.oneofs)
                                    object._retrievalMetadata = "retrievalMetadata";
                            }
                            if (message.webSearchQueries && message.webSearchQueries.length) {
                                object.webSearchQueries = [];
                                for (var j = 0; j < message.webSearchQueries.length; ++j)
                                    object.webSearchQueries[j] = message.webSearchQueries[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GroundingMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GroundingMetadata";
                        };
    
                        return GroundingMetadata;
                    })();
    
                    v1alpha.SearchEntryPoint = (function() {
    
                        /**
                         * Properties of a SearchEntryPoint.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ISearchEntryPoint
                         * @property {string|null} [renderedContent] SearchEntryPoint renderedContent
                         * @property {Uint8Array|null} [sdkBlob] SearchEntryPoint sdkBlob
                         */
    
                        /**
                         * Constructs a new SearchEntryPoint.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a SearchEntryPoint.
                         * @implements ISearchEntryPoint
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ISearchEntryPoint=} [properties] Properties to set
                         */
                        function SearchEntryPoint(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SearchEntryPoint renderedContent.
                         * @member {string} renderedContent
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @instance
                         */
                        SearchEntryPoint.prototype.renderedContent = "";
    
                        /**
                         * SearchEntryPoint sdkBlob.
                         * @member {Uint8Array} sdkBlob
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @instance
                         */
                        SearchEntryPoint.prototype.sdkBlob = $util.newBuffer([]);
    
                        /**
                         * Creates a new SearchEntryPoint instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISearchEntryPoint=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.SearchEntryPoint} SearchEntryPoint instance
                         */
                        SearchEntryPoint.create = function create(properties) {
                            return new SearchEntryPoint(properties);
                        };
    
                        /**
                         * Encodes the specified SearchEntryPoint message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SearchEntryPoint.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISearchEntryPoint} message SearchEntryPoint message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SearchEntryPoint.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.renderedContent != null && Object.hasOwnProperty.call(message, "renderedContent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderedContent);
                            if (message.sdkBlob != null && Object.hasOwnProperty.call(message, "sdkBlob"))
                                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.sdkBlob);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SearchEntryPoint message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SearchEntryPoint.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISearchEntryPoint} message SearchEntryPoint message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SearchEntryPoint.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SearchEntryPoint message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.SearchEntryPoint} SearchEntryPoint
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SearchEntryPoint.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.renderedContent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.sdkBlob = reader.bytes();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SearchEntryPoint message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.SearchEntryPoint} SearchEntryPoint
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SearchEntryPoint.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SearchEntryPoint message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SearchEntryPoint.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.renderedContent != null && message.hasOwnProperty("renderedContent"))
                                if (!$util.isString(message.renderedContent))
                                    return "renderedContent: string expected";
                            if (message.sdkBlob != null && message.hasOwnProperty("sdkBlob"))
                                if (!(message.sdkBlob && typeof message.sdkBlob.length === "number" || $util.isString(message.sdkBlob)))
                                    return "sdkBlob: buffer expected";
                            return null;
                        };
    
                        /**
                         * Creates a SearchEntryPoint message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.SearchEntryPoint} SearchEntryPoint
                         */
                        SearchEntryPoint.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint();
                            if (object.renderedContent != null)
                                message.renderedContent = String(object.renderedContent);
                            if (object.sdkBlob != null)
                                if (typeof object.sdkBlob === "string")
                                    $util.base64.decode(object.sdkBlob, message.sdkBlob = $util.newBuffer($util.base64.length(object.sdkBlob)), 0);
                                else if (object.sdkBlob.length >= 0)
                                    message.sdkBlob = object.sdkBlob;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SearchEntryPoint message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.SearchEntryPoint} message SearchEntryPoint
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SearchEntryPoint.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.renderedContent = "";
                                if (options.bytes === String)
                                    object.sdkBlob = "";
                                else {
                                    object.sdkBlob = [];
                                    if (options.bytes !== Array)
                                        object.sdkBlob = $util.newBuffer(object.sdkBlob);
                                }
                            }
                            if (message.renderedContent != null && message.hasOwnProperty("renderedContent"))
                                object.renderedContent = message.renderedContent;
                            if (message.sdkBlob != null && message.hasOwnProperty("sdkBlob"))
                                object.sdkBlob = options.bytes === String ? $util.base64.encode(message.sdkBlob, 0, message.sdkBlob.length) : options.bytes === Array ? Array.prototype.slice.call(message.sdkBlob) : message.sdkBlob;
                            return object;
                        };
    
                        /**
                         * Converts this SearchEntryPoint to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SearchEntryPoint.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SearchEntryPoint
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SearchEntryPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SearchEntryPoint";
                        };
    
                        return SearchEntryPoint;
                    })();
    
                    v1alpha.GroundingChunk = (function() {
    
                        /**
                         * Properties of a GroundingChunk.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGroundingChunk
                         * @property {google.ai.generativelanguage.v1alpha.GroundingChunk.IWeb|null} [web] GroundingChunk web
                         */
    
                        /**
                         * Constructs a new GroundingChunk.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GroundingChunk.
                         * @implements IGroundingChunk
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingChunk=} [properties] Properties to set
                         */
                        function GroundingChunk(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingChunk web.
                         * @member {google.ai.generativelanguage.v1alpha.GroundingChunk.IWeb|null|undefined} web
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @instance
                         */
                        GroundingChunk.prototype.web = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GroundingChunk chunkType.
                         * @member {"web"|undefined} chunkType
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @instance
                         */
                        Object.defineProperty(GroundingChunk.prototype, "chunkType", {
                            get: $util.oneOfGetter($oneOfFields = ["web"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GroundingChunk instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingChunk=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk} GroundingChunk instance
                         */
                        GroundingChunk.create = function create(properties) {
                            return new GroundingChunk(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingChunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingChunk.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingChunk} message GroundingChunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingChunk.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.web != null && Object.hasOwnProperty.call(message, "web"))
                                $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web.encode(message.web, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingChunk.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingChunk} message GroundingChunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingChunk.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingChunk message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk} GroundingChunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingChunk.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GroundingChunk();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.web = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingChunk message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk} GroundingChunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingChunk.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingChunk message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingChunk.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.web != null && message.hasOwnProperty("web")) {
                                properties.chunkType = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web.verify(message.web);
                                    if (error)
                                        return "web." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingChunk message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk} GroundingChunk
                         */
                        GroundingChunk.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingChunk)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GroundingChunk();
                            if (object.web != null) {
                                if (typeof object.web !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingChunk.web: object expected");
                                message.web = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web.fromObject(object.web);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingChunk message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GroundingChunk} message GroundingChunk
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingChunk.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.web != null && message.hasOwnProperty("web")) {
                                object.web = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web.toObject(message.web, options);
                                if (options.oneofs)
                                    object.chunkType = "web";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GroundingChunk to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingChunk.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingChunk
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GroundingChunk";
                        };
    
                        GroundingChunk.Web = (function() {
    
                            /**
                             * Properties of a Web.
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                             * @interface IWeb
                             * @property {string|null} [uri] Web uri
                             * @property {string|null} [title] Web title
                             */
    
                            /**
                             * Constructs a new Web.
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk
                             * @classdesc Represents a Web.
                             * @implements IWeb
                             * @constructor
                             * @param {google.ai.generativelanguage.v1alpha.GroundingChunk.IWeb=} [properties] Properties to set
                             */
                            function Web(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * Web uri.
                             * @member {string|null|undefined} uri
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @instance
                             */
                            Web.prototype.uri = null;
    
                            /**
                             * Web title.
                             * @member {string|null|undefined} title
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @instance
                             */
                            Web.prototype.title = null;
    
                            // OneOf field names bound to virtual getters and setters
                            var $oneOfFields;
    
                            /**
                             * Web _uri.
                             * @member {"uri"|undefined} _uri
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @instance
                             */
                            Object.defineProperty(Web.prototype, "_uri", {
                                get: $util.oneOfGetter($oneOfFields = ["uri"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Web _title.
                             * @member {"title"|undefined} _title
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @instance
                             */
                            Object.defineProperty(Web.prototype, "_title", {
                                get: $util.oneOfGetter($oneOfFields = ["title"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Creates a new Web instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GroundingChunk.IWeb=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk.Web} Web instance
                             */
                            Web.create = function create(properties) {
                                return new Web(properties);
                            };
    
                            /**
                             * Encodes the specified Web message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingChunk.Web.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GroundingChunk.IWeb} message Web message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Web.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri);
                                if (message.title != null && Object.hasOwnProperty.call(message, "title"))
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.title);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified Web message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingChunk.Web.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GroundingChunk.IWeb} message Web message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Web.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a Web message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk.Web} Web
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Web.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.uri = reader.string();
                                            break;
                                        }
                                    case 2: {
                                            message.title = reader.string();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a Web message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk.Web} Web
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Web.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a Web message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            Web.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                var properties = {};
                                if (message.uri != null && message.hasOwnProperty("uri")) {
                                    properties._uri = 1;
                                    if (!$util.isString(message.uri))
                                        return "uri: string expected";
                                }
                                if (message.title != null && message.hasOwnProperty("title")) {
                                    properties._title = 1;
                                    if (!$util.isString(message.title))
                                        return "title: string expected";
                                }
                                return null;
                            };
    
                            /**
                             * Creates a Web message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk.Web} Web
                             */
                            Web.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web();
                                if (object.uri != null)
                                    message.uri = String(object.uri);
                                if (object.title != null)
                                    message.title = String(object.title);
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a Web message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GroundingChunk.Web} message Web
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            Web.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (message.uri != null && message.hasOwnProperty("uri")) {
                                    object.uri = message.uri;
                                    if (options.oneofs)
                                        object._uri = "uri";
                                }
                                if (message.title != null && message.hasOwnProperty("title")) {
                                    object.title = message.title;
                                    if (options.oneofs)
                                        object._title = "title";
                                }
                                return object;
                            };
    
                            /**
                             * Converts this Web to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            Web.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for Web
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            Web.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GroundingChunk.Web";
                            };
    
                            return Web;
                        })();
    
                        return GroundingChunk;
                    })();
    
                    v1alpha.Segment = (function() {
    
                        /**
                         * Properties of a Segment.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ISegment
                         * @property {number|null} [partIndex] Segment partIndex
                         * @property {number|null} [startIndex] Segment startIndex
                         * @property {number|null} [endIndex] Segment endIndex
                         * @property {string|null} [text] Segment text
                         */
    
                        /**
                         * Constructs a new Segment.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Segment.
                         * @implements ISegment
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ISegment=} [properties] Properties to set
                         */
                        function Segment(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Segment partIndex.
                         * @member {number} partIndex
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @instance
                         */
                        Segment.prototype.partIndex = 0;
    
                        /**
                         * Segment startIndex.
                         * @member {number} startIndex
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @instance
                         */
                        Segment.prototype.startIndex = 0;
    
                        /**
                         * Segment endIndex.
                         * @member {number} endIndex
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @instance
                         */
                        Segment.prototype.endIndex = 0;
    
                        /**
                         * Segment text.
                         * @member {string} text
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @instance
                         */
                        Segment.prototype.text = "";
    
                        /**
                         * Creates a new Segment instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISegment=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Segment} Segment instance
                         */
                        Segment.create = function create(properties) {
                            return new Segment(properties);
                        };
    
                        /**
                         * Encodes the specified Segment message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Segment.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISegment} message Segment message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Segment.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.partIndex != null && Object.hasOwnProperty.call(message, "partIndex"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.partIndex);
                            if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.startIndex);
                            if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.endIndex);
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Segment message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Segment.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ISegment} message Segment message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Segment.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Segment message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Segment} Segment
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Segment.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Segment();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.partIndex = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.startIndex = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.endIndex = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Segment message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Segment} Segment
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Segment.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Segment message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Segment.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.partIndex != null && message.hasOwnProperty("partIndex"))
                                if (!$util.isInteger(message.partIndex))
                                    return "partIndex: integer expected";
                            if (message.startIndex != null && message.hasOwnProperty("startIndex"))
                                if (!$util.isInteger(message.startIndex))
                                    return "startIndex: integer expected";
                            if (message.endIndex != null && message.hasOwnProperty("endIndex"))
                                if (!$util.isInteger(message.endIndex))
                                    return "endIndex: integer expected";
                            if (message.text != null && message.hasOwnProperty("text"))
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a Segment message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Segment} Segment
                         */
                        Segment.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Segment)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Segment();
                            if (object.partIndex != null)
                                message.partIndex = object.partIndex | 0;
                            if (object.startIndex != null)
                                message.startIndex = object.startIndex | 0;
                            if (object.endIndex != null)
                                message.endIndex = object.endIndex | 0;
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Segment message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Segment} message Segment
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Segment.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.partIndex = 0;
                                object.startIndex = 0;
                                object.endIndex = 0;
                                object.text = "";
                            }
                            if (message.partIndex != null && message.hasOwnProperty("partIndex"))
                                object.partIndex = message.partIndex;
                            if (message.startIndex != null && message.hasOwnProperty("startIndex"))
                                object.startIndex = message.startIndex;
                            if (message.endIndex != null && message.hasOwnProperty("endIndex"))
                                object.endIndex = message.endIndex;
                            if (message.text != null && message.hasOwnProperty("text"))
                                object.text = message.text;
                            return object;
                        };
    
                        /**
                         * Converts this Segment to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Segment.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Segment
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Segment
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Segment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Segment";
                        };
    
                        return Segment;
                    })();
    
                    v1alpha.GroundingSupport = (function() {
    
                        /**
                         * Properties of a GroundingSupport.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGroundingSupport
                         * @property {google.ai.generativelanguage.v1alpha.ISegment|null} [segment] GroundingSupport segment
                         * @property {Array.<number>|null} [groundingChunkIndices] GroundingSupport groundingChunkIndices
                         * @property {Array.<number>|null} [confidenceScores] GroundingSupport confidenceScores
                         */
    
                        /**
                         * Constructs a new GroundingSupport.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GroundingSupport.
                         * @implements IGroundingSupport
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingSupport=} [properties] Properties to set
                         */
                        function GroundingSupport(properties) {
                            this.groundingChunkIndices = [];
                            this.confidenceScores = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingSupport segment.
                         * @member {google.ai.generativelanguage.v1alpha.ISegment|null|undefined} segment
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @instance
                         */
                        GroundingSupport.prototype.segment = null;
    
                        /**
                         * GroundingSupport groundingChunkIndices.
                         * @member {Array.<number>} groundingChunkIndices
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @instance
                         */
                        GroundingSupport.prototype.groundingChunkIndices = $util.emptyArray;
    
                        /**
                         * GroundingSupport confidenceScores.
                         * @member {Array.<number>} confidenceScores
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @instance
                         */
                        GroundingSupport.prototype.confidenceScores = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GroundingSupport _segment.
                         * @member {"segment"|undefined} _segment
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @instance
                         */
                        Object.defineProperty(GroundingSupport.prototype, "_segment", {
                            get: $util.oneOfGetter($oneOfFields = ["segment"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GroundingSupport instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingSupport=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingSupport} GroundingSupport instance
                         */
                        GroundingSupport.create = function create(properties) {
                            return new GroundingSupport(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingSupport message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingSupport.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingSupport} message GroundingSupport message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingSupport.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.segment != null && Object.hasOwnProperty.call(message, "segment"))
                                $root.google.ai.generativelanguage.v1alpha.Segment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.groundingChunkIndices != null && message.groundingChunkIndices.length) {
                                writer.uint32(/* id 2, wireType 2 =*/18).fork();
                                for (var i = 0; i < message.groundingChunkIndices.length; ++i)
                                    writer.int32(message.groundingChunkIndices[i]);
                                writer.ldelim();
                            }
                            if (message.confidenceScores != null && message.confidenceScores.length) {
                                writer.uint32(/* id 3, wireType 2 =*/26).fork();
                                for (var i = 0; i < message.confidenceScores.length; ++i)
                                    writer.float(message.confidenceScores[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingSupport message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingSupport.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGroundingSupport} message GroundingSupport message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingSupport.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingSupport message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingSupport} GroundingSupport
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingSupport.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GroundingSupport();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.segment = $root.google.ai.generativelanguage.v1alpha.Segment.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        if (!(message.groundingChunkIndices && message.groundingChunkIndices.length))
                                            message.groundingChunkIndices = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.groundingChunkIndices.push(reader.int32());
                                        } else
                                            message.groundingChunkIndices.push(reader.int32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.confidenceScores && message.confidenceScores.length))
                                            message.confidenceScores = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.confidenceScores.push(reader.float());
                                        } else
                                            message.confidenceScores.push(reader.float());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingSupport message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingSupport} GroundingSupport
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingSupport.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingSupport message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingSupport.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.segment != null && message.hasOwnProperty("segment")) {
                                properties._segment = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Segment.verify(message.segment);
                                    if (error)
                                        return "segment." + error;
                                }
                            }
                            if (message.groundingChunkIndices != null && message.hasOwnProperty("groundingChunkIndices")) {
                                if (!Array.isArray(message.groundingChunkIndices))
                                    return "groundingChunkIndices: array expected";
                                for (var i = 0; i < message.groundingChunkIndices.length; ++i)
                                    if (!$util.isInteger(message.groundingChunkIndices[i]))
                                        return "groundingChunkIndices: integer[] expected";
                            }
                            if (message.confidenceScores != null && message.hasOwnProperty("confidenceScores")) {
                                if (!Array.isArray(message.confidenceScores))
                                    return "confidenceScores: array expected";
                                for (var i = 0; i < message.confidenceScores.length; ++i)
                                    if (typeof message.confidenceScores[i] !== "number")
                                        return "confidenceScores: number[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingSupport message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GroundingSupport} GroundingSupport
                         */
                        GroundingSupport.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingSupport)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GroundingSupport();
                            if (object.segment != null) {
                                if (typeof object.segment !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingSupport.segment: object expected");
                                message.segment = $root.google.ai.generativelanguage.v1alpha.Segment.fromObject(object.segment);
                            }
                            if (object.groundingChunkIndices) {
                                if (!Array.isArray(object.groundingChunkIndices))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingSupport.groundingChunkIndices: array expected");
                                message.groundingChunkIndices = [];
                                for (var i = 0; i < object.groundingChunkIndices.length; ++i)
                                    message.groundingChunkIndices[i] = object.groundingChunkIndices[i] | 0;
                            }
                            if (object.confidenceScores) {
                                if (!Array.isArray(object.confidenceScores))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingSupport.confidenceScores: array expected");
                                message.confidenceScores = [];
                                for (var i = 0; i < object.confidenceScores.length; ++i)
                                    message.confidenceScores[i] = Number(object.confidenceScores[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingSupport message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GroundingSupport} message GroundingSupport
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingSupport.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.groundingChunkIndices = [];
                                object.confidenceScores = [];
                            }
                            if (message.segment != null && message.hasOwnProperty("segment")) {
                                object.segment = $root.google.ai.generativelanguage.v1alpha.Segment.toObject(message.segment, options);
                                if (options.oneofs)
                                    object._segment = "segment";
                            }
                            if (message.groundingChunkIndices && message.groundingChunkIndices.length) {
                                object.groundingChunkIndices = [];
                                for (var j = 0; j < message.groundingChunkIndices.length; ++j)
                                    object.groundingChunkIndices[j] = message.groundingChunkIndices[j];
                            }
                            if (message.confidenceScores && message.confidenceScores.length) {
                                object.confidenceScores = [];
                                for (var j = 0; j < message.confidenceScores.length; ++j)
                                    object.confidenceScores[j] = options.json && !isFinite(message.confidenceScores[j]) ? String(message.confidenceScores[j]) : message.confidenceScores[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GroundingSupport to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingSupport.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingSupport
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GroundingSupport";
                        };
    
                        return GroundingSupport;
                    })();
    
                    v1alpha.GenerateAnswerRequest = (function() {
    
                        /**
                         * Properties of a GenerateAnswerRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGenerateAnswerRequest
                         * @property {google.ai.generativelanguage.v1alpha.IGroundingPassages|null} [inlinePassages] GenerateAnswerRequest inlinePassages
                         * @property {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig|null} [semanticRetriever] GenerateAnswerRequest semanticRetriever
                         * @property {string|null} [model] GenerateAnswerRequest model
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IContent>|null} [contents] GenerateAnswerRequest contents
                         * @property {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle|null} [answerStyle] GenerateAnswerRequest answerStyle
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ISafetySetting>|null} [safetySettings] GenerateAnswerRequest safetySettings
                         * @property {number|null} [temperature] GenerateAnswerRequest temperature
                         */
    
                        /**
                         * Constructs a new GenerateAnswerRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GenerateAnswerRequest.
                         * @implements IGenerateAnswerRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest=} [properties] Properties to set
                         */
                        function GenerateAnswerRequest(properties) {
                            this.contents = [];
                            this.safetySettings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateAnswerRequest inlinePassages.
                         * @member {google.ai.generativelanguage.v1alpha.IGroundingPassages|null|undefined} inlinePassages
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.inlinePassages = null;
    
                        /**
                         * GenerateAnswerRequest semanticRetriever.
                         * @member {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig|null|undefined} semanticRetriever
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.semanticRetriever = null;
    
                        /**
                         * GenerateAnswerRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.model = "";
    
                        /**
                         * GenerateAnswerRequest contents.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IContent>} contents
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.contents = $util.emptyArray;
    
                        /**
                         * GenerateAnswerRequest answerStyle.
                         * @member {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle} answerStyle
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.answerStyle = 0;
    
                        /**
                         * GenerateAnswerRequest safetySettings.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ISafetySetting>} safetySettings
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.safetySettings = $util.emptyArray;
    
                        /**
                         * GenerateAnswerRequest temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.temperature = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateAnswerRequest groundingSource.
                         * @member {"inlinePassages"|"semanticRetriever"|undefined} groundingSource
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateAnswerRequest.prototype, "groundingSource", {
                            get: $util.oneOfGetter($oneOfFields = ["inlinePassages", "semanticRetriever"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateAnswerRequest _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateAnswerRequest.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateAnswerRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest} GenerateAnswerRequest instance
                         */
                        GenerateAnswerRequest.create = function create(properties) {
                            return new GenerateAnswerRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateAnswerRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest} message GenerateAnswerRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateAnswerRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.contents != null && message.contents.length)
                                for (var i = 0; i < message.contents.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.safetySettings != null && message.safetySettings.length)
                                for (var i = 0; i < message.safetySettings.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 4, wireType 5 =*/37).float(message.temperature);
                            if (message.answerStyle != null && Object.hasOwnProperty.call(message, "answerStyle"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.answerStyle);
                            if (message.inlinePassages != null && Object.hasOwnProperty.call(message, "inlinePassages"))
                                $root.google.ai.generativelanguage.v1alpha.GroundingPassages.encode(message.inlinePassages, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.semanticRetriever != null && Object.hasOwnProperty.call(message, "semanticRetriever"))
                                $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.encode(message.semanticRetriever, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateAnswerRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest} message GenerateAnswerRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateAnswerRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateAnswerRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest} GenerateAnswerRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateAnswerRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 6: {
                                        message.inlinePassages = $root.google.ai.generativelanguage.v1alpha.GroundingPassages.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 7: {
                                        message.semanticRetriever = $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.contents && message.contents.length))
                                            message.contents = [];
                                        message.contents.push($root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 5: {
                                        message.answerStyle = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        if (!(message.safetySettings && message.safetySettings.length))
                                            message.safetySettings = [];
                                        message.safetySettings.push($root.google.ai.generativelanguage.v1alpha.SafetySetting.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateAnswerRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest} GenerateAnswerRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateAnswerRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateAnswerRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateAnswerRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.inlinePassages != null && message.hasOwnProperty("inlinePassages")) {
                                properties.groundingSource = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.GroundingPassages.verify(message.inlinePassages);
                                    if (error)
                                        return "inlinePassages." + error;
                                }
                            }
                            if (message.semanticRetriever != null && message.hasOwnProperty("semanticRetriever")) {
                                if (properties.groundingSource === 1)
                                    return "groundingSource: multiple values";
                                properties.groundingSource = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.verify(message.semanticRetriever);
                                    if (error)
                                        return "semanticRetriever." + error;
                                }
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.contents != null && message.hasOwnProperty("contents")) {
                                if (!Array.isArray(message.contents))
                                    return "contents: array expected";
                                for (var i = 0; i < message.contents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.contents[i]);
                                    if (error)
                                        return "contents." + error;
                                }
                            }
                            if (message.answerStyle != null && message.hasOwnProperty("answerStyle"))
                                switch (message.answerStyle) {
                                default:
                                    return "answerStyle: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) {
                                if (!Array.isArray(message.safetySettings))
                                    return "safetySettings: array expected";
                                for (var i = 0; i < message.safetySettings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.SafetySetting.verify(message.safetySettings[i]);
                                    if (error)
                                        return "safetySettings." + error;
                                }
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateAnswerRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest} GenerateAnswerRequest
                         */
                        GenerateAnswerRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest();
                            if (object.inlinePassages != null) {
                                if (typeof object.inlinePassages !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.inlinePassages: object expected");
                                message.inlinePassages = $root.google.ai.generativelanguage.v1alpha.GroundingPassages.fromObject(object.inlinePassages);
                            }
                            if (object.semanticRetriever != null) {
                                if (typeof object.semanticRetriever !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.semanticRetriever: object expected");
                                message.semanticRetriever = $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.fromObject(object.semanticRetriever);
                            }
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.contents) {
                                if (!Array.isArray(object.contents))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.contents: array expected");
                                message.contents = [];
                                for (var i = 0; i < object.contents.length; ++i) {
                                    if (typeof object.contents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.contents: object expected");
                                    message.contents[i] = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.contents[i]);
                                }
                            }
                            switch (object.answerStyle) {
                            default:
                                if (typeof object.answerStyle === "number") {
                                    message.answerStyle = object.answerStyle;
                                    break;
                                }
                                break;
                            case "ANSWER_STYLE_UNSPECIFIED":
                            case 0:
                                message.answerStyle = 0;
                                break;
                            case "ABSTRACTIVE":
                            case 1:
                                message.answerStyle = 1;
                                break;
                            case "EXTRACTIVE":
                            case 2:
                                message.answerStyle = 2;
                                break;
                            case "VERBOSE":
                            case 3:
                                message.answerStyle = 3;
                                break;
                            }
                            if (object.safetySettings) {
                                if (!Array.isArray(object.safetySettings))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.safetySettings: array expected");
                                message.safetySettings = [];
                                for (var i = 0; i < object.safetySettings.length; ++i) {
                                    if (typeof object.safetySettings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.safetySettings: object expected");
                                    message.safetySettings[i] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.fromObject(object.safetySettings[i]);
                                }
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateAnswerRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest} message GenerateAnswerRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateAnswerRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.contents = [];
                                object.safetySettings = [];
                            }
                            if (options.defaults) {
                                object.model = "";
                                object.answerStyle = options.enums === String ? "ANSWER_STYLE_UNSPECIFIED" : 0;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.contents && message.contents.length) {
                                object.contents = [];
                                for (var j = 0; j < message.contents.length; ++j)
                                    object.contents[j] = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.contents[j], options);
                            }
                            if (message.safetySettings && message.safetySettings.length) {
                                object.safetySettings = [];
                                for (var j = 0; j < message.safetySettings.length; ++j)
                                    object.safetySettings[j] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.toObject(message.safetySettings[j], options);
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.answerStyle != null && message.hasOwnProperty("answerStyle"))
                                object.answerStyle = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle[message.answerStyle] === undefined ? message.answerStyle : $root.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle[message.answerStyle] : message.answerStyle;
                            if (message.inlinePassages != null && message.hasOwnProperty("inlinePassages")) {
                                object.inlinePassages = $root.google.ai.generativelanguage.v1alpha.GroundingPassages.toObject(message.inlinePassages, options);
                                if (options.oneofs)
                                    object.groundingSource = "inlinePassages";
                            }
                            if (message.semanticRetriever != null && message.hasOwnProperty("semanticRetriever")) {
                                object.semanticRetriever = $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.toObject(message.semanticRetriever, options);
                                if (options.oneofs)
                                    object.groundingSource = "semanticRetriever";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateAnswerRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateAnswerRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateAnswerRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateAnswerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateAnswerRequest";
                        };
    
                        /**
                         * AnswerStyle enum.
                         * @name google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle
                         * @enum {number}
                         * @property {number} ANSWER_STYLE_UNSPECIFIED=0 ANSWER_STYLE_UNSPECIFIED value
                         * @property {number} ABSTRACTIVE=1 ABSTRACTIVE value
                         * @property {number} EXTRACTIVE=2 EXTRACTIVE value
                         * @property {number} VERBOSE=3 VERBOSE value
                         */
                        GenerateAnswerRequest.AnswerStyle = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "ANSWER_STYLE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "ABSTRACTIVE"] = 1;
                            values[valuesById[2] = "EXTRACTIVE"] = 2;
                            values[valuesById[3] = "VERBOSE"] = 3;
                            return values;
                        })();
    
                        return GenerateAnswerRequest;
                    })();
    
                    v1alpha.GenerateAnswerResponse = (function() {
    
                        /**
                         * Properties of a GenerateAnswerResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGenerateAnswerResponse
                         * @property {google.ai.generativelanguage.v1alpha.ICandidate|null} [answer] GenerateAnswerResponse answer
                         * @property {number|null} [answerableProbability] GenerateAnswerResponse answerableProbability
                         * @property {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback|null} [inputFeedback] GenerateAnswerResponse inputFeedback
                         */
    
                        /**
                         * Constructs a new GenerateAnswerResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GenerateAnswerResponse.
                         * @implements IGenerateAnswerResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse=} [properties] Properties to set
                         */
                        function GenerateAnswerResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateAnswerResponse answer.
                         * @member {google.ai.generativelanguage.v1alpha.ICandidate|null|undefined} answer
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @instance
                         */
                        GenerateAnswerResponse.prototype.answer = null;
    
                        /**
                         * GenerateAnswerResponse answerableProbability.
                         * @member {number|null|undefined} answerableProbability
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @instance
                         */
                        GenerateAnswerResponse.prototype.answerableProbability = null;
    
                        /**
                         * GenerateAnswerResponse inputFeedback.
                         * @member {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback|null|undefined} inputFeedback
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @instance
                         */
                        GenerateAnswerResponse.prototype.inputFeedback = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateAnswerResponse _answerableProbability.
                         * @member {"answerableProbability"|undefined} _answerableProbability
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @instance
                         */
                        Object.defineProperty(GenerateAnswerResponse.prototype, "_answerableProbability", {
                            get: $util.oneOfGetter($oneOfFields = ["answerableProbability"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateAnswerResponse _inputFeedback.
                         * @member {"inputFeedback"|undefined} _inputFeedback
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @instance
                         */
                        Object.defineProperty(GenerateAnswerResponse.prototype, "_inputFeedback", {
                            get: $util.oneOfGetter($oneOfFields = ["inputFeedback"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateAnswerResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} GenerateAnswerResponse instance
                         */
                        GenerateAnswerResponse.create = function create(properties) {
                            return new GenerateAnswerResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateAnswerResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse} message GenerateAnswerResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateAnswerResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.answer != null && Object.hasOwnProperty.call(message, "answer"))
                                $root.google.ai.generativelanguage.v1alpha.Candidate.encode(message.answer, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.answerableProbability != null && Object.hasOwnProperty.call(message, "answerableProbability"))
                                writer.uint32(/* id 2, wireType 5 =*/21).float(message.answerableProbability);
                            if (message.inputFeedback != null && Object.hasOwnProperty.call(message, "inputFeedback"))
                                $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.encode(message.inputFeedback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateAnswerResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse} message GenerateAnswerResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateAnswerResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateAnswerResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} GenerateAnswerResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateAnswerResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.answer = $root.google.ai.generativelanguage.v1alpha.Candidate.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.answerableProbability = reader.float();
                                        break;
                                    }
                                case 3: {
                                        message.inputFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateAnswerResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} GenerateAnswerResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateAnswerResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateAnswerResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateAnswerResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.answer != null && message.hasOwnProperty("answer")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Candidate.verify(message.answer);
                                if (error)
                                    return "answer." + error;
                            }
                            if (message.answerableProbability != null && message.hasOwnProperty("answerableProbability")) {
                                properties._answerableProbability = 1;
                                if (typeof message.answerableProbability !== "number")
                                    return "answerableProbability: number expected";
                            }
                            if (message.inputFeedback != null && message.hasOwnProperty("inputFeedback")) {
                                properties._inputFeedback = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.verify(message.inputFeedback);
                                    if (error)
                                        return "inputFeedback." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateAnswerResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} GenerateAnswerResponse
                         */
                        GenerateAnswerResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse();
                            if (object.answer != null) {
                                if (typeof object.answer !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.answer: object expected");
                                message.answer = $root.google.ai.generativelanguage.v1alpha.Candidate.fromObject(object.answer);
                            }
                            if (object.answerableProbability != null)
                                message.answerableProbability = Number(object.answerableProbability);
                            if (object.inputFeedback != null) {
                                if (typeof object.inputFeedback !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.inputFeedback: object expected");
                                message.inputFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.fromObject(object.inputFeedback);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateAnswerResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} message GenerateAnswerResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateAnswerResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.answer = null;
                            if (message.answer != null && message.hasOwnProperty("answer"))
                                object.answer = $root.google.ai.generativelanguage.v1alpha.Candidate.toObject(message.answer, options);
                            if (message.answerableProbability != null && message.hasOwnProperty("answerableProbability")) {
                                object.answerableProbability = options.json && !isFinite(message.answerableProbability) ? String(message.answerableProbability) : message.answerableProbability;
                                if (options.oneofs)
                                    object._answerableProbability = "answerableProbability";
                            }
                            if (message.inputFeedback != null && message.hasOwnProperty("inputFeedback")) {
                                object.inputFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.toObject(message.inputFeedback, options);
                                if (options.oneofs)
                                    object._inputFeedback = "inputFeedback";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateAnswerResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateAnswerResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateAnswerResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateAnswerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateAnswerResponse";
                        };
    
                        GenerateAnswerResponse.InputFeedback = (function() {
    
                            /**
                             * Properties of an InputFeedback.
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                             * @interface IInputFeedback
                             * @property {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason|null} [blockReason] InputFeedback blockReason
                             * @property {Array.<google.ai.generativelanguage.v1alpha.ISafetyRating>|null} [safetyRatings] InputFeedback safetyRatings
                             */
    
                            /**
                             * Constructs a new InputFeedback.
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse
                             * @classdesc Represents an InputFeedback.
                             * @implements IInputFeedback
                             * @constructor
                             * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback=} [properties] Properties to set
                             */
                            function InputFeedback(properties) {
                                this.safetyRatings = [];
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * InputFeedback blockReason.
                             * @member {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason|null|undefined} blockReason
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @instance
                             */
                            InputFeedback.prototype.blockReason = null;
    
                            /**
                             * InputFeedback safetyRatings.
                             * @member {Array.<google.ai.generativelanguage.v1alpha.ISafetyRating>} safetyRatings
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @instance
                             */
                            InputFeedback.prototype.safetyRatings = $util.emptyArray;
    
                            // OneOf field names bound to virtual getters and setters
                            var $oneOfFields;
    
                            /**
                             * InputFeedback _blockReason.
                             * @member {"blockReason"|undefined} _blockReason
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @instance
                             */
                            Object.defineProperty(InputFeedback.prototype, "_blockReason", {
                                get: $util.oneOfGetter($oneOfFields = ["blockReason"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Creates a new InputFeedback instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback} InputFeedback instance
                             */
                            InputFeedback.create = function create(properties) {
                                return new InputFeedback(properties);
                            };
    
                            /**
                             * Encodes the specified InputFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback} message InputFeedback message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            InputFeedback.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.blockReason != null && Object.hasOwnProperty.call(message, "blockReason"))
                                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.blockReason);
                                if (message.safetyRatings != null && message.safetyRatings.length)
                                    for (var i = 0; i < message.safetyRatings.length; ++i)
                                        $root.google.ai.generativelanguage.v1alpha.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                                return writer;
                            };
    
                            /**
                             * Encodes the specified InputFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback} message InputFeedback message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            InputFeedback.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes an InputFeedback message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback} InputFeedback
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            InputFeedback.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.blockReason = reader.int32();
                                            break;
                                        }
                                    case 2: {
                                            if (!(message.safetyRatings && message.safetyRatings.length))
                                                message.safetyRatings = [];
                                            message.safetyRatings.push($root.google.ai.generativelanguage.v1alpha.SafetyRating.decode(reader, reader.uint32()));
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes an InputFeedback message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback} InputFeedback
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            InputFeedback.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies an InputFeedback message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            InputFeedback.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                var properties = {};
                                if (message.blockReason != null && message.hasOwnProperty("blockReason")) {
                                    properties._blockReason = 1;
                                    switch (message.blockReason) {
                                    default:
                                        return "blockReason: enum value expected";
                                    case 0:
                                    case 1:
                                    case 2:
                                        break;
                                    }
                                }
                                if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                    if (!Array.isArray(message.safetyRatings))
                                        return "safetyRatings: array expected";
                                    for (var i = 0; i < message.safetyRatings.length; ++i) {
                                        var error = $root.google.ai.generativelanguage.v1alpha.SafetyRating.verify(message.safetyRatings[i]);
                                        if (error)
                                            return "safetyRatings." + error;
                                    }
                                }
                                return null;
                            };
    
                            /**
                             * Creates an InputFeedback message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback} InputFeedback
                             */
                            InputFeedback.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback();
                                switch (object.blockReason) {
                                default:
                                    if (typeof object.blockReason === "number") {
                                        message.blockReason = object.blockReason;
                                        break;
                                    }
                                    break;
                                case "BLOCK_REASON_UNSPECIFIED":
                                case 0:
                                    message.blockReason = 0;
                                    break;
                                case "SAFETY":
                                case 1:
                                    message.blockReason = 1;
                                    break;
                                case "OTHER":
                                case 2:
                                    message.blockReason = 2;
                                    break;
                                }
                                if (object.safetyRatings) {
                                    if (!Array.isArray(object.safetyRatings))
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.safetyRatings: array expected");
                                    message.safetyRatings = [];
                                    for (var i = 0; i < object.safetyRatings.length; ++i) {
                                        if (typeof object.safetyRatings[i] !== "object")
                                            throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.safetyRatings: object expected");
                                        message.safetyRatings[i] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.fromObject(object.safetyRatings[i]);
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Creates a plain object from an InputFeedback message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback} message InputFeedback
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            InputFeedback.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.arrays || options.defaults)
                                    object.safetyRatings = [];
                                if (message.blockReason != null && message.hasOwnProperty("blockReason")) {
                                    object.blockReason = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason[message.blockReason] === undefined ? message.blockReason : $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason[message.blockReason] : message.blockReason;
                                    if (options.oneofs)
                                        object._blockReason = "blockReason";
                                }
                                if (message.safetyRatings && message.safetyRatings.length) {
                                    object.safetyRatings = [];
                                    for (var j = 0; j < message.safetyRatings.length; ++j)
                                        object.safetyRatings[j] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.toObject(message.safetyRatings[j], options);
                                }
                                return object;
                            };
    
                            /**
                             * Converts this InputFeedback to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            InputFeedback.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for InputFeedback
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            InputFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback";
                            };
    
                            /**
                             * BlockReason enum.
                             * @name google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason
                             * @enum {number}
                             * @property {number} BLOCK_REASON_UNSPECIFIED=0 BLOCK_REASON_UNSPECIFIED value
                             * @property {number} SAFETY=1 SAFETY value
                             * @property {number} OTHER=2 OTHER value
                             */
                            InputFeedback.BlockReason = (function() {
                                var valuesById = {}, values = Object.create(valuesById);
                                values[valuesById[0] = "BLOCK_REASON_UNSPECIFIED"] = 0;
                                values[valuesById[1] = "SAFETY"] = 1;
                                values[valuesById[2] = "OTHER"] = 2;
                                return values;
                            })();
    
                            return InputFeedback;
                        })();
    
                        return GenerateAnswerResponse;
                    })();
    
                    v1alpha.EmbedContentRequest = (function() {
    
                        /**
                         * Properties of an EmbedContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IEmbedContentRequest
                         * @property {string|null} [model] EmbedContentRequest model
                         * @property {google.ai.generativelanguage.v1alpha.IContent|null} [content] EmbedContentRequest content
                         * @property {google.ai.generativelanguage.v1alpha.TaskType|null} [taskType] EmbedContentRequest taskType
                         * @property {string|null} [title] EmbedContentRequest title
                         * @property {number|null} [outputDimensionality] EmbedContentRequest outputDimensionality
                         */
    
                        /**
                         * Constructs a new EmbedContentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an EmbedContentRequest.
                         * @implements IEmbedContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest=} [properties] Properties to set
                         */
                        function EmbedContentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedContentRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.model = "";
    
                        /**
                         * EmbedContentRequest content.
                         * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} content
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.content = null;
    
                        /**
                         * EmbedContentRequest taskType.
                         * @member {google.ai.generativelanguage.v1alpha.TaskType|null|undefined} taskType
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.taskType = null;
    
                        /**
                         * EmbedContentRequest title.
                         * @member {string|null|undefined} title
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.title = null;
    
                        /**
                         * EmbedContentRequest outputDimensionality.
                         * @member {number|null|undefined} outputDimensionality
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.outputDimensionality = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * EmbedContentRequest _taskType.
                         * @member {"taskType"|undefined} _taskType
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @instance
                         */
                        Object.defineProperty(EmbedContentRequest.prototype, "_taskType", {
                            get: $util.oneOfGetter($oneOfFields = ["taskType"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * EmbedContentRequest _title.
                         * @member {"title"|undefined} _title
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @instance
                         */
                        Object.defineProperty(EmbedContentRequest.prototype, "_title", {
                            get: $util.oneOfGetter($oneOfFields = ["title"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * EmbedContentRequest _outputDimensionality.
                         * @member {"outputDimensionality"|undefined} _outputDimensionality
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @instance
                         */
                        Object.defineProperty(EmbedContentRequest.prototype, "_outputDimensionality", {
                            get: $util.oneOfGetter($oneOfFields = ["outputDimensionality"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new EmbedContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedContentRequest} EmbedContentRequest instance
                         */
                        EmbedContentRequest.create = function create(properties) {
                            return new EmbedContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest} message EmbedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                $root.google.ai.generativelanguage.v1alpha.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.taskType != null && Object.hasOwnProperty.call(message, "taskType"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.taskType);
                            if (message.title != null && Object.hasOwnProperty.call(message, "title"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.title);
                            if (message.outputDimensionality != null && Object.hasOwnProperty.call(message, "outputDimensionality"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.outputDimensionality);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest} message EmbedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedContentRequest} EmbedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.content = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.taskType = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.title = reader.string();
                                        break;
                                    }
                                case 5: {
                                        message.outputDimensionality = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedContentRequest} EmbedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.content != null && message.hasOwnProperty("content")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.content);
                                if (error)
                                    return "content." + error;
                            }
                            if (message.taskType != null && message.hasOwnProperty("taskType")) {
                                properties._taskType = 1;
                                switch (message.taskType) {
                                default:
                                    return "taskType: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                    break;
                                }
                            }
                            if (message.title != null && message.hasOwnProperty("title")) {
                                properties._title = 1;
                                if (!$util.isString(message.title))
                                    return "title: string expected";
                            }
                            if (message.outputDimensionality != null && message.hasOwnProperty("outputDimensionality")) {
                                properties._outputDimensionality = 1;
                                if (!$util.isInteger(message.outputDimensionality))
                                    return "outputDimensionality: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates an EmbedContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedContentRequest} EmbedContentRequest
                         */
                        EmbedContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.content != null) {
                                if (typeof object.content !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.EmbedContentRequest.content: object expected");
                                message.content = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.content);
                            }
                            switch (object.taskType) {
                            default:
                                if (typeof object.taskType === "number") {
                                    message.taskType = object.taskType;
                                    break;
                                }
                                break;
                            case "TASK_TYPE_UNSPECIFIED":
                            case 0:
                                message.taskType = 0;
                                break;
                            case "RETRIEVAL_QUERY":
                            case 1:
                                message.taskType = 1;
                                break;
                            case "RETRIEVAL_DOCUMENT":
                            case 2:
                                message.taskType = 2;
                                break;
                            case "SEMANTIC_SIMILARITY":
                            case 3:
                                message.taskType = 3;
                                break;
                            case "CLASSIFICATION":
                            case 4:
                                message.taskType = 4;
                                break;
                            case "CLUSTERING":
                            case 5:
                                message.taskType = 5;
                                break;
                            case "QUESTION_ANSWERING":
                            case 6:
                                message.taskType = 6;
                                break;
                            case "FACT_VERIFICATION":
                            case 7:
                                message.taskType = 7;
                                break;
                            }
                            if (object.title != null)
                                message.title = String(object.title);
                            if (object.outputDimensionality != null)
                                message.outputDimensionality = object.outputDimensionality | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.EmbedContentRequest} message EmbedContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.content = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.content, options);
                            if (message.taskType != null && message.hasOwnProperty("taskType")) {
                                object.taskType = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.TaskType[message.taskType] === undefined ? message.taskType : $root.google.ai.generativelanguage.v1alpha.TaskType[message.taskType] : message.taskType;
                                if (options.oneofs)
                                    object._taskType = "taskType";
                            }
                            if (message.title != null && message.hasOwnProperty("title")) {
                                object.title = message.title;
                                if (options.oneofs)
                                    object._title = "title";
                            }
                            if (message.outputDimensionality != null && message.hasOwnProperty("outputDimensionality")) {
                                object.outputDimensionality = message.outputDimensionality;
                                if (options.oneofs)
                                    object._outputDimensionality = "outputDimensionality";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this EmbedContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.EmbedContentRequest";
                        };
    
                        return EmbedContentRequest;
                    })();
    
                    v1alpha.ContentEmbedding = (function() {
    
                        /**
                         * Properties of a ContentEmbedding.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IContentEmbedding
                         * @property {Array.<number>|null} [values] ContentEmbedding values
                         */
    
                        /**
                         * Constructs a new ContentEmbedding.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ContentEmbedding.
                         * @implements IContentEmbedding
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IContentEmbedding=} [properties] Properties to set
                         */
                        function ContentEmbedding(properties) {
                            this.values = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ContentEmbedding values.
                         * @member {Array.<number>} values
                         * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding
                         * @instance
                         */
                        ContentEmbedding.prototype.values = $util.emptyArray;
    
                        /**
                         * Creates a new ContentEmbedding instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IContentEmbedding=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ContentEmbedding} ContentEmbedding instance
                         */
                        ContentEmbedding.create = function create(properties) {
                            return new ContentEmbedding(properties);
                        };
    
                        /**
                         * Encodes the specified ContentEmbedding message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentEmbedding.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IContentEmbedding} message ContentEmbedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentEmbedding.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.values != null && message.values.length) {
                                writer.uint32(/* id 1, wireType 2 =*/10).fork();
                                for (var i = 0; i < message.values.length; ++i)
                                    writer.float(message.values[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ContentEmbedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentEmbedding.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IContentEmbedding} message ContentEmbedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentEmbedding.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ContentEmbedding message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ContentEmbedding} ContentEmbedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentEmbedding.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ContentEmbedding();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.values && message.values.length))
                                            message.values = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.values.push(reader.float());
                                        } else
                                            message.values.push(reader.float());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ContentEmbedding message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ContentEmbedding} ContentEmbedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentEmbedding.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ContentEmbedding message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ContentEmbedding.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.values != null && message.hasOwnProperty("values")) {
                                if (!Array.isArray(message.values))
                                    return "values: array expected";
                                for (var i = 0; i < message.values.length; ++i)
                                    if (typeof message.values[i] !== "number")
                                        return "values: number[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a ContentEmbedding message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ContentEmbedding} ContentEmbedding
                         */
                        ContentEmbedding.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ContentEmbedding)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ContentEmbedding();
                            if (object.values) {
                                if (!Array.isArray(object.values))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.ContentEmbedding.values: array expected");
                                message.values = [];
                                for (var i = 0; i < object.values.length; ++i)
                                    message.values[i] = Number(object.values[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ContentEmbedding message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ContentEmbedding} message ContentEmbedding
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ContentEmbedding.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.values = [];
                            if (message.values && message.values.length) {
                                object.values = [];
                                for (var j = 0; j < message.values.length; ++j)
                                    object.values[j] = options.json && !isFinite(message.values[j]) ? String(message.values[j]) : message.values[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this ContentEmbedding to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ContentEmbedding.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ContentEmbedding
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ContentEmbedding.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ContentEmbedding";
                        };
    
                        return ContentEmbedding;
                    })();
    
                    v1alpha.EmbedContentResponse = (function() {
    
                        /**
                         * Properties of an EmbedContentResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IEmbedContentResponse
                         * @property {google.ai.generativelanguage.v1alpha.IContentEmbedding|null} [embedding] EmbedContentResponse embedding
                         */
    
                        /**
                         * Constructs a new EmbedContentResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an EmbedContentResponse.
                         * @implements IEmbedContentResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedContentResponse=} [properties] Properties to set
                         */
                        function EmbedContentResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedContentResponse embedding.
                         * @member {google.ai.generativelanguage.v1alpha.IContentEmbedding|null|undefined} embedding
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse
                         * @instance
                         */
                        EmbedContentResponse.prototype.embedding = null;
    
                        /**
                         * Creates a new EmbedContentResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedContentResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedContentResponse} EmbedContentResponse instance
                         */
                        EmbedContentResponse.create = function create(properties) {
                            return new EmbedContentResponse(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedContentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedContentResponse} message EmbedContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embedding != null && Object.hasOwnProperty.call(message, "embedding"))
                                $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.encode(message.embedding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedContentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedContentResponse} message EmbedContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedContentResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedContentResponse} EmbedContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.EmbedContentResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.embedding = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedContentResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedContentResponse} EmbedContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedContentResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedContentResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.embedding != null && message.hasOwnProperty("embedding")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.verify(message.embedding);
                                if (error)
                                    return "embedding." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an EmbedContentResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedContentResponse} EmbedContentResponse
                         */
                        EmbedContentResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.EmbedContentResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.EmbedContentResponse();
                            if (object.embedding != null) {
                                if (typeof object.embedding !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.EmbedContentResponse.embedding: object expected");
                                message.embedding = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.fromObject(object.embedding);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedContentResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.EmbedContentResponse} message EmbedContentResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedContentResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.embedding = null;
                            if (message.embedding != null && message.hasOwnProperty("embedding"))
                                object.embedding = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.toObject(message.embedding, options);
                            return object;
                        };
    
                        /**
                         * Converts this EmbedContentResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedContentResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedContentResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedContentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.EmbedContentResponse";
                        };
    
                        return EmbedContentResponse;
                    })();
    
                    v1alpha.BatchEmbedContentsRequest = (function() {
    
                        /**
                         * Properties of a BatchEmbedContentsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBatchEmbedContentsRequest
                         * @property {string|null} [model] BatchEmbedContentsRequest model
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IEmbedContentRequest>|null} [requests] BatchEmbedContentsRequest requests
                         */
    
                        /**
                         * Constructs a new BatchEmbedContentsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BatchEmbedContentsRequest.
                         * @implements IBatchEmbedContentsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest=} [properties] Properties to set
                         */
                        function BatchEmbedContentsRequest(properties) {
                            this.requests = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedContentsRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @instance
                         */
                        BatchEmbedContentsRequest.prototype.model = "";
    
                        /**
                         * BatchEmbedContentsRequest requests.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IEmbedContentRequest>} requests
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @instance
                         */
                        BatchEmbedContentsRequest.prototype.requests = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedContentsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest} BatchEmbedContentsRequest instance
                         */
                        BatchEmbedContentsRequest.create = function create(properties) {
                            return new BatchEmbedContentsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest} message BatchEmbedContentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.requests != null && message.requests.length)
                                for (var i = 0; i < message.requests.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest} message BatchEmbedContentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest} BatchEmbedContentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.requests && message.requests.length))
                                            message.requests = [];
                                        message.requests.push($root.google.ai.generativelanguage.v1alpha.EmbedContentRequest.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest} BatchEmbedContentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedContentsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedContentsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.requests != null && message.hasOwnProperty("requests")) {
                                if (!Array.isArray(message.requests))
                                    return "requests: array expected";
                                for (var i = 0; i < message.requests.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest.verify(message.requests[i]);
                                    if (error)
                                        return "requests." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedContentsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest} BatchEmbedContentsRequest
                         */
                        BatchEmbedContentsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.requests) {
                                if (!Array.isArray(object.requests))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest.requests: array expected");
                                message.requests = [];
                                for (var i = 0; i < object.requests.length; ++i) {
                                    if (typeof object.requests[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest.requests: object expected");
                                    message.requests[i] = $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest.fromObject(object.requests[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedContentsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest} message BatchEmbedContentsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedContentsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.requests = [];
                            if (options.defaults)
                                object.model = "";
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.requests && message.requests.length) {
                                object.requests = [];
                                for (var j = 0; j < message.requests.length; ++j)
                                    object.requests[j] = $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest.toObject(message.requests[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedContentsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedContentsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedContentsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest";
                        };
    
                        return BatchEmbedContentsRequest;
                    })();
    
                    v1alpha.BatchEmbedContentsResponse = (function() {
    
                        /**
                         * Properties of a BatchEmbedContentsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBatchEmbedContentsResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IContentEmbedding>|null} [embeddings] BatchEmbedContentsResponse embeddings
                         */
    
                        /**
                         * Constructs a new BatchEmbedContentsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BatchEmbedContentsResponse.
                         * @implements IBatchEmbedContentsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse=} [properties] Properties to set
                         */
                        function BatchEmbedContentsResponse(properties) {
                            this.embeddings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedContentsResponse embeddings.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IContentEmbedding>} embeddings
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse
                         * @instance
                         */
                        BatchEmbedContentsResponse.prototype.embeddings = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedContentsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} BatchEmbedContentsResponse instance
                         */
                        BatchEmbedContentsResponse.create = function create(properties) {
                            return new BatchEmbedContentsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse} message BatchEmbedContentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embeddings != null && message.embeddings.length)
                                for (var i = 0; i < message.embeddings.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.encode(message.embeddings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse} message BatchEmbedContentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} BatchEmbedContentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.embeddings && message.embeddings.length))
                                            message.embeddings = [];
                                        message.embeddings.push($root.google.ai.generativelanguage.v1alpha.ContentEmbedding.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} BatchEmbedContentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedContentsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedContentsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.embeddings != null && message.hasOwnProperty("embeddings")) {
                                if (!Array.isArray(message.embeddings))
                                    return "embeddings: array expected";
                                for (var i = 0; i < message.embeddings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.verify(message.embeddings[i]);
                                    if (error)
                                        return "embeddings." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedContentsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} BatchEmbedContentsResponse
                         */
                        BatchEmbedContentsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse();
                            if (object.embeddings) {
                                if (!Array.isArray(object.embeddings))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse.embeddings: array expected");
                                message.embeddings = [];
                                for (var i = 0; i < object.embeddings.length; ++i) {
                                    if (typeof object.embeddings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse.embeddings: object expected");
                                    message.embeddings[i] = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.fromObject(object.embeddings[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedContentsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} message BatchEmbedContentsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedContentsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.embeddings = [];
                            if (message.embeddings && message.embeddings.length) {
                                object.embeddings = [];
                                for (var j = 0; j < message.embeddings.length; ++j)
                                    object.embeddings[j] = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.toObject(message.embeddings[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedContentsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedContentsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedContentsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedContentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse";
                        };
    
                        return BatchEmbedContentsResponse;
                    })();
    
                    v1alpha.CountTokensRequest = (function() {
    
                        /**
                         * Properties of a CountTokensRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICountTokensRequest
                         * @property {string|null} [model] CountTokensRequest model
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IContent>|null} [contents] CountTokensRequest contents
                         * @property {google.ai.generativelanguage.v1alpha.IGenerateContentRequest|null} [generateContentRequest] CountTokensRequest generateContentRequest
                         */
    
                        /**
                         * Constructs a new CountTokensRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CountTokensRequest.
                         * @implements ICountTokensRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest=} [properties] Properties to set
                         */
                        function CountTokensRequest(properties) {
                            this.contents = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTokensRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @instance
                         */
                        CountTokensRequest.prototype.model = "";
    
                        /**
                         * CountTokensRequest contents.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IContent>} contents
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @instance
                         */
                        CountTokensRequest.prototype.contents = $util.emptyArray;
    
                        /**
                         * CountTokensRequest generateContentRequest.
                         * @member {google.ai.generativelanguage.v1alpha.IGenerateContentRequest|null|undefined} generateContentRequest
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @instance
                         */
                        CountTokensRequest.prototype.generateContentRequest = null;
    
                        /**
                         * Creates a new CountTokensRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CountTokensRequest} CountTokensRequest instance
                         */
                        CountTokensRequest.create = function create(properties) {
                            return new CountTokensRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CountTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest} message CountTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.contents != null && message.contents.length)
                                for (var i = 0; i < message.contents.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.generateContentRequest != null && Object.hasOwnProperty.call(message, "generateContentRequest"))
                                $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest.encode(message.generateContentRequest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest} message CountTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTokensRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CountTokensRequest} CountTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CountTokensRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.contents && message.contents.length))
                                            message.contents = [];
                                        message.contents.push($root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        message.generateContentRequest = $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTokensRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CountTokensRequest} CountTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTokensRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTokensRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.contents != null && message.hasOwnProperty("contents")) {
                                if (!Array.isArray(message.contents))
                                    return "contents: array expected";
                                for (var i = 0; i < message.contents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.contents[i]);
                                    if (error)
                                        return "contents." + error;
                                }
                            }
                            if (message.generateContentRequest != null && message.hasOwnProperty("generateContentRequest")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest.verify(message.generateContentRequest);
                                if (error)
                                    return "generateContentRequest." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CountTokensRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CountTokensRequest} CountTokensRequest
                         */
                        CountTokensRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountTokensRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CountTokensRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.contents) {
                                if (!Array.isArray(object.contents))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CountTokensRequest.contents: array expected");
                                message.contents = [];
                                for (var i = 0; i < object.contents.length; ++i) {
                                    if (typeof object.contents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.CountTokensRequest.contents: object expected");
                                    message.contents[i] = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.contents[i]);
                                }
                            }
                            if (object.generateContentRequest != null) {
                                if (typeof object.generateContentRequest !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CountTokensRequest.generateContentRequest: object expected");
                                message.generateContentRequest = $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest.fromObject(object.generateContentRequest);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTokensRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CountTokensRequest} message CountTokensRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTokensRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.contents = [];
                            if (options.defaults) {
                                object.model = "";
                                object.generateContentRequest = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.contents && message.contents.length) {
                                object.contents = [];
                                for (var j = 0; j < message.contents.length; ++j)
                                    object.contents[j] = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.contents[j], options);
                            }
                            if (message.generateContentRequest != null && message.hasOwnProperty("generateContentRequest"))
                                object.generateContentRequest = $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest.toObject(message.generateContentRequest, options);
                            return object;
                        };
    
                        /**
                         * Converts this CountTokensRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTokensRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTokensRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountTokensRequest";
                        };
    
                        return CountTokensRequest;
                    })();
    
                    v1alpha.CountTokensResponse = (function() {
    
                        /**
                         * Properties of a CountTokensResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICountTokensResponse
                         * @property {number|null} [totalTokens] CountTokensResponse totalTokens
                         * @property {number|null} [cachedContentTokenCount] CountTokensResponse cachedContentTokenCount
                         */
    
                        /**
                         * Constructs a new CountTokensResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CountTokensResponse.
                         * @implements ICountTokensResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICountTokensResponse=} [properties] Properties to set
                         */
                        function CountTokensResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTokensResponse totalTokens.
                         * @member {number} totalTokens
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @instance
                         */
                        CountTokensResponse.prototype.totalTokens = 0;
    
                        /**
                         * CountTokensResponse cachedContentTokenCount.
                         * @member {number} cachedContentTokenCount
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @instance
                         */
                        CountTokensResponse.prototype.cachedContentTokenCount = 0;
    
                        /**
                         * Creates a new CountTokensResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTokensResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CountTokensResponse} CountTokensResponse instance
                         */
                        CountTokensResponse.create = function create(properties) {
                            return new CountTokensResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CountTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTokensResponse} message CountTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.totalTokens != null && Object.hasOwnProperty.call(message, "totalTokens"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalTokens);
                            if (message.cachedContentTokenCount != null && Object.hasOwnProperty.call(message, "cachedContentTokenCount"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.cachedContentTokenCount);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTokensResponse} message CountTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTokensResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CountTokensResponse} CountTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CountTokensResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.totalTokens = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.cachedContentTokenCount = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTokensResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CountTokensResponse} CountTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTokensResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTokensResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.totalTokens != null && message.hasOwnProperty("totalTokens"))
                                if (!$util.isInteger(message.totalTokens))
                                    return "totalTokens: integer expected";
                            if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount"))
                                if (!$util.isInteger(message.cachedContentTokenCount))
                                    return "cachedContentTokenCount: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a CountTokensResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CountTokensResponse} CountTokensResponse
                         */
                        CountTokensResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountTokensResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CountTokensResponse();
                            if (object.totalTokens != null)
                                message.totalTokens = object.totalTokens | 0;
                            if (object.cachedContentTokenCount != null)
                                message.cachedContentTokenCount = object.cachedContentTokenCount | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTokensResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CountTokensResponse} message CountTokensResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTokensResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.totalTokens = 0;
                                object.cachedContentTokenCount = 0;
                            }
                            if (message.totalTokens != null && message.hasOwnProperty("totalTokens"))
                                object.totalTokens = message.totalTokens;
                            if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount"))
                                object.cachedContentTokenCount = message.cachedContentTokenCount;
                            return object;
                        };
    
                        /**
                         * Converts this CountTokensResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTokensResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTokensResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountTokensResponse";
                        };
    
                        return CountTokensResponse;
                    })();
    
                    v1alpha.BidiGenerateContentSetup = (function() {
    
                        /**
                         * Properties of a BidiGenerateContentSetup.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBidiGenerateContentSetup
                         * @property {string|null} [model] BidiGenerateContentSetup model
                         * @property {google.ai.generativelanguage.v1alpha.IGenerationConfig|null} [generationConfig] BidiGenerateContentSetup generationConfig
                         * @property {google.ai.generativelanguage.v1alpha.IContent|null} [systemInstruction] BidiGenerateContentSetup systemInstruction
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ITool>|null} [tools] BidiGenerateContentSetup tools
                         */
    
                        /**
                         * Constructs a new BidiGenerateContentSetup.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BidiGenerateContentSetup.
                         * @implements IBidiGenerateContentSetup
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup=} [properties] Properties to set
                         */
                        function BidiGenerateContentSetup(properties) {
                            this.tools = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BidiGenerateContentSetup model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @instance
                         */
                        BidiGenerateContentSetup.prototype.model = "";
    
                        /**
                         * BidiGenerateContentSetup generationConfig.
                         * @member {google.ai.generativelanguage.v1alpha.IGenerationConfig|null|undefined} generationConfig
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @instance
                         */
                        BidiGenerateContentSetup.prototype.generationConfig = null;
    
                        /**
                         * BidiGenerateContentSetup systemInstruction.
                         * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} systemInstruction
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @instance
                         */
                        BidiGenerateContentSetup.prototype.systemInstruction = null;
    
                        /**
                         * BidiGenerateContentSetup tools.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ITool>} tools
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @instance
                         */
                        BidiGenerateContentSetup.prototype.tools = $util.emptyArray;
    
                        /**
                         * Creates a new BidiGenerateContentSetup instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup} BidiGenerateContentSetup instance
                         */
                        BidiGenerateContentSetup.create = function create(properties) {
                            return new BidiGenerateContentSetup(properties);
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentSetup message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup} message BidiGenerateContentSetup message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentSetup.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.generationConfig != null && Object.hasOwnProperty.call(message, "generationConfig"))
                                $root.google.ai.generativelanguage.v1alpha.GenerationConfig.encode(message.generationConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction"))
                                $root.google.ai.generativelanguage.v1alpha.Content.encode(message.systemInstruction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.tools != null && message.tools.length)
                                for (var i = 0; i < message.tools.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Tool.encode(message.tools[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentSetup message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup} message BidiGenerateContentSetup message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentSetup.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BidiGenerateContentSetup message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup} BidiGenerateContentSetup
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentSetup.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        if (!(message.tools && message.tools.length))
                                            message.tools = [];
                                        message.tools.push($root.google.ai.generativelanguage.v1alpha.Tool.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BidiGenerateContentSetup message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup} BidiGenerateContentSetup
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentSetup.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BidiGenerateContentSetup message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BidiGenerateContentSetup.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.verify(message.generationConfig);
                                if (error)
                                    return "generationConfig." + error;
                            }
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.systemInstruction);
                                if (error)
                                    return "systemInstruction." + error;
                            }
                            if (message.tools != null && message.hasOwnProperty("tools")) {
                                if (!Array.isArray(message.tools))
                                    return "tools: array expected";
                                for (var i = 0; i < message.tools.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Tool.verify(message.tools[i]);
                                    if (error)
                                        return "tools." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BidiGenerateContentSetup message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup} BidiGenerateContentSetup
                         */
                        BidiGenerateContentSetup.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.generationConfig != null) {
                                if (typeof object.generationConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.generationConfig: object expected");
                                message.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.fromObject(object.generationConfig);
                            }
                            if (object.systemInstruction != null) {
                                if (typeof object.systemInstruction !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.systemInstruction: object expected");
                                message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.systemInstruction);
                            }
                            if (object.tools) {
                                if (!Array.isArray(object.tools))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.tools: array expected");
                                message.tools = [];
                                for (var i = 0; i < object.tools.length; ++i) {
                                    if (typeof object.tools[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.tools: object expected");
                                    message.tools[i] = $root.google.ai.generativelanguage.v1alpha.Tool.fromObject(object.tools[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BidiGenerateContentSetup message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup} message BidiGenerateContentSetup
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BidiGenerateContentSetup.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.tools = [];
                            if (options.defaults) {
                                object.model = "";
                                object.generationConfig = null;
                                object.systemInstruction = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.generationConfig != null && message.hasOwnProperty("generationConfig"))
                                object.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.toObject(message.generationConfig, options);
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction"))
                                object.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.systemInstruction, options);
                            if (message.tools && message.tools.length) {
                                object.tools = [];
                                for (var j = 0; j < message.tools.length; ++j)
                                    object.tools[j] = $root.google.ai.generativelanguage.v1alpha.Tool.toObject(message.tools[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BidiGenerateContentSetup to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BidiGenerateContentSetup.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BidiGenerateContentSetup
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BidiGenerateContentSetup.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup";
                        };
    
                        return BidiGenerateContentSetup;
                    })();
    
                    v1alpha.BidiGenerateContentClientContent = (function() {
    
                        /**
                         * Properties of a BidiGenerateContentClientContent.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBidiGenerateContentClientContent
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IContent>|null} [turns] BidiGenerateContentClientContent turns
                         * @property {boolean|null} [turnComplete] BidiGenerateContentClientContent turnComplete
                         */
    
                        /**
                         * Constructs a new BidiGenerateContentClientContent.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BidiGenerateContentClientContent.
                         * @implements IBidiGenerateContentClientContent
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent=} [properties] Properties to set
                         */
                        function BidiGenerateContentClientContent(properties) {
                            this.turns = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BidiGenerateContentClientContent turns.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IContent>} turns
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @instance
                         */
                        BidiGenerateContentClientContent.prototype.turns = $util.emptyArray;
    
                        /**
                         * BidiGenerateContentClientContent turnComplete.
                         * @member {boolean} turnComplete
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @instance
                         */
                        BidiGenerateContentClientContent.prototype.turnComplete = false;
    
                        /**
                         * Creates a new BidiGenerateContentClientContent instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent} BidiGenerateContentClientContent instance
                         */
                        BidiGenerateContentClientContent.create = function create(properties) {
                            return new BidiGenerateContentClientContent(properties);
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentClientContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent} message BidiGenerateContentClientContent message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentClientContent.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.turns != null && message.turns.length)
                                for (var i = 0; i < message.turns.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Content.encode(message.turns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.turnComplete != null && Object.hasOwnProperty.call(message, "turnComplete"))
                                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.turnComplete);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentClientContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent} message BidiGenerateContentClientContent message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentClientContent.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BidiGenerateContentClientContent message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent} BidiGenerateContentClientContent
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentClientContent.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.turns && message.turns.length))
                                            message.turns = [];
                                        message.turns.push($root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.turnComplete = reader.bool();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BidiGenerateContentClientContent message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent} BidiGenerateContentClientContent
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentClientContent.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BidiGenerateContentClientContent message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BidiGenerateContentClientContent.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.turns != null && message.hasOwnProperty("turns")) {
                                if (!Array.isArray(message.turns))
                                    return "turns: array expected";
                                for (var i = 0; i < message.turns.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.turns[i]);
                                    if (error)
                                        return "turns." + error;
                                }
                            }
                            if (message.turnComplete != null && message.hasOwnProperty("turnComplete"))
                                if (typeof message.turnComplete !== "boolean")
                                    return "turnComplete: boolean expected";
                            return null;
                        };
    
                        /**
                         * Creates a BidiGenerateContentClientContent message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent} BidiGenerateContentClientContent
                         */
                        BidiGenerateContentClientContent.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent();
                            if (object.turns) {
                                if (!Array.isArray(object.turns))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.turns: array expected");
                                message.turns = [];
                                for (var i = 0; i < object.turns.length; ++i) {
                                    if (typeof object.turns[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.turns: object expected");
                                    message.turns[i] = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.turns[i]);
                                }
                            }
                            if (object.turnComplete != null)
                                message.turnComplete = Boolean(object.turnComplete);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BidiGenerateContentClientContent message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent} message BidiGenerateContentClientContent
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BidiGenerateContentClientContent.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.turns = [];
                            if (options.defaults)
                                object.turnComplete = false;
                            if (message.turns && message.turns.length) {
                                object.turns = [];
                                for (var j = 0; j < message.turns.length; ++j)
                                    object.turns[j] = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.turns[j], options);
                            }
                            if (message.turnComplete != null && message.hasOwnProperty("turnComplete"))
                                object.turnComplete = message.turnComplete;
                            return object;
                        };
    
                        /**
                         * Converts this BidiGenerateContentClientContent to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BidiGenerateContentClientContent.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BidiGenerateContentClientContent
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BidiGenerateContentClientContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent";
                        };
    
                        return BidiGenerateContentClientContent;
                    })();
    
                    v1alpha.BidiGenerateContentRealtimeInput = (function() {
    
                        /**
                         * Properties of a BidiGenerateContentRealtimeInput.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBidiGenerateContentRealtimeInput
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IBlob>|null} [mediaChunks] BidiGenerateContentRealtimeInput mediaChunks
                         */
    
                        /**
                         * Constructs a new BidiGenerateContentRealtimeInput.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BidiGenerateContentRealtimeInput.
                         * @implements IBidiGenerateContentRealtimeInput
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput=} [properties] Properties to set
                         */
                        function BidiGenerateContentRealtimeInput(properties) {
                            this.mediaChunks = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BidiGenerateContentRealtimeInput mediaChunks.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IBlob>} mediaChunks
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput
                         * @instance
                         */
                        BidiGenerateContentRealtimeInput.prototype.mediaChunks = $util.emptyArray;
    
                        /**
                         * Creates a new BidiGenerateContentRealtimeInput instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput} BidiGenerateContentRealtimeInput instance
                         */
                        BidiGenerateContentRealtimeInput.create = function create(properties) {
                            return new BidiGenerateContentRealtimeInput(properties);
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentRealtimeInput message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput} message BidiGenerateContentRealtimeInput message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentRealtimeInput.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.mediaChunks != null && message.mediaChunks.length)
                                for (var i = 0; i < message.mediaChunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Blob.encode(message.mediaChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentRealtimeInput message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput} message BidiGenerateContentRealtimeInput message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentRealtimeInput.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BidiGenerateContentRealtimeInput message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput} BidiGenerateContentRealtimeInput
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentRealtimeInput.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.mediaChunks && message.mediaChunks.length))
                                            message.mediaChunks = [];
                                        message.mediaChunks.push($root.google.ai.generativelanguage.v1alpha.Blob.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BidiGenerateContentRealtimeInput message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput} BidiGenerateContentRealtimeInput
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentRealtimeInput.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BidiGenerateContentRealtimeInput message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BidiGenerateContentRealtimeInput.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.mediaChunks != null && message.hasOwnProperty("mediaChunks")) {
                                if (!Array.isArray(message.mediaChunks))
                                    return "mediaChunks: array expected";
                                for (var i = 0; i < message.mediaChunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Blob.verify(message.mediaChunks[i]);
                                    if (error)
                                        return "mediaChunks." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BidiGenerateContentRealtimeInput message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput} BidiGenerateContentRealtimeInput
                         */
                        BidiGenerateContentRealtimeInput.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput();
                            if (object.mediaChunks) {
                                if (!Array.isArray(object.mediaChunks))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.mediaChunks: array expected");
                                message.mediaChunks = [];
                                for (var i = 0; i < object.mediaChunks.length; ++i) {
                                    if (typeof object.mediaChunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.mediaChunks: object expected");
                                    message.mediaChunks[i] = $root.google.ai.generativelanguage.v1alpha.Blob.fromObject(object.mediaChunks[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BidiGenerateContentRealtimeInput message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput} message BidiGenerateContentRealtimeInput
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BidiGenerateContentRealtimeInput.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.mediaChunks = [];
                            if (message.mediaChunks && message.mediaChunks.length) {
                                object.mediaChunks = [];
                                for (var j = 0; j < message.mediaChunks.length; ++j)
                                    object.mediaChunks[j] = $root.google.ai.generativelanguage.v1alpha.Blob.toObject(message.mediaChunks[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BidiGenerateContentRealtimeInput to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BidiGenerateContentRealtimeInput.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BidiGenerateContentRealtimeInput
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BidiGenerateContentRealtimeInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput";
                        };
    
                        return BidiGenerateContentRealtimeInput;
                    })();
    
                    v1alpha.BidiGenerateContentToolResponse = (function() {
    
                        /**
                         * Properties of a BidiGenerateContentToolResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBidiGenerateContentToolResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IFunctionResponse>|null} [functionResponses] BidiGenerateContentToolResponse functionResponses
                         */
    
                        /**
                         * Constructs a new BidiGenerateContentToolResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BidiGenerateContentToolResponse.
                         * @implements IBidiGenerateContentToolResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse=} [properties] Properties to set
                         */
                        function BidiGenerateContentToolResponse(properties) {
                            this.functionResponses = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BidiGenerateContentToolResponse functionResponses.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IFunctionResponse>} functionResponses
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse
                         * @instance
                         */
                        BidiGenerateContentToolResponse.prototype.functionResponses = $util.emptyArray;
    
                        /**
                         * Creates a new BidiGenerateContentToolResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse} BidiGenerateContentToolResponse instance
                         */
                        BidiGenerateContentToolResponse.create = function create(properties) {
                            return new BidiGenerateContentToolResponse(properties);
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentToolResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse} message BidiGenerateContentToolResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentToolResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.functionResponses != null && message.functionResponses.length)
                                for (var i = 0; i < message.functionResponses.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.FunctionResponse.encode(message.functionResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentToolResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse} message BidiGenerateContentToolResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentToolResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BidiGenerateContentToolResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse} BidiGenerateContentToolResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentToolResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.functionResponses && message.functionResponses.length))
                                            message.functionResponses = [];
                                        message.functionResponses.push($root.google.ai.generativelanguage.v1alpha.FunctionResponse.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BidiGenerateContentToolResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse} BidiGenerateContentToolResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentToolResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BidiGenerateContentToolResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BidiGenerateContentToolResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.functionResponses != null && message.hasOwnProperty("functionResponses")) {
                                if (!Array.isArray(message.functionResponses))
                                    return "functionResponses: array expected";
                                for (var i = 0; i < message.functionResponses.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.verify(message.functionResponses[i]);
                                    if (error)
                                        return "functionResponses." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BidiGenerateContentToolResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse} BidiGenerateContentToolResponse
                         */
                        BidiGenerateContentToolResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse();
                            if (object.functionResponses) {
                                if (!Array.isArray(object.functionResponses))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.functionResponses: array expected");
                                message.functionResponses = [];
                                for (var i = 0; i < object.functionResponses.length; ++i) {
                                    if (typeof object.functionResponses[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.functionResponses: object expected");
                                    message.functionResponses[i] = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.fromObject(object.functionResponses[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BidiGenerateContentToolResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse} message BidiGenerateContentToolResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BidiGenerateContentToolResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.functionResponses = [];
                            if (message.functionResponses && message.functionResponses.length) {
                                object.functionResponses = [];
                                for (var j = 0; j < message.functionResponses.length; ++j)
                                    object.functionResponses[j] = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.toObject(message.functionResponses[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BidiGenerateContentToolResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BidiGenerateContentToolResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BidiGenerateContentToolResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BidiGenerateContentToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse";
                        };
    
                        return BidiGenerateContentToolResponse;
                    })();
    
                    v1alpha.BidiGenerateContentClientMessage = (function() {
    
                        /**
                         * Properties of a BidiGenerateContentClientMessage.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBidiGenerateContentClientMessage
                         * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup|null} [setup] BidiGenerateContentClientMessage setup
                         * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent|null} [clientContent] BidiGenerateContentClientMessage clientContent
                         * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput|null} [realtimeInput] BidiGenerateContentClientMessage realtimeInput
                         * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse|null} [toolResponse] BidiGenerateContentClientMessage toolResponse
                         */
    
                        /**
                         * Constructs a new BidiGenerateContentClientMessage.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BidiGenerateContentClientMessage.
                         * @implements IBidiGenerateContentClientMessage
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage=} [properties] Properties to set
                         */
                        function BidiGenerateContentClientMessage(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BidiGenerateContentClientMessage setup.
                         * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup|null|undefined} setup
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @instance
                         */
                        BidiGenerateContentClientMessage.prototype.setup = null;
    
                        /**
                         * BidiGenerateContentClientMessage clientContent.
                         * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent|null|undefined} clientContent
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @instance
                         */
                        BidiGenerateContentClientMessage.prototype.clientContent = null;
    
                        /**
                         * BidiGenerateContentClientMessage realtimeInput.
                         * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput|null|undefined} realtimeInput
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @instance
                         */
                        BidiGenerateContentClientMessage.prototype.realtimeInput = null;
    
                        /**
                         * BidiGenerateContentClientMessage toolResponse.
                         * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse|null|undefined} toolResponse
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @instance
                         */
                        BidiGenerateContentClientMessage.prototype.toolResponse = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * BidiGenerateContentClientMessage messageType.
                         * @member {"setup"|"clientContent"|"realtimeInput"|"toolResponse"|undefined} messageType
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @instance
                         */
                        Object.defineProperty(BidiGenerateContentClientMessage.prototype, "messageType", {
                            get: $util.oneOfGetter($oneOfFields = ["setup", "clientContent", "realtimeInput", "toolResponse"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new BidiGenerateContentClientMessage instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage} BidiGenerateContentClientMessage instance
                         */
                        BidiGenerateContentClientMessage.create = function create(properties) {
                            return new BidiGenerateContentClientMessage(properties);
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentClientMessage message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage} message BidiGenerateContentClientMessage message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentClientMessage.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.setup != null && Object.hasOwnProperty.call(message, "setup"))
                                $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.encode(message.setup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.clientContent != null && Object.hasOwnProperty.call(message, "clientContent"))
                                $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.encode(message.clientContent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.realtimeInput != null && Object.hasOwnProperty.call(message, "realtimeInput"))
                                $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.encode(message.realtimeInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse"))
                                $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.encode(message.toolResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentClientMessage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage} message BidiGenerateContentClientMessage message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentClientMessage.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BidiGenerateContentClientMessage message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage} BidiGenerateContentClientMessage
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentClientMessage.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.setup = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.clientContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.realtimeInput = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.toolResponse = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BidiGenerateContentClientMessage message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage} BidiGenerateContentClientMessage
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentClientMessage.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BidiGenerateContentClientMessage message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BidiGenerateContentClientMessage.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.setup != null && message.hasOwnProperty("setup")) {
                                properties.messageType = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.verify(message.setup);
                                    if (error)
                                        return "setup." + error;
                                }
                            }
                            if (message.clientContent != null && message.hasOwnProperty("clientContent")) {
                                if (properties.messageType === 1)
                                    return "messageType: multiple values";
                                properties.messageType = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.verify(message.clientContent);
                                    if (error)
                                        return "clientContent." + error;
                                }
                            }
                            if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) {
                                if (properties.messageType === 1)
                                    return "messageType: multiple values";
                                properties.messageType = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.verify(message.realtimeInput);
                                    if (error)
                                        return "realtimeInput." + error;
                                }
                            }
                            if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) {
                                if (properties.messageType === 1)
                                    return "messageType: multiple values";
                                properties.messageType = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.verify(message.toolResponse);
                                    if (error)
                                        return "toolResponse." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BidiGenerateContentClientMessage message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage} BidiGenerateContentClientMessage
                         */
                        BidiGenerateContentClientMessage.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage();
                            if (object.setup != null) {
                                if (typeof object.setup !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.setup: object expected");
                                message.setup = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.fromObject(object.setup);
                            }
                            if (object.clientContent != null) {
                                if (typeof object.clientContent !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.clientContent: object expected");
                                message.clientContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.fromObject(object.clientContent);
                            }
                            if (object.realtimeInput != null) {
                                if (typeof object.realtimeInput !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.realtimeInput: object expected");
                                message.realtimeInput = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.fromObject(object.realtimeInput);
                            }
                            if (object.toolResponse != null) {
                                if (typeof object.toolResponse !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.toolResponse: object expected");
                                message.toolResponse = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.fromObject(object.toolResponse);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BidiGenerateContentClientMessage message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage} message BidiGenerateContentClientMessage
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BidiGenerateContentClientMessage.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.setup != null && message.hasOwnProperty("setup")) {
                                object.setup = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.toObject(message.setup, options);
                                if (options.oneofs)
                                    object.messageType = "setup";
                            }
                            if (message.clientContent != null && message.hasOwnProperty("clientContent")) {
                                object.clientContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.toObject(message.clientContent, options);
                                if (options.oneofs)
                                    object.messageType = "clientContent";
                            }
                            if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) {
                                object.realtimeInput = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.toObject(message.realtimeInput, options);
                                if (options.oneofs)
                                    object.messageType = "realtimeInput";
                            }
                            if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) {
                                object.toolResponse = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.toObject(message.toolResponse, options);
                                if (options.oneofs)
                                    object.messageType = "toolResponse";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BidiGenerateContentClientMessage to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BidiGenerateContentClientMessage.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BidiGenerateContentClientMessage
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BidiGenerateContentClientMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage";
                        };
    
                        return BidiGenerateContentClientMessage;
                    })();
    
                    v1alpha.BidiGenerateContentSetupComplete = (function() {
    
                        /**
                         * Properties of a BidiGenerateContentSetupComplete.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBidiGenerateContentSetupComplete
                         */
    
                        /**
                         * Constructs a new BidiGenerateContentSetupComplete.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BidiGenerateContentSetupComplete.
                         * @implements IBidiGenerateContentSetupComplete
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete=} [properties] Properties to set
                         */
                        function BidiGenerateContentSetupComplete(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Creates a new BidiGenerateContentSetupComplete instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete} BidiGenerateContentSetupComplete instance
                         */
                        BidiGenerateContentSetupComplete.create = function create(properties) {
                            return new BidiGenerateContentSetupComplete(properties);
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentSetupComplete message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete} message BidiGenerateContentSetupComplete message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentSetupComplete.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentSetupComplete message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete} message BidiGenerateContentSetupComplete message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentSetupComplete.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BidiGenerateContentSetupComplete message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete} BidiGenerateContentSetupComplete
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentSetupComplete.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BidiGenerateContentSetupComplete message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete} BidiGenerateContentSetupComplete
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentSetupComplete.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BidiGenerateContentSetupComplete message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BidiGenerateContentSetupComplete.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            return null;
                        };
    
                        /**
                         * Creates a BidiGenerateContentSetupComplete message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete} BidiGenerateContentSetupComplete
                         */
                        BidiGenerateContentSetupComplete.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete)
                                return object;
                            return new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete();
                        };
    
                        /**
                         * Creates a plain object from a BidiGenerateContentSetupComplete message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete} message BidiGenerateContentSetupComplete
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BidiGenerateContentSetupComplete.toObject = function toObject() {
                            return {};
                        };
    
                        /**
                         * Converts this BidiGenerateContentSetupComplete to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BidiGenerateContentSetupComplete.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BidiGenerateContentSetupComplete
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BidiGenerateContentSetupComplete.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete";
                        };
    
                        return BidiGenerateContentSetupComplete;
                    })();
    
                    v1alpha.BidiGenerateContentServerContent = (function() {
    
                        /**
                         * Properties of a BidiGenerateContentServerContent.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBidiGenerateContentServerContent
                         * @property {google.ai.generativelanguage.v1alpha.IContent|null} [modelTurn] BidiGenerateContentServerContent modelTurn
                         * @property {boolean|null} [turnComplete] BidiGenerateContentServerContent turnComplete
                         * @property {boolean|null} [interrupted] BidiGenerateContentServerContent interrupted
                         * @property {google.ai.generativelanguage.v1alpha.IGroundingMetadata|null} [groundingMetadata] BidiGenerateContentServerContent groundingMetadata
                         */
    
                        /**
                         * Constructs a new BidiGenerateContentServerContent.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BidiGenerateContentServerContent.
                         * @implements IBidiGenerateContentServerContent
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent=} [properties] Properties to set
                         */
                        function BidiGenerateContentServerContent(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BidiGenerateContentServerContent modelTurn.
                         * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} modelTurn
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @instance
                         */
                        BidiGenerateContentServerContent.prototype.modelTurn = null;
    
                        /**
                         * BidiGenerateContentServerContent turnComplete.
                         * @member {boolean} turnComplete
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @instance
                         */
                        BidiGenerateContentServerContent.prototype.turnComplete = false;
    
                        /**
                         * BidiGenerateContentServerContent interrupted.
                         * @member {boolean} interrupted
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @instance
                         */
                        BidiGenerateContentServerContent.prototype.interrupted = false;
    
                        /**
                         * BidiGenerateContentServerContent groundingMetadata.
                         * @member {google.ai.generativelanguage.v1alpha.IGroundingMetadata|null|undefined} groundingMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @instance
                         */
                        BidiGenerateContentServerContent.prototype.groundingMetadata = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * BidiGenerateContentServerContent _modelTurn.
                         * @member {"modelTurn"|undefined} _modelTurn
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @instance
                         */
                        Object.defineProperty(BidiGenerateContentServerContent.prototype, "_modelTurn", {
                            get: $util.oneOfGetter($oneOfFields = ["modelTurn"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new BidiGenerateContentServerContent instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent} BidiGenerateContentServerContent instance
                         */
                        BidiGenerateContentServerContent.create = function create(properties) {
                            return new BidiGenerateContentServerContent(properties);
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentServerContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent} message BidiGenerateContentServerContent message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentServerContent.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.modelTurn != null && Object.hasOwnProperty.call(message, "modelTurn"))
                                $root.google.ai.generativelanguage.v1alpha.Content.encode(message.modelTurn, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.turnComplete != null && Object.hasOwnProperty.call(message, "turnComplete"))
                                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.turnComplete);
                            if (message.interrupted != null && Object.hasOwnProperty.call(message, "interrupted"))
                                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.interrupted);
                            if (message.groundingMetadata != null && Object.hasOwnProperty.call(message, "groundingMetadata"))
                                $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.encode(message.groundingMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentServerContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent} message BidiGenerateContentServerContent message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentServerContent.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BidiGenerateContentServerContent message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent} BidiGenerateContentServerContent
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentServerContent.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.modelTurn = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.turnComplete = reader.bool();
                                        break;
                                    }
                                case 3: {
                                        message.interrupted = reader.bool();
                                        break;
                                    }
                                case 4: {
                                        message.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BidiGenerateContentServerContent message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent} BidiGenerateContentServerContent
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentServerContent.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BidiGenerateContentServerContent message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BidiGenerateContentServerContent.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.modelTurn != null && message.hasOwnProperty("modelTurn")) {
                                properties._modelTurn = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.modelTurn);
                                    if (error)
                                        return "modelTurn." + error;
                                }
                            }
                            if (message.turnComplete != null && message.hasOwnProperty("turnComplete"))
                                if (typeof message.turnComplete !== "boolean")
                                    return "turnComplete: boolean expected";
                            if (message.interrupted != null && message.hasOwnProperty("interrupted"))
                                if (typeof message.interrupted !== "boolean")
                                    return "interrupted: boolean expected";
                            if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.verify(message.groundingMetadata);
                                if (error)
                                    return "groundingMetadata." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BidiGenerateContentServerContent message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent} BidiGenerateContentServerContent
                         */
                        BidiGenerateContentServerContent.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent();
                            if (object.modelTurn != null) {
                                if (typeof object.modelTurn !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.modelTurn: object expected");
                                message.modelTurn = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.modelTurn);
                            }
                            if (object.turnComplete != null)
                                message.turnComplete = Boolean(object.turnComplete);
                            if (object.interrupted != null)
                                message.interrupted = Boolean(object.interrupted);
                            if (object.groundingMetadata != null) {
                                if (typeof object.groundingMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.groundingMetadata: object expected");
                                message.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.fromObject(object.groundingMetadata);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BidiGenerateContentServerContent message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent} message BidiGenerateContentServerContent
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BidiGenerateContentServerContent.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.turnComplete = false;
                                object.interrupted = false;
                                object.groundingMetadata = null;
                            }
                            if (message.modelTurn != null && message.hasOwnProperty("modelTurn")) {
                                object.modelTurn = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.modelTurn, options);
                                if (options.oneofs)
                                    object._modelTurn = "modelTurn";
                            }
                            if (message.turnComplete != null && message.hasOwnProperty("turnComplete"))
                                object.turnComplete = message.turnComplete;
                            if (message.interrupted != null && message.hasOwnProperty("interrupted"))
                                object.interrupted = message.interrupted;
                            if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata"))
                                object.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.toObject(message.groundingMetadata, options);
                            return object;
                        };
    
                        /**
                         * Converts this BidiGenerateContentServerContent to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BidiGenerateContentServerContent.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BidiGenerateContentServerContent
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BidiGenerateContentServerContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent";
                        };
    
                        return BidiGenerateContentServerContent;
                    })();
    
                    v1alpha.BidiGenerateContentToolCall = (function() {
    
                        /**
                         * Properties of a BidiGenerateContentToolCall.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBidiGenerateContentToolCall
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IFunctionCall>|null} [functionCalls] BidiGenerateContentToolCall functionCalls
                         */
    
                        /**
                         * Constructs a new BidiGenerateContentToolCall.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BidiGenerateContentToolCall.
                         * @implements IBidiGenerateContentToolCall
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall=} [properties] Properties to set
                         */
                        function BidiGenerateContentToolCall(properties) {
                            this.functionCalls = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BidiGenerateContentToolCall functionCalls.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IFunctionCall>} functionCalls
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall
                         * @instance
                         */
                        BidiGenerateContentToolCall.prototype.functionCalls = $util.emptyArray;
    
                        /**
                         * Creates a new BidiGenerateContentToolCall instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall} BidiGenerateContentToolCall instance
                         */
                        BidiGenerateContentToolCall.create = function create(properties) {
                            return new BidiGenerateContentToolCall(properties);
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentToolCall message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall} message BidiGenerateContentToolCall message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentToolCall.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.functionCalls != null && message.functionCalls.length)
                                for (var i = 0; i < message.functionCalls.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.FunctionCall.encode(message.functionCalls[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentToolCall message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall} message BidiGenerateContentToolCall message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentToolCall.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BidiGenerateContentToolCall message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall} BidiGenerateContentToolCall
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentToolCall.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        if (!(message.functionCalls && message.functionCalls.length))
                                            message.functionCalls = [];
                                        message.functionCalls.push($root.google.ai.generativelanguage.v1alpha.FunctionCall.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BidiGenerateContentToolCall message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall} BidiGenerateContentToolCall
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentToolCall.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BidiGenerateContentToolCall message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BidiGenerateContentToolCall.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.functionCalls != null && message.hasOwnProperty("functionCalls")) {
                                if (!Array.isArray(message.functionCalls))
                                    return "functionCalls: array expected";
                                for (var i = 0; i < message.functionCalls.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.FunctionCall.verify(message.functionCalls[i]);
                                    if (error)
                                        return "functionCalls." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BidiGenerateContentToolCall message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall} BidiGenerateContentToolCall
                         */
                        BidiGenerateContentToolCall.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall();
                            if (object.functionCalls) {
                                if (!Array.isArray(object.functionCalls))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.functionCalls: array expected");
                                message.functionCalls = [];
                                for (var i = 0; i < object.functionCalls.length; ++i) {
                                    if (typeof object.functionCalls[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.functionCalls: object expected");
                                    message.functionCalls[i] = $root.google.ai.generativelanguage.v1alpha.FunctionCall.fromObject(object.functionCalls[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BidiGenerateContentToolCall message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall} message BidiGenerateContentToolCall
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BidiGenerateContentToolCall.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.functionCalls = [];
                            if (message.functionCalls && message.functionCalls.length) {
                                object.functionCalls = [];
                                for (var j = 0; j < message.functionCalls.length; ++j)
                                    object.functionCalls[j] = $root.google.ai.generativelanguage.v1alpha.FunctionCall.toObject(message.functionCalls[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BidiGenerateContentToolCall to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BidiGenerateContentToolCall.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BidiGenerateContentToolCall
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BidiGenerateContentToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall";
                        };
    
                        return BidiGenerateContentToolCall;
                    })();
    
                    v1alpha.BidiGenerateContentToolCallCancellation = (function() {
    
                        /**
                         * Properties of a BidiGenerateContentToolCallCancellation.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBidiGenerateContentToolCallCancellation
                         * @property {Array.<string>|null} [ids] BidiGenerateContentToolCallCancellation ids
                         */
    
                        /**
                         * Constructs a new BidiGenerateContentToolCallCancellation.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BidiGenerateContentToolCallCancellation.
                         * @implements IBidiGenerateContentToolCallCancellation
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation=} [properties] Properties to set
                         */
                        function BidiGenerateContentToolCallCancellation(properties) {
                            this.ids = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BidiGenerateContentToolCallCancellation ids.
                         * @member {Array.<string>} ids
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation
                         * @instance
                         */
                        BidiGenerateContentToolCallCancellation.prototype.ids = $util.emptyArray;
    
                        /**
                         * Creates a new BidiGenerateContentToolCallCancellation instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation} BidiGenerateContentToolCallCancellation instance
                         */
                        BidiGenerateContentToolCallCancellation.create = function create(properties) {
                            return new BidiGenerateContentToolCallCancellation(properties);
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentToolCallCancellation message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation} message BidiGenerateContentToolCallCancellation message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentToolCallCancellation.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.ids != null && message.ids.length)
                                for (var i = 0; i < message.ids.length; ++i)
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.ids[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentToolCallCancellation message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation} message BidiGenerateContentToolCallCancellation message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentToolCallCancellation.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BidiGenerateContentToolCallCancellation message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation} BidiGenerateContentToolCallCancellation
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentToolCallCancellation.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.ids && message.ids.length))
                                            message.ids = [];
                                        message.ids.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BidiGenerateContentToolCallCancellation message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation} BidiGenerateContentToolCallCancellation
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentToolCallCancellation.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BidiGenerateContentToolCallCancellation message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BidiGenerateContentToolCallCancellation.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.ids != null && message.hasOwnProperty("ids")) {
                                if (!Array.isArray(message.ids))
                                    return "ids: array expected";
                                for (var i = 0; i < message.ids.length; ++i)
                                    if (!$util.isString(message.ids[i]))
                                        return "ids: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BidiGenerateContentToolCallCancellation message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation} BidiGenerateContentToolCallCancellation
                         */
                        BidiGenerateContentToolCallCancellation.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation();
                            if (object.ids) {
                                if (!Array.isArray(object.ids))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.ids: array expected");
                                message.ids = [];
                                for (var i = 0; i < object.ids.length; ++i)
                                    message.ids[i] = String(object.ids[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BidiGenerateContentToolCallCancellation message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation} message BidiGenerateContentToolCallCancellation
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BidiGenerateContentToolCallCancellation.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.ids = [];
                            if (message.ids && message.ids.length) {
                                object.ids = [];
                                for (var j = 0; j < message.ids.length; ++j)
                                    object.ids[j] = message.ids[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BidiGenerateContentToolCallCancellation to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BidiGenerateContentToolCallCancellation.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BidiGenerateContentToolCallCancellation
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BidiGenerateContentToolCallCancellation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation";
                        };
    
                        return BidiGenerateContentToolCallCancellation;
                    })();
    
                    v1alpha.BidiGenerateContentServerMessage = (function() {
    
                        /**
                         * Properties of a BidiGenerateContentServerMessage.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBidiGenerateContentServerMessage
                         * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete|null} [setupComplete] BidiGenerateContentServerMessage setupComplete
                         * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent|null} [serverContent] BidiGenerateContentServerMessage serverContent
                         * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall|null} [toolCall] BidiGenerateContentServerMessage toolCall
                         * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation|null} [toolCallCancellation] BidiGenerateContentServerMessage toolCallCancellation
                         */
    
                        /**
                         * Constructs a new BidiGenerateContentServerMessage.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BidiGenerateContentServerMessage.
                         * @implements IBidiGenerateContentServerMessage
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage=} [properties] Properties to set
                         */
                        function BidiGenerateContentServerMessage(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BidiGenerateContentServerMessage setupComplete.
                         * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete|null|undefined} setupComplete
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @instance
                         */
                        BidiGenerateContentServerMessage.prototype.setupComplete = null;
    
                        /**
                         * BidiGenerateContentServerMessage serverContent.
                         * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent|null|undefined} serverContent
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @instance
                         */
                        BidiGenerateContentServerMessage.prototype.serverContent = null;
    
                        /**
                         * BidiGenerateContentServerMessage toolCall.
                         * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall|null|undefined} toolCall
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @instance
                         */
                        BidiGenerateContentServerMessage.prototype.toolCall = null;
    
                        /**
                         * BidiGenerateContentServerMessage toolCallCancellation.
                         * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation|null|undefined} toolCallCancellation
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @instance
                         */
                        BidiGenerateContentServerMessage.prototype.toolCallCancellation = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * BidiGenerateContentServerMessage messageType.
                         * @member {"setupComplete"|"serverContent"|"toolCall"|"toolCallCancellation"|undefined} messageType
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @instance
                         */
                        Object.defineProperty(BidiGenerateContentServerMessage.prototype, "messageType", {
                            get: $util.oneOfGetter($oneOfFields = ["setupComplete", "serverContent", "toolCall", "toolCallCancellation"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new BidiGenerateContentServerMessage instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} BidiGenerateContentServerMessage instance
                         */
                        BidiGenerateContentServerMessage.create = function create(properties) {
                            return new BidiGenerateContentServerMessage(properties);
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentServerMessage message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage} message BidiGenerateContentServerMessage message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentServerMessage.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.setupComplete != null && Object.hasOwnProperty.call(message, "setupComplete"))
                                $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.encode(message.setupComplete, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.serverContent != null && Object.hasOwnProperty.call(message, "serverContent"))
                                $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.encode(message.serverContent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall"))
                                $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.encode(message.toolCall, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.toolCallCancellation != null && Object.hasOwnProperty.call(message, "toolCallCancellation"))
                                $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.encode(message.toolCallCancellation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BidiGenerateContentServerMessage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage} message BidiGenerateContentServerMessage message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BidiGenerateContentServerMessage.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BidiGenerateContentServerMessage message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} BidiGenerateContentServerMessage
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentServerMessage.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.setupComplete = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.serverContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.toolCall = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        message.toolCallCancellation = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BidiGenerateContentServerMessage message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} BidiGenerateContentServerMessage
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BidiGenerateContentServerMessage.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BidiGenerateContentServerMessage message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BidiGenerateContentServerMessage.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.setupComplete != null && message.hasOwnProperty("setupComplete")) {
                                properties.messageType = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.verify(message.setupComplete);
                                    if (error)
                                        return "setupComplete." + error;
                                }
                            }
                            if (message.serverContent != null && message.hasOwnProperty("serverContent")) {
                                if (properties.messageType === 1)
                                    return "messageType: multiple values";
                                properties.messageType = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.verify(message.serverContent);
                                    if (error)
                                        return "serverContent." + error;
                                }
                            }
                            if (message.toolCall != null && message.hasOwnProperty("toolCall")) {
                                if (properties.messageType === 1)
                                    return "messageType: multiple values";
                                properties.messageType = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.verify(message.toolCall);
                                    if (error)
                                        return "toolCall." + error;
                                }
                            }
                            if (message.toolCallCancellation != null && message.hasOwnProperty("toolCallCancellation")) {
                                if (properties.messageType === 1)
                                    return "messageType: multiple values";
                                properties.messageType = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.verify(message.toolCallCancellation);
                                    if (error)
                                        return "toolCallCancellation." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BidiGenerateContentServerMessage message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} BidiGenerateContentServerMessage
                         */
                        BidiGenerateContentServerMessage.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage();
                            if (object.setupComplete != null) {
                                if (typeof object.setupComplete !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.setupComplete: object expected");
                                message.setupComplete = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.fromObject(object.setupComplete);
                            }
                            if (object.serverContent != null) {
                                if (typeof object.serverContent !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.serverContent: object expected");
                                message.serverContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.fromObject(object.serverContent);
                            }
                            if (object.toolCall != null) {
                                if (typeof object.toolCall !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.toolCall: object expected");
                                message.toolCall = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.fromObject(object.toolCall);
                            }
                            if (object.toolCallCancellation != null) {
                                if (typeof object.toolCallCancellation !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.toolCallCancellation: object expected");
                                message.toolCallCancellation = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.fromObject(object.toolCallCancellation);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BidiGenerateContentServerMessage message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} message BidiGenerateContentServerMessage
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BidiGenerateContentServerMessage.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.setupComplete != null && message.hasOwnProperty("setupComplete")) {
                                object.setupComplete = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.toObject(message.setupComplete, options);
                                if (options.oneofs)
                                    object.messageType = "setupComplete";
                            }
                            if (message.serverContent != null && message.hasOwnProperty("serverContent")) {
                                object.serverContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.toObject(message.serverContent, options);
                                if (options.oneofs)
                                    object.messageType = "serverContent";
                            }
                            if (message.toolCall != null && message.hasOwnProperty("toolCall")) {
                                object.toolCall = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.toObject(message.toolCall, options);
                                if (options.oneofs)
                                    object.messageType = "toolCall";
                            }
                            if (message.toolCallCancellation != null && message.hasOwnProperty("toolCallCancellation")) {
                                object.toolCallCancellation = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.toObject(message.toolCallCancellation, options);
                                if (options.oneofs)
                                    object.messageType = "toolCallCancellation";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BidiGenerateContentServerMessage to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BidiGenerateContentServerMessage.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BidiGenerateContentServerMessage
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BidiGenerateContentServerMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage";
                        };
    
                        return BidiGenerateContentServerMessage;
                    })();
    
                    v1alpha.Corpus = (function() {
    
                        /**
                         * Properties of a Corpus.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICorpus
                         * @property {string|null} [name] Corpus name
                         * @property {string|null} [displayName] Corpus displayName
                         * @property {google.protobuf.ITimestamp|null} [createTime] Corpus createTime
                         * @property {google.protobuf.ITimestamp|null} [updateTime] Corpus updateTime
                         */
    
                        /**
                         * Constructs a new Corpus.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Corpus.
                         * @implements ICorpus
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICorpus=} [properties] Properties to set
                         */
                        function Corpus(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Corpus name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @instance
                         */
                        Corpus.prototype.name = "";
    
                        /**
                         * Corpus displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @instance
                         */
                        Corpus.prototype.displayName = "";
    
                        /**
                         * Corpus createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @instance
                         */
                        Corpus.prototype.createTime = null;
    
                        /**
                         * Corpus updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @instance
                         */
                        Corpus.prototype.updateTime = null;
    
                        /**
                         * Creates a new Corpus instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICorpus=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Corpus} Corpus instance
                         */
                        Corpus.create = function create(properties) {
                            return new Corpus(properties);
                        };
    
                        /**
                         * Encodes the specified Corpus message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Corpus.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICorpus} message Corpus message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Corpus.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName);
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Corpus message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Corpus.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICorpus} message Corpus message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Corpus.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Corpus message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Corpus} Corpus
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Corpus.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Corpus();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Corpus message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Corpus} Corpus
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Corpus.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Corpus message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Corpus.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Corpus message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Corpus} Corpus
                         */
                        Corpus.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Corpus)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Corpus();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Corpus.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Corpus.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Corpus message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Corpus} message Corpus
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Corpus.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.displayName = "";
                                object.createTime = null;
                                object.updateTime = null;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            return object;
                        };
    
                        /**
                         * Converts this Corpus to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Corpus.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Corpus
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Corpus
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Corpus.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Corpus";
                        };
    
                        return Corpus;
                    })();
    
                    v1alpha.Document = (function() {
    
                        /**
                         * Properties of a Document.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IDocument
                         * @property {string|null} [name] Document name
                         * @property {string|null} [displayName] Document displayName
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ICustomMetadata>|null} [customMetadata] Document customMetadata
                         * @property {google.protobuf.ITimestamp|null} [updateTime] Document updateTime
                         * @property {google.protobuf.ITimestamp|null} [createTime] Document createTime
                         */
    
                        /**
                         * Constructs a new Document.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Document.
                         * @implements IDocument
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IDocument=} [properties] Properties to set
                         */
                        function Document(properties) {
                            this.customMetadata = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Document name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @instance
                         */
                        Document.prototype.name = "";
    
                        /**
                         * Document displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @instance
                         */
                        Document.prototype.displayName = "";
    
                        /**
                         * Document customMetadata.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ICustomMetadata>} customMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @instance
                         */
                        Document.prototype.customMetadata = $util.emptyArray;
    
                        /**
                         * Document updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @instance
                         */
                        Document.prototype.updateTime = null;
    
                        /**
                         * Document createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @instance
                         */
                        Document.prototype.createTime = null;
    
                        /**
                         * Creates a new Document instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDocument=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Document} Document instance
                         */
                        Document.create = function create(properties) {
                            return new Document(properties);
                        };
    
                        /**
                         * Encodes the specified Document message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Document.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDocument} message Document message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Document.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName);
                            if (message.customMetadata != null && message.customMetadata.length)
                                for (var i = 0; i < message.customMetadata.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.CustomMetadata.encode(message.customMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Document message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Document.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDocument} message Document message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Document.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Document message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Document} Document
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Document.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Document();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 3: {
                                        if (!(message.customMetadata && message.customMetadata.length))
                                            message.customMetadata = [];
                                        message.customMetadata.push($root.google.ai.generativelanguage.v1alpha.CustomMetadata.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Document message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Document} Document
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Document.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Document message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Document.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.customMetadata != null && message.hasOwnProperty("customMetadata")) {
                                if (!Array.isArray(message.customMetadata))
                                    return "customMetadata: array expected";
                                for (var i = 0; i < message.customMetadata.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.verify(message.customMetadata[i]);
                                    if (error)
                                        return "customMetadata." + error;
                                }
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Document message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Document} Document
                         */
                        Document.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Document)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Document();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.customMetadata) {
                                if (!Array.isArray(object.customMetadata))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Document.customMetadata: array expected");
                                message.customMetadata = [];
                                for (var i = 0; i < object.customMetadata.length; ++i) {
                                    if (typeof object.customMetadata[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.Document.customMetadata: object expected");
                                    message.customMetadata[i] = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.fromObject(object.customMetadata[i]);
                                }
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Document.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Document.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Document message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Document} message Document
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Document.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.customMetadata = [];
                            if (options.defaults) {
                                object.name = "";
                                object.displayName = "";
                                object.updateTime = null;
                                object.createTime = null;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.customMetadata && message.customMetadata.length) {
                                object.customMetadata = [];
                                for (var j = 0; j < message.customMetadata.length; ++j)
                                    object.customMetadata[j] = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.toObject(message.customMetadata[j], options);
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            return object;
                        };
    
                        /**
                         * Converts this Document to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Document.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Document
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Document
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Document";
                        };
    
                        return Document;
                    })();
    
                    v1alpha.StringList = (function() {
    
                        /**
                         * Properties of a StringList.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IStringList
                         * @property {Array.<string>|null} [values] StringList values
                         */
    
                        /**
                         * Constructs a new StringList.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a StringList.
                         * @implements IStringList
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IStringList=} [properties] Properties to set
                         */
                        function StringList(properties) {
                            this.values = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * StringList values.
                         * @member {Array.<string>} values
                         * @memberof google.ai.generativelanguage.v1alpha.StringList
                         * @instance
                         */
                        StringList.prototype.values = $util.emptyArray;
    
                        /**
                         * Creates a new StringList instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.StringList
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IStringList=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.StringList} StringList instance
                         */
                        StringList.create = function create(properties) {
                            return new StringList(properties);
                        };
    
                        /**
                         * Encodes the specified StringList message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.StringList.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.StringList
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IStringList} message StringList message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        StringList.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.values != null && message.values.length)
                                for (var i = 0; i < message.values.length; ++i)
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified StringList message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.StringList.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.StringList
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IStringList} message StringList message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        StringList.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a StringList message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.StringList
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.StringList} StringList
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        StringList.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.StringList();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.values && message.values.length))
                                            message.values = [];
                                        message.values.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a StringList message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.StringList
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.StringList} StringList
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        StringList.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a StringList message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.StringList
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        StringList.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.values != null && message.hasOwnProperty("values")) {
                                if (!Array.isArray(message.values))
                                    return "values: array expected";
                                for (var i = 0; i < message.values.length; ++i)
                                    if (!$util.isString(message.values[i]))
                                        return "values: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a StringList message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.StringList
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.StringList} StringList
                         */
                        StringList.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.StringList)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.StringList();
                            if (object.values) {
                                if (!Array.isArray(object.values))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.StringList.values: array expected");
                                message.values = [];
                                for (var i = 0; i < object.values.length; ++i)
                                    message.values[i] = String(object.values[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a StringList message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.StringList
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.StringList} message StringList
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        StringList.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.values = [];
                            if (message.values && message.values.length) {
                                object.values = [];
                                for (var j = 0; j < message.values.length; ++j)
                                    object.values[j] = message.values[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this StringList to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.StringList
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        StringList.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for StringList
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.StringList
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        StringList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.StringList";
                        };
    
                        return StringList;
                    })();
    
                    v1alpha.CustomMetadata = (function() {
    
                        /**
                         * Properties of a CustomMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICustomMetadata
                         * @property {string|null} [stringValue] CustomMetadata stringValue
                         * @property {google.ai.generativelanguage.v1alpha.IStringList|null} [stringListValue] CustomMetadata stringListValue
                         * @property {number|null} [numericValue] CustomMetadata numericValue
                         * @property {string|null} [key] CustomMetadata key
                         */
    
                        /**
                         * Constructs a new CustomMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CustomMetadata.
                         * @implements ICustomMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICustomMetadata=} [properties] Properties to set
                         */
                        function CustomMetadata(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CustomMetadata stringValue.
                         * @member {string|null|undefined} stringValue
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @instance
                         */
                        CustomMetadata.prototype.stringValue = null;
    
                        /**
                         * CustomMetadata stringListValue.
                         * @member {google.ai.generativelanguage.v1alpha.IStringList|null|undefined} stringListValue
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @instance
                         */
                        CustomMetadata.prototype.stringListValue = null;
    
                        /**
                         * CustomMetadata numericValue.
                         * @member {number|null|undefined} numericValue
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @instance
                         */
                        CustomMetadata.prototype.numericValue = null;
    
                        /**
                         * CustomMetadata key.
                         * @member {string} key
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @instance
                         */
                        CustomMetadata.prototype.key = "";
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CustomMetadata value.
                         * @member {"stringValue"|"stringListValue"|"numericValue"|undefined} value
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @instance
                         */
                        Object.defineProperty(CustomMetadata.prototype, "value", {
                            get: $util.oneOfGetter($oneOfFields = ["stringValue", "stringListValue", "numericValue"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CustomMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICustomMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CustomMetadata} CustomMetadata instance
                         */
                        CustomMetadata.create = function create(properties) {
                            return new CustomMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified CustomMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CustomMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICustomMetadata} message CustomMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CustomMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.key != null && Object.hasOwnProperty.call(message, "key"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);
                            if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.stringValue);
                            if (message.stringListValue != null && Object.hasOwnProperty.call(message, "stringListValue"))
                                $root.google.ai.generativelanguage.v1alpha.StringList.encode(message.stringListValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.numericValue != null && Object.hasOwnProperty.call(message, "numericValue"))
                                writer.uint32(/* id 7, wireType 5 =*/61).float(message.numericValue);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CustomMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CustomMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICustomMetadata} message CustomMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CustomMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CustomMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CustomMetadata} CustomMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CustomMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CustomMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.stringValue = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.stringListValue = $root.google.ai.generativelanguage.v1alpha.StringList.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 7: {
                                        message.numericValue = reader.float();
                                        break;
                                    }
                                case 1: {
                                        message.key = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CustomMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CustomMetadata} CustomMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CustomMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CustomMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CustomMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                properties.value = 1;
                                if (!$util.isString(message.stringValue))
                                    return "stringValue: string expected";
                            }
                            if (message.stringListValue != null && message.hasOwnProperty("stringListValue")) {
                                if (properties.value === 1)
                                    return "value: multiple values";
                                properties.value = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.StringList.verify(message.stringListValue);
                                    if (error)
                                        return "stringListValue." + error;
                                }
                            }
                            if (message.numericValue != null && message.hasOwnProperty("numericValue")) {
                                if (properties.value === 1)
                                    return "value: multiple values";
                                properties.value = 1;
                                if (typeof message.numericValue !== "number")
                                    return "numericValue: number expected";
                            }
                            if (message.key != null && message.hasOwnProperty("key"))
                                if (!$util.isString(message.key))
                                    return "key: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a CustomMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CustomMetadata} CustomMetadata
                         */
                        CustomMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CustomMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CustomMetadata();
                            if (object.stringValue != null)
                                message.stringValue = String(object.stringValue);
                            if (object.stringListValue != null) {
                                if (typeof object.stringListValue !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CustomMetadata.stringListValue: object expected");
                                message.stringListValue = $root.google.ai.generativelanguage.v1alpha.StringList.fromObject(object.stringListValue);
                            }
                            if (object.numericValue != null)
                                message.numericValue = Number(object.numericValue);
                            if (object.key != null)
                                message.key = String(object.key);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CustomMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CustomMetadata} message CustomMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CustomMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.key = "";
                            if (message.key != null && message.hasOwnProperty("key"))
                                object.key = message.key;
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                object.stringValue = message.stringValue;
                                if (options.oneofs)
                                    object.value = "stringValue";
                            }
                            if (message.stringListValue != null && message.hasOwnProperty("stringListValue")) {
                                object.stringListValue = $root.google.ai.generativelanguage.v1alpha.StringList.toObject(message.stringListValue, options);
                                if (options.oneofs)
                                    object.value = "stringListValue";
                            }
                            if (message.numericValue != null && message.hasOwnProperty("numericValue")) {
                                object.numericValue = options.json && !isFinite(message.numericValue) ? String(message.numericValue) : message.numericValue;
                                if (options.oneofs)
                                    object.value = "numericValue";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CustomMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CustomMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CustomMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CustomMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CustomMetadata";
                        };
    
                        return CustomMetadata;
                    })();
    
                    v1alpha.MetadataFilter = (function() {
    
                        /**
                         * Properties of a MetadataFilter.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IMetadataFilter
                         * @property {string|null} [key] MetadataFilter key
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ICondition>|null} [conditions] MetadataFilter conditions
                         */
    
                        /**
                         * Constructs a new MetadataFilter.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a MetadataFilter.
                         * @implements IMetadataFilter
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IMetadataFilter=} [properties] Properties to set
                         */
                        function MetadataFilter(properties) {
                            this.conditions = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * MetadataFilter key.
                         * @member {string} key
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @instance
                         */
                        MetadataFilter.prototype.key = "";
    
                        /**
                         * MetadataFilter conditions.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ICondition>} conditions
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @instance
                         */
                        MetadataFilter.prototype.conditions = $util.emptyArray;
    
                        /**
                         * Creates a new MetadataFilter instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IMetadataFilter=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.MetadataFilter} MetadataFilter instance
                         */
                        MetadataFilter.create = function create(properties) {
                            return new MetadataFilter(properties);
                        };
    
                        /**
                         * Encodes the specified MetadataFilter message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MetadataFilter.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IMetadataFilter} message MetadataFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MetadataFilter.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.key != null && Object.hasOwnProperty.call(message, "key"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);
                            if (message.conditions != null && message.conditions.length)
                                for (var i = 0; i < message.conditions.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Condition.encode(message.conditions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified MetadataFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MetadataFilter.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IMetadataFilter} message MetadataFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MetadataFilter.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a MetadataFilter message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.MetadataFilter} MetadataFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MetadataFilter.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.MetadataFilter();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.key = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.conditions && message.conditions.length))
                                            message.conditions = [];
                                        message.conditions.push($root.google.ai.generativelanguage.v1alpha.Condition.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a MetadataFilter message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.MetadataFilter} MetadataFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MetadataFilter.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a MetadataFilter message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        MetadataFilter.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.key != null && message.hasOwnProperty("key"))
                                if (!$util.isString(message.key))
                                    return "key: string expected";
                            if (message.conditions != null && message.hasOwnProperty("conditions")) {
                                if (!Array.isArray(message.conditions))
                                    return "conditions: array expected";
                                for (var i = 0; i < message.conditions.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Condition.verify(message.conditions[i]);
                                    if (error)
                                        return "conditions." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a MetadataFilter message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.MetadataFilter} MetadataFilter
                         */
                        MetadataFilter.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.MetadataFilter)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.MetadataFilter();
                            if (object.key != null)
                                message.key = String(object.key);
                            if (object.conditions) {
                                if (!Array.isArray(object.conditions))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.MetadataFilter.conditions: array expected");
                                message.conditions = [];
                                for (var i = 0; i < object.conditions.length; ++i) {
                                    if (typeof object.conditions[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.MetadataFilter.conditions: object expected");
                                    message.conditions[i] = $root.google.ai.generativelanguage.v1alpha.Condition.fromObject(object.conditions[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a MetadataFilter message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.MetadataFilter} message MetadataFilter
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        MetadataFilter.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.conditions = [];
                            if (options.defaults)
                                object.key = "";
                            if (message.key != null && message.hasOwnProperty("key"))
                                object.key = message.key;
                            if (message.conditions && message.conditions.length) {
                                object.conditions = [];
                                for (var j = 0; j < message.conditions.length; ++j)
                                    object.conditions[j] = $root.google.ai.generativelanguage.v1alpha.Condition.toObject(message.conditions[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this MetadataFilter to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        MetadataFilter.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for MetadataFilter
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        MetadataFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.MetadataFilter";
                        };
    
                        return MetadataFilter;
                    })();
    
                    v1alpha.Condition = (function() {
    
                        /**
                         * Properties of a Condition.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICondition
                         * @property {string|null} [stringValue] Condition stringValue
                         * @property {number|null} [numericValue] Condition numericValue
                         * @property {google.ai.generativelanguage.v1alpha.Condition.Operator|null} [operation] Condition operation
                         */
    
                        /**
                         * Constructs a new Condition.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Condition.
                         * @implements ICondition
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICondition=} [properties] Properties to set
                         */
                        function Condition(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Condition stringValue.
                         * @member {string|null|undefined} stringValue
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @instance
                         */
                        Condition.prototype.stringValue = null;
    
                        /**
                         * Condition numericValue.
                         * @member {number|null|undefined} numericValue
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @instance
                         */
                        Condition.prototype.numericValue = null;
    
                        /**
                         * Condition operation.
                         * @member {google.ai.generativelanguage.v1alpha.Condition.Operator} operation
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @instance
                         */
                        Condition.prototype.operation = 0;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Condition value.
                         * @member {"stringValue"|"numericValue"|undefined} value
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @instance
                         */
                        Object.defineProperty(Condition.prototype, "value", {
                            get: $util.oneOfGetter($oneOfFields = ["stringValue", "numericValue"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Condition instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICondition=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Condition} Condition instance
                         */
                        Condition.create = function create(properties) {
                            return new Condition(properties);
                        };
    
                        /**
                         * Encodes the specified Condition message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Condition.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICondition} message Condition message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Condition.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue);
                            if (message.operation != null && Object.hasOwnProperty.call(message, "operation"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.operation);
                            if (message.numericValue != null && Object.hasOwnProperty.call(message, "numericValue"))
                                writer.uint32(/* id 6, wireType 5 =*/53).float(message.numericValue);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Condition.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICondition} message Condition message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Condition.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Condition message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Condition} Condition
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Condition.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Condition();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.stringValue = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.numericValue = reader.float();
                                        break;
                                    }
                                case 5: {
                                        message.operation = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Condition message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Condition} Condition
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Condition.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Condition message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Condition.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                properties.value = 1;
                                if (!$util.isString(message.stringValue))
                                    return "stringValue: string expected";
                            }
                            if (message.numericValue != null && message.hasOwnProperty("numericValue")) {
                                if (properties.value === 1)
                                    return "value: multiple values";
                                properties.value = 1;
                                if (typeof message.numericValue !== "number")
                                    return "numericValue: number expected";
                            }
                            if (message.operation != null && message.hasOwnProperty("operation"))
                                switch (message.operation) {
                                default:
                                    return "operation: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                case 8:
                                    break;
                                }
                            return null;
                        };
    
                        /**
                         * Creates a Condition message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Condition} Condition
                         */
                        Condition.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Condition)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Condition();
                            if (object.stringValue != null)
                                message.stringValue = String(object.stringValue);
                            if (object.numericValue != null)
                                message.numericValue = Number(object.numericValue);
                            switch (object.operation) {
                            default:
                                if (typeof object.operation === "number") {
                                    message.operation = object.operation;
                                    break;
                                }
                                break;
                            case "OPERATOR_UNSPECIFIED":
                            case 0:
                                message.operation = 0;
                                break;
                            case "LESS":
                            case 1:
                                message.operation = 1;
                                break;
                            case "LESS_EQUAL":
                            case 2:
                                message.operation = 2;
                                break;
                            case "EQUAL":
                            case 3:
                                message.operation = 3;
                                break;
                            case "GREATER_EQUAL":
                            case 4:
                                message.operation = 4;
                                break;
                            case "GREATER":
                            case 5:
                                message.operation = 5;
                                break;
                            case "NOT_EQUAL":
                            case 6:
                                message.operation = 6;
                                break;
                            case "INCLUDES":
                            case 7:
                                message.operation = 7;
                                break;
                            case "EXCLUDES":
                            case 8:
                                message.operation = 8;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Condition message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Condition} message Condition
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Condition.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.operation = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0;
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                object.stringValue = message.stringValue;
                                if (options.oneofs)
                                    object.value = "stringValue";
                            }
                            if (message.operation != null && message.hasOwnProperty("operation"))
                                object.operation = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Condition.Operator[message.operation] === undefined ? message.operation : $root.google.ai.generativelanguage.v1alpha.Condition.Operator[message.operation] : message.operation;
                            if (message.numericValue != null && message.hasOwnProperty("numericValue")) {
                                object.numericValue = options.json && !isFinite(message.numericValue) ? String(message.numericValue) : message.numericValue;
                                if (options.oneofs)
                                    object.value = "numericValue";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Condition to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Condition.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Condition
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Condition
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Condition";
                        };
    
                        /**
                         * Operator enum.
                         * @name google.ai.generativelanguage.v1alpha.Condition.Operator
                         * @enum {number}
                         * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value
                         * @property {number} LESS=1 LESS value
                         * @property {number} LESS_EQUAL=2 LESS_EQUAL value
                         * @property {number} EQUAL=3 EQUAL value
                         * @property {number} GREATER_EQUAL=4 GREATER_EQUAL value
                         * @property {number} GREATER=5 GREATER value
                         * @property {number} NOT_EQUAL=6 NOT_EQUAL value
                         * @property {number} INCLUDES=7 INCLUDES value
                         * @property {number} EXCLUDES=8 EXCLUDES value
                         */
                        Condition.Operator = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "LESS"] = 1;
                            values[valuesById[2] = "LESS_EQUAL"] = 2;
                            values[valuesById[3] = "EQUAL"] = 3;
                            values[valuesById[4] = "GREATER_EQUAL"] = 4;
                            values[valuesById[5] = "GREATER"] = 5;
                            values[valuesById[6] = "NOT_EQUAL"] = 6;
                            values[valuesById[7] = "INCLUDES"] = 7;
                            values[valuesById[8] = "EXCLUDES"] = 8;
                            return values;
                        })();
    
                        return Condition;
                    })();
    
                    v1alpha.Chunk = (function() {
    
                        /**
                         * Properties of a Chunk.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IChunk
                         * @property {string|null} [name] Chunk name
                         * @property {google.ai.generativelanguage.v1alpha.IChunkData|null} [data] Chunk data
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ICustomMetadata>|null} [customMetadata] Chunk customMetadata
                         * @property {google.protobuf.ITimestamp|null} [createTime] Chunk createTime
                         * @property {google.protobuf.ITimestamp|null} [updateTime] Chunk updateTime
                         * @property {google.ai.generativelanguage.v1alpha.Chunk.State|null} [state] Chunk state
                         */
    
                        /**
                         * Constructs a new Chunk.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Chunk.
                         * @implements IChunk
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IChunk=} [properties] Properties to set
                         */
                        function Chunk(properties) {
                            this.customMetadata = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Chunk name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @instance
                         */
                        Chunk.prototype.name = "";
    
                        /**
                         * Chunk data.
                         * @member {google.ai.generativelanguage.v1alpha.IChunkData|null|undefined} data
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @instance
                         */
                        Chunk.prototype.data = null;
    
                        /**
                         * Chunk customMetadata.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ICustomMetadata>} customMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @instance
                         */
                        Chunk.prototype.customMetadata = $util.emptyArray;
    
                        /**
                         * Chunk createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @instance
                         */
                        Chunk.prototype.createTime = null;
    
                        /**
                         * Chunk updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @instance
                         */
                        Chunk.prototype.updateTime = null;
    
                        /**
                         * Chunk state.
                         * @member {google.ai.generativelanguage.v1alpha.Chunk.State} state
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @instance
                         */
                        Chunk.prototype.state = 0;
    
                        /**
                         * Creates a new Chunk instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IChunk=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Chunk} Chunk instance
                         */
                        Chunk.create = function create(properties) {
                            return new Chunk(properties);
                        };
    
                        /**
                         * Encodes the specified Chunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Chunk.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IChunk} message Chunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Chunk.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.data != null && Object.hasOwnProperty.call(message, "data"))
                                $root.google.ai.generativelanguage.v1alpha.ChunkData.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.customMetadata != null && message.customMetadata.length)
                                for (var i = 0; i < message.customMetadata.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.CustomMetadata.encode(message.customMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Chunk.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IChunk} message Chunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Chunk.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Chunk message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Chunk} Chunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Chunk.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Chunk();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.data = $root.google.ai.generativelanguage.v1alpha.ChunkData.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.customMetadata && message.customMetadata.length))
                                            message.customMetadata = [];
                                        message.customMetadata.push($root.google.ai.generativelanguage.v1alpha.CustomMetadata.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 6: {
                                        message.state = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Chunk message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Chunk} Chunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Chunk.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Chunk message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Chunk.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.data != null && message.hasOwnProperty("data")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.ChunkData.verify(message.data);
                                if (error)
                                    return "data." + error;
                            }
                            if (message.customMetadata != null && message.hasOwnProperty("customMetadata")) {
                                if (!Array.isArray(message.customMetadata))
                                    return "customMetadata: array expected";
                                for (var i = 0; i < message.customMetadata.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.verify(message.customMetadata[i]);
                                    if (error)
                                        return "customMetadata." + error;
                                }
                            }
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            if (message.state != null && message.hasOwnProperty("state"))
                                switch (message.state) {
                                default:
                                    return "state: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 10:
                                    break;
                                }
                            return null;
                        };
    
                        /**
                         * Creates a Chunk message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Chunk} Chunk
                         */
                        Chunk.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Chunk)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Chunk();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.data != null) {
                                if (typeof object.data !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Chunk.data: object expected");
                                message.data = $root.google.ai.generativelanguage.v1alpha.ChunkData.fromObject(object.data);
                            }
                            if (object.customMetadata) {
                                if (!Array.isArray(object.customMetadata))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Chunk.customMetadata: array expected");
                                message.customMetadata = [];
                                for (var i = 0; i < object.customMetadata.length; ++i) {
                                    if (typeof object.customMetadata[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.Chunk.customMetadata: object expected");
                                    message.customMetadata[i] = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.fromObject(object.customMetadata[i]);
                                }
                            }
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Chunk.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Chunk.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            switch (object.state) {
                            default:
                                if (typeof object.state === "number") {
                                    message.state = object.state;
                                    break;
                                }
                                break;
                            case "STATE_UNSPECIFIED":
                            case 0:
                                message.state = 0;
                                break;
                            case "STATE_PENDING_PROCESSING":
                            case 1:
                                message.state = 1;
                                break;
                            case "STATE_ACTIVE":
                            case 2:
                                message.state = 2;
                                break;
                            case "STATE_FAILED":
                            case 10:
                                message.state = 10;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Chunk message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Chunk} message Chunk
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Chunk.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.customMetadata = [];
                            if (options.defaults) {
                                object.name = "";
                                object.data = null;
                                object.createTime = null;
                                object.updateTime = null;
                                object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.data != null && message.hasOwnProperty("data"))
                                object.data = $root.google.ai.generativelanguage.v1alpha.ChunkData.toObject(message.data, options);
                            if (message.customMetadata && message.customMetadata.length) {
                                object.customMetadata = [];
                                for (var j = 0; j < message.customMetadata.length; ++j)
                                    object.customMetadata[j] = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.toObject(message.customMetadata[j], options);
                            }
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            if (message.state != null && message.hasOwnProperty("state"))
                                object.state = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Chunk.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1alpha.Chunk.State[message.state] : message.state;
                            return object;
                        };
    
                        /**
                         * Converts this Chunk to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Chunk.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Chunk
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Chunk
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Chunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Chunk";
                        };
    
                        /**
                         * State enum.
                         * @name google.ai.generativelanguage.v1alpha.Chunk.State
                         * @enum {number}
                         * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value
                         * @property {number} STATE_PENDING_PROCESSING=1 STATE_PENDING_PROCESSING value
                         * @property {number} STATE_ACTIVE=2 STATE_ACTIVE value
                         * @property {number} STATE_FAILED=10 STATE_FAILED value
                         */
                        Chunk.State = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "STATE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "STATE_PENDING_PROCESSING"] = 1;
                            values[valuesById[2] = "STATE_ACTIVE"] = 2;
                            values[valuesById[10] = "STATE_FAILED"] = 10;
                            return values;
                        })();
    
                        return Chunk;
                    })();
    
                    v1alpha.ChunkData = (function() {
    
                        /**
                         * Properties of a ChunkData.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IChunkData
                         * @property {string|null} [stringValue] ChunkData stringValue
                         */
    
                        /**
                         * Constructs a new ChunkData.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ChunkData.
                         * @implements IChunkData
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IChunkData=} [properties] Properties to set
                         */
                        function ChunkData(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ChunkData stringValue.
                         * @member {string|null|undefined} stringValue
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @instance
                         */
                        ChunkData.prototype.stringValue = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * ChunkData data.
                         * @member {"stringValue"|undefined} data
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @instance
                         */
                        Object.defineProperty(ChunkData.prototype, "data", {
                            get: $util.oneOfGetter($oneOfFields = ["stringValue"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new ChunkData instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IChunkData=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ChunkData} ChunkData instance
                         */
                        ChunkData.create = function create(properties) {
                            return new ChunkData(properties);
                        };
    
                        /**
                         * Encodes the specified ChunkData message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ChunkData.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IChunkData} message ChunkData message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ChunkData.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ChunkData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ChunkData.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IChunkData} message ChunkData message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ChunkData.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ChunkData message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ChunkData} ChunkData
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ChunkData.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ChunkData();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.stringValue = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ChunkData message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ChunkData} ChunkData
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ChunkData.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ChunkData message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ChunkData.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                properties.data = 1;
                                if (!$util.isString(message.stringValue))
                                    return "stringValue: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a ChunkData message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ChunkData} ChunkData
                         */
                        ChunkData.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ChunkData)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ChunkData();
                            if (object.stringValue != null)
                                message.stringValue = String(object.stringValue);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ChunkData message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ChunkData} message ChunkData
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ChunkData.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                object.stringValue = message.stringValue;
                                if (options.oneofs)
                                    object.data = "stringValue";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this ChunkData to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ChunkData.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ChunkData
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ChunkData
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ChunkData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ChunkData";
                        };
    
                        return ChunkData;
                    })();
    
                    v1alpha.Model = (function() {
    
                        /**
                         * Properties of a Model.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IModel
                         * @property {string|null} [name] Model name
                         * @property {string|null} [baseModelId] Model baseModelId
                         * @property {string|null} [version] Model version
                         * @property {string|null} [displayName] Model displayName
                         * @property {string|null} [description] Model description
                         * @property {number|null} [inputTokenLimit] Model inputTokenLimit
                         * @property {number|null} [outputTokenLimit] Model outputTokenLimit
                         * @property {Array.<string>|null} [supportedGenerationMethods] Model supportedGenerationMethods
                         * @property {number|null} [temperature] Model temperature
                         * @property {number|null} [maxTemperature] Model maxTemperature
                         * @property {number|null} [topP] Model topP
                         * @property {number|null} [topK] Model topK
                         */
    
                        /**
                         * Constructs a new Model.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Model.
                         * @implements IModel
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IModel=} [properties] Properties to set
                         */
                        function Model(properties) {
                            this.supportedGenerationMethods = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Model name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.name = "";
    
                        /**
                         * Model baseModelId.
                         * @member {string} baseModelId
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.baseModelId = "";
    
                        /**
                         * Model version.
                         * @member {string} version
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.version = "";
    
                        /**
                         * Model displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.displayName = "";
    
                        /**
                         * Model description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.description = "";
    
                        /**
                         * Model inputTokenLimit.
                         * @member {number} inputTokenLimit
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.inputTokenLimit = 0;
    
                        /**
                         * Model outputTokenLimit.
                         * @member {number} outputTokenLimit
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.outputTokenLimit = 0;
    
                        /**
                         * Model supportedGenerationMethods.
                         * @member {Array.<string>} supportedGenerationMethods
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.supportedGenerationMethods = $util.emptyArray;
    
                        /**
                         * Model temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.temperature = null;
    
                        /**
                         * Model maxTemperature.
                         * @member {number|null|undefined} maxTemperature
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.maxTemperature = null;
    
                        /**
                         * Model topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.topP = null;
    
                        /**
                         * Model topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Model.prototype.topK = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Model _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _maxTemperature.
                         * @member {"maxTemperature"|undefined} _maxTemperature
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_maxTemperature", {
                            get: $util.oneOfGetter($oneOfFields = ["maxTemperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Model instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IModel=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Model} Model instance
                         */
                        Model.create = function create(properties) {
                            return new Model(properties);
                        };
    
                        /**
                         * Encodes the specified Model message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Model.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IModel} message Model message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Model.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.baseModelId != null && Object.hasOwnProperty.call(message, "baseModelId"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModelId);
                            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.version);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 5, wireType 2 =*/42).string(message.description);
                            if (message.inputTokenLimit != null && Object.hasOwnProperty.call(message, "inputTokenLimit"))
                                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.inputTokenLimit);
                            if (message.outputTokenLimit != null && Object.hasOwnProperty.call(message, "outputTokenLimit"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.outputTokenLimit);
                            if (message.supportedGenerationMethods != null && message.supportedGenerationMethods.length)
                                for (var i = 0; i < message.supportedGenerationMethods.length; ++i)
                                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.supportedGenerationMethods[i]);
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 9, wireType 5 =*/77).float(message.temperature);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 10, wireType 5 =*/85).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 11, wireType 0 =*/88).int32(message.topK);
                            if (message.maxTemperature != null && Object.hasOwnProperty.call(message, "maxTemperature"))
                                writer.uint32(/* id 13, wireType 5 =*/109).float(message.maxTemperature);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Model message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Model.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IModel} message Model message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Model.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Model message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Model} Model
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Model.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Model();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.baseModelId = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.version = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 5: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.inputTokenLimit = reader.int32();
                                        break;
                                    }
                                case 7: {
                                        message.outputTokenLimit = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        if (!(message.supportedGenerationMethods && message.supportedGenerationMethods.length))
                                            message.supportedGenerationMethods = [];
                                        message.supportedGenerationMethods.push(reader.string());
                                        break;
                                    }
                                case 9: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 13: {
                                        message.maxTemperature = reader.float();
                                        break;
                                    }
                                case 10: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 11: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Model message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Model} Model
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Model.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Model message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Model.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.baseModelId != null && message.hasOwnProperty("baseModelId"))
                                if (!$util.isString(message.baseModelId))
                                    return "baseModelId: string expected";
                            if (message.version != null && message.hasOwnProperty("version"))
                                if (!$util.isString(message.version))
                                    return "version: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit"))
                                if (!$util.isInteger(message.inputTokenLimit))
                                    return "inputTokenLimit: integer expected";
                            if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit"))
                                if (!$util.isInteger(message.outputTokenLimit))
                                    return "outputTokenLimit: integer expected";
                            if (message.supportedGenerationMethods != null && message.hasOwnProperty("supportedGenerationMethods")) {
                                if (!Array.isArray(message.supportedGenerationMethods))
                                    return "supportedGenerationMethods: array expected";
                                for (var i = 0; i < message.supportedGenerationMethods.length; ++i)
                                    if (!$util.isString(message.supportedGenerationMethods[i]))
                                        return "supportedGenerationMethods: string[] expected";
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.maxTemperature != null && message.hasOwnProperty("maxTemperature")) {
                                properties._maxTemperature = 1;
                                if (typeof message.maxTemperature !== "number")
                                    return "maxTemperature: number expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Model message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Model} Model
                         */
                        Model.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Model)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Model();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.baseModelId != null)
                                message.baseModelId = String(object.baseModelId);
                            if (object.version != null)
                                message.version = String(object.version);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.inputTokenLimit != null)
                                message.inputTokenLimit = object.inputTokenLimit | 0;
                            if (object.outputTokenLimit != null)
                                message.outputTokenLimit = object.outputTokenLimit | 0;
                            if (object.supportedGenerationMethods) {
                                if (!Array.isArray(object.supportedGenerationMethods))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Model.supportedGenerationMethods: array expected");
                                message.supportedGenerationMethods = [];
                                for (var i = 0; i < object.supportedGenerationMethods.length; ++i)
                                    message.supportedGenerationMethods[i] = String(object.supportedGenerationMethods[i]);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.maxTemperature != null)
                                message.maxTemperature = Number(object.maxTemperature);
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Model message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Model} message Model
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Model.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.supportedGenerationMethods = [];
                            if (options.defaults) {
                                object.name = "";
                                object.baseModelId = "";
                                object.version = "";
                                object.displayName = "";
                                object.description = "";
                                object.inputTokenLimit = 0;
                                object.outputTokenLimit = 0;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.baseModelId != null && message.hasOwnProperty("baseModelId"))
                                object.baseModelId = message.baseModelId;
                            if (message.version != null && message.hasOwnProperty("version"))
                                object.version = message.version;
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit"))
                                object.inputTokenLimit = message.inputTokenLimit;
                            if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit"))
                                object.outputTokenLimit = message.outputTokenLimit;
                            if (message.supportedGenerationMethods && message.supportedGenerationMethods.length) {
                                object.supportedGenerationMethods = [];
                                for (var j = 0; j < message.supportedGenerationMethods.length; ++j)
                                    object.supportedGenerationMethods[j] = message.supportedGenerationMethods[j];
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.maxTemperature != null && message.hasOwnProperty("maxTemperature")) {
                                object.maxTemperature = options.json && !isFinite(message.maxTemperature) ? String(message.maxTemperature) : message.maxTemperature;
                                if (options.oneofs)
                                    object._maxTemperature = "maxTemperature";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Model to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Model.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Model
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Model
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Model";
                        };
    
                        return Model;
                    })();
    
                    v1alpha.ModelService = (function() {
    
                        /**
                         * Constructs a new ModelService service.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ModelService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function ModelService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (ModelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ModelService;
    
                        /**
                         * Creates new ModelService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {ModelService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        ModelService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|getModel}.
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @typedef GetModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Model} [response] Model
                         */
    
                        /**
                         * Calls GetModel.
                         * @function getModel
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest} request GetModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.ModelService.GetModelCallback} callback Node-style callback called with the error, if any, and Model
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.getModel = function getModel(request, callback) {
                            return this.rpcCall(getModel, $root.google.ai.generativelanguage.v1alpha.GetModelRequest, $root.google.ai.generativelanguage.v1alpha.Model, request, callback);
                        }, "name", { value: "GetModel" });
    
                        /**
                         * Calls GetModel.
                         * @function getModel
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest} request GetModelRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Model>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|listModels}.
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @typedef ListModelsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.ListModelsResponse} [response] ListModelsResponse
                         */
    
                        /**
                         * Calls ListModels.
                         * @function listModels
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest} request ListModelsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.ModelService.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.listModels = function listModels(request, callback) {
                            return this.rpcCall(listModels, $root.google.ai.generativelanguage.v1alpha.ListModelsRequest, $root.google.ai.generativelanguage.v1alpha.ListModelsResponse, request, callback);
                        }, "name", { value: "ListModels" });
    
                        /**
                         * Calls ListModels.
                         * @function listModels
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest} request ListModelsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.ListModelsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|getTunedModel}.
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @typedef GetTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.TunedModel} [response] TunedModel
                         */
    
                        /**
                         * Calls GetTunedModel.
                         * @function getTunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest} request GetTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.ModelService.GetTunedModelCallback} callback Node-style callback called with the error, if any, and TunedModel
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.getTunedModel = function getTunedModel(request, callback) {
                            return this.rpcCall(getTunedModel, $root.google.ai.generativelanguage.v1alpha.GetTunedModelRequest, $root.google.ai.generativelanguage.v1alpha.TunedModel, request, callback);
                        }, "name", { value: "GetTunedModel" });
    
                        /**
                         * Calls GetTunedModel.
                         * @function getTunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest} request GetTunedModelRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.TunedModel>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|listTunedModels}.
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @typedef ListTunedModelsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} [response] ListTunedModelsResponse
                         */
    
                        /**
                         * Calls ListTunedModels.
                         * @function listTunedModels
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest} request ListTunedModelsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.ModelService.ListTunedModelsCallback} callback Node-style callback called with the error, if any, and ListTunedModelsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.listTunedModels = function listTunedModels(request, callback) {
                            return this.rpcCall(listTunedModels, $root.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest, $root.google.ai.generativelanguage.v1alpha.ListTunedModelsResponse, request, callback);
                        }, "name", { value: "ListTunedModels" });
    
                        /**
                         * Calls ListTunedModels.
                         * @function listTunedModels
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest} request ListTunedModelsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.ListTunedModelsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|createTunedModel}.
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @typedef CreateTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.longrunning.Operation} [response] Operation
                         */
    
                        /**
                         * Calls CreateTunedModel.
                         * @function createTunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest} request CreateTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.ModelService.CreateTunedModelCallback} callback Node-style callback called with the error, if any, and Operation
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.createTunedModel = function createTunedModel(request, callback) {
                            return this.rpcCall(createTunedModel, $root.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest, $root.google.longrunning.Operation, request, callback);
                        }, "name", { value: "CreateTunedModel" });
    
                        /**
                         * Calls CreateTunedModel.
                         * @function createTunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest} request CreateTunedModelRequest message or plain object
                         * @returns {Promise<google.longrunning.Operation>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|updateTunedModel}.
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @typedef UpdateTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.TunedModel} [response] TunedModel
                         */
    
                        /**
                         * Calls UpdateTunedModel.
                         * @function updateTunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest} request UpdateTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.ModelService.UpdateTunedModelCallback} callback Node-style callback called with the error, if any, and TunedModel
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.updateTunedModel = function updateTunedModel(request, callback) {
                            return this.rpcCall(updateTunedModel, $root.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest, $root.google.ai.generativelanguage.v1alpha.TunedModel, request, callback);
                        }, "name", { value: "UpdateTunedModel" });
    
                        /**
                         * Calls UpdateTunedModel.
                         * @function updateTunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest} request UpdateTunedModelRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.TunedModel>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|deleteTunedModel}.
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @typedef DeleteTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteTunedModel.
                         * @function deleteTunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest} request DeleteTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.ModelService.DeleteTunedModelCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.deleteTunedModel = function deleteTunedModel(request, callback) {
                            return this.rpcCall(deleteTunedModel, $root.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteTunedModel" });
    
                        /**
                         * Calls DeleteTunedModel.
                         * @function deleteTunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest} request DeleteTunedModelRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        return ModelService;
                    })();
    
                    v1alpha.GetModelRequest = (function() {
    
                        /**
                         * Properties of a GetModelRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGetModelRequest
                         * @property {string|null} [name] GetModelRequest name
                         */
    
                        /**
                         * Constructs a new GetModelRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GetModelRequest.
                         * @implements IGetModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest=} [properties] Properties to set
                         */
                        function GetModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetModelRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest
                         * @instance
                         */
                        GetModelRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GetModelRequest} GetModelRequest instance
                         */
                        GetModelRequest.create = function create(properties) {
                            return new GetModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest} message GetModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest} message GetModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GetModelRequest} GetModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GetModelRequest} GetModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GetModelRequest} GetModelRequest
                         */
                        GetModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GetModelRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GetModelRequest} message GetModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetModelRequest";
                        };
    
                        return GetModelRequest;
                    })();
    
                    v1alpha.ListModelsRequest = (function() {
    
                        /**
                         * Properties of a ListModelsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListModelsRequest
                         * @property {number|null} [pageSize] ListModelsRequest pageSize
                         * @property {string|null} [pageToken] ListModelsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListModelsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListModelsRequest.
                         * @implements IListModelsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest=} [properties] Properties to set
                         */
                        function ListModelsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListModelsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @instance
                         */
                        ListModelsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListModelsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @instance
                         */
                        ListModelsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListModelsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListModelsRequest} ListModelsRequest instance
                         */
                        ListModelsRequest.create = function create(properties) {
                            return new ListModelsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest} message ListModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest} message ListModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListModelsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListModelsRequest} ListModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListModelsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListModelsRequest} ListModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListModelsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListModelsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListModelsRequest} ListModelsRequest
                         */
                        ListModelsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListModelsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListModelsRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListModelsRequest} message ListModelsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListModelsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListModelsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListModelsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListModelsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListModelsRequest";
                        };
    
                        return ListModelsRequest;
                    })();
    
                    v1alpha.ListModelsResponse = (function() {
    
                        /**
                         * Properties of a ListModelsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListModelsResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IModel>|null} [models] ListModelsResponse models
                         * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListModelsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListModelsResponse.
                         * @implements IListModelsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListModelsResponse=} [properties] Properties to set
                         */
                        function ListModelsResponse(properties) {
                            this.models = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListModelsResponse models.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IModel>} models
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @instance
                         */
                        ListModelsResponse.prototype.models = $util.emptyArray;
    
                        /**
                         * ListModelsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @instance
                         */
                        ListModelsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListModelsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListModelsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListModelsResponse} ListModelsResponse instance
                         */
                        ListModelsResponse.create = function create(properties) {
                            return new ListModelsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListModelsResponse} message ListModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.models != null && message.models.length)
                                for (var i = 0; i < message.models.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Model.encode(message.models[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListModelsResponse} message ListModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListModelsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListModelsResponse} ListModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListModelsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.models && message.models.length))
                                            message.models = [];
                                        message.models.push($root.google.ai.generativelanguage.v1alpha.Model.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListModelsResponse} ListModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListModelsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListModelsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.models != null && message.hasOwnProperty("models")) {
                                if (!Array.isArray(message.models))
                                    return "models: array expected";
                                for (var i = 0; i < message.models.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Model.verify(message.models[i]);
                                    if (error)
                                        return "models." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListModelsResponse} ListModelsResponse
                         */
                        ListModelsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListModelsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListModelsResponse();
                            if (object.models) {
                                if (!Array.isArray(object.models))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.ListModelsResponse.models: array expected");
                                message.models = [];
                                for (var i = 0; i < object.models.length; ++i) {
                                    if (typeof object.models[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.ListModelsResponse.models: object expected");
                                    message.models[i] = $root.google.ai.generativelanguage.v1alpha.Model.fromObject(object.models[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListModelsResponse} message ListModelsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListModelsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.models = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.models && message.models.length) {
                                object.models = [];
                                for (var j = 0; j < message.models.length; ++j)
                                    object.models[j] = $root.google.ai.generativelanguage.v1alpha.Model.toObject(message.models[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListModelsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListModelsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListModelsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListModelsResponse";
                        };
    
                        return ListModelsResponse;
                    })();
    
                    v1alpha.GetTunedModelRequest = (function() {
    
                        /**
                         * Properties of a GetTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGetTunedModelRequest
                         * @property {string|null} [name] GetTunedModelRequest name
                         */
    
                        /**
                         * Constructs a new GetTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GetTunedModelRequest.
                         * @implements IGetTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest=} [properties] Properties to set
                         */
                        function GetTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetTunedModelRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest
                         * @instance
                         */
                        GetTunedModelRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GetTunedModelRequest} GetTunedModelRequest instance
                         */
                        GetTunedModelRequest.create = function create(properties) {
                            return new GetTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest} message GetTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest} message GetTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GetTunedModelRequest} GetTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GetTunedModelRequest} GetTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GetTunedModelRequest} GetTunedModelRequest
                         */
                        GetTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GetTunedModelRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GetTunedModelRequest} message GetTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetTunedModelRequest";
                        };
    
                        return GetTunedModelRequest;
                    })();
    
                    v1alpha.ListTunedModelsRequest = (function() {
    
                        /**
                         * Properties of a ListTunedModelsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListTunedModelsRequest
                         * @property {number|null} [pageSize] ListTunedModelsRequest pageSize
                         * @property {string|null} [pageToken] ListTunedModelsRequest pageToken
                         * @property {string|null} [filter] ListTunedModelsRequest filter
                         */
    
                        /**
                         * Constructs a new ListTunedModelsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListTunedModelsRequest.
                         * @implements IListTunedModelsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest=} [properties] Properties to set
                         */
                        function ListTunedModelsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListTunedModelsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @instance
                         */
                        ListTunedModelsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListTunedModelsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @instance
                         */
                        ListTunedModelsRequest.prototype.pageToken = "";
    
                        /**
                         * ListTunedModelsRequest filter.
                         * @member {string} filter
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @instance
                         */
                        ListTunedModelsRequest.prototype.filter = "";
    
                        /**
                         * Creates a new ListTunedModelsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsRequest} ListTunedModelsRequest instance
                         */
                        ListTunedModelsRequest.create = function create(properties) {
                            return new ListTunedModelsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest} message ListTunedModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken);
                            if (message.filter != null && Object.hasOwnProperty.call(message, "filter"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest} message ListTunedModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListTunedModelsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsRequest} ListTunedModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.filter = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListTunedModelsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsRequest} ListTunedModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListTunedModelsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListTunedModelsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            if (message.filter != null && message.hasOwnProperty("filter"))
                                if (!$util.isString(message.filter))
                                    return "filter: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListTunedModelsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsRequest} ListTunedModelsRequest
                         */
                        ListTunedModelsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            if (object.filter != null)
                                message.filter = String(object.filter);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListTunedModelsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListTunedModelsRequest} message ListTunedModelsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListTunedModelsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                                object.filter = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            if (message.filter != null && message.hasOwnProperty("filter"))
                                object.filter = message.filter;
                            return object;
                        };
    
                        /**
                         * Converts this ListTunedModelsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListTunedModelsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListTunedModelsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListTunedModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListTunedModelsRequest";
                        };
    
                        return ListTunedModelsRequest;
                    })();
    
                    v1alpha.ListTunedModelsResponse = (function() {
    
                        /**
                         * Properties of a ListTunedModelsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListTunedModelsResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ITunedModel>|null} [tunedModels] ListTunedModelsResponse tunedModels
                         * @property {string|null} [nextPageToken] ListTunedModelsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListTunedModelsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListTunedModelsResponse.
                         * @implements IListTunedModelsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsResponse=} [properties] Properties to set
                         */
                        function ListTunedModelsResponse(properties) {
                            this.tunedModels = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListTunedModelsResponse tunedModels.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ITunedModel>} tunedModels
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @instance
                         */
                        ListTunedModelsResponse.prototype.tunedModels = $util.emptyArray;
    
                        /**
                         * ListTunedModelsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @instance
                         */
                        ListTunedModelsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListTunedModelsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} ListTunedModelsResponse instance
                         */
                        ListTunedModelsResponse.create = function create(properties) {
                            return new ListTunedModelsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsResponse} message ListTunedModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModels != null && message.tunedModels.length)
                                for (var i = 0; i < message.tunedModels.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.TunedModel.encode(message.tunedModels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsResponse} message ListTunedModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListTunedModelsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} ListTunedModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListTunedModelsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.tunedModels && message.tunedModels.length))
                                            message.tunedModels = [];
                                        message.tunedModels.push($root.google.ai.generativelanguage.v1alpha.TunedModel.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListTunedModelsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} ListTunedModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListTunedModelsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListTunedModelsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModels != null && message.hasOwnProperty("tunedModels")) {
                                if (!Array.isArray(message.tunedModels))
                                    return "tunedModels: array expected";
                                for (var i = 0; i < message.tunedModels.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.TunedModel.verify(message.tunedModels[i]);
                                    if (error)
                                        return "tunedModels." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListTunedModelsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} ListTunedModelsResponse
                         */
                        ListTunedModelsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListTunedModelsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListTunedModelsResponse();
                            if (object.tunedModels) {
                                if (!Array.isArray(object.tunedModels))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.ListTunedModelsResponse.tunedModels: array expected");
                                message.tunedModels = [];
                                for (var i = 0; i < object.tunedModels.length; ++i) {
                                    if (typeof object.tunedModels[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.ListTunedModelsResponse.tunedModels: object expected");
                                    message.tunedModels[i] = $root.google.ai.generativelanguage.v1alpha.TunedModel.fromObject(object.tunedModels[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListTunedModelsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} message ListTunedModelsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListTunedModelsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.tunedModels = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.tunedModels && message.tunedModels.length) {
                                object.tunedModels = [];
                                for (var j = 0; j < message.tunedModels.length; ++j)
                                    object.tunedModels[j] = $root.google.ai.generativelanguage.v1alpha.TunedModel.toObject(message.tunedModels[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListTunedModelsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListTunedModelsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListTunedModelsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListTunedModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListTunedModelsResponse";
                        };
    
                        return ListTunedModelsResponse;
                    })();
    
                    v1alpha.CreateTunedModelRequest = (function() {
    
                        /**
                         * Properties of a CreateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICreateTunedModelRequest
                         * @property {string|null} [tunedModelId] CreateTunedModelRequest tunedModelId
                         * @property {google.ai.generativelanguage.v1alpha.ITunedModel|null} [tunedModel] CreateTunedModelRequest tunedModel
                         */
    
                        /**
                         * Constructs a new CreateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CreateTunedModelRequest.
                         * @implements ICreateTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest=} [properties] Properties to set
                         */
                        function CreateTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateTunedModelRequest tunedModelId.
                         * @member {string|null|undefined} tunedModelId
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @instance
                         */
                        CreateTunedModelRequest.prototype.tunedModelId = null;
    
                        /**
                         * CreateTunedModelRequest tunedModel.
                         * @member {google.ai.generativelanguage.v1alpha.ITunedModel|null|undefined} tunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @instance
                         */
                        CreateTunedModelRequest.prototype.tunedModel = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CreateTunedModelRequest _tunedModelId.
                         * @member {"tunedModelId"|undefined} _tunedModelId
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @instance
                         */
                        Object.defineProperty(CreateTunedModelRequest.prototype, "_tunedModelId", {
                            get: $util.oneOfGetter($oneOfFields = ["tunedModelId"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CreateTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelRequest} CreateTunedModelRequest instance
                         */
                        CreateTunedModelRequest.create = function create(properties) {
                            return new CreateTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest} message CreateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModelId != null && Object.hasOwnProperty.call(message, "tunedModelId"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModelId);
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                $root.google.ai.generativelanguage.v1alpha.TunedModel.encode(message.tunedModel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest} message CreateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelRequest} CreateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tunedModelId = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelRequest} CreateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.tunedModelId != null && message.hasOwnProperty("tunedModelId")) {
                                properties._tunedModelId = 1;
                                if (!$util.isString(message.tunedModelId))
                                    return "tunedModelId: string expected";
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.TunedModel.verify(message.tunedModel);
                                if (error)
                                    return "tunedModel." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelRequest} CreateTunedModelRequest
                         */
                        CreateTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest();
                            if (object.tunedModelId != null)
                                message.tunedModelId = String(object.tunedModelId);
                            if (object.tunedModel != null) {
                                if (typeof object.tunedModel !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CreateTunedModelRequest.tunedModel: object expected");
                                message.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.fromObject(object.tunedModel);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CreateTunedModelRequest} message CreateTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.tunedModel = null;
                            if (message.tunedModelId != null && message.hasOwnProperty("tunedModelId")) {
                                object.tunedModelId = message.tunedModelId;
                                if (options.oneofs)
                                    object._tunedModelId = "tunedModelId";
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.toObject(message.tunedModel, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateTunedModelRequest";
                        };
    
                        return CreateTunedModelRequest;
                    })();
    
                    v1alpha.CreateTunedModelMetadata = (function() {
    
                        /**
                         * Properties of a CreateTunedModelMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICreateTunedModelMetadata
                         * @property {string|null} [tunedModel] CreateTunedModelMetadata tunedModel
                         * @property {number|null} [totalSteps] CreateTunedModelMetadata totalSteps
                         * @property {number|null} [completedSteps] CreateTunedModelMetadata completedSteps
                         * @property {number|null} [completedPercent] CreateTunedModelMetadata completedPercent
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ITuningSnapshot>|null} [snapshots] CreateTunedModelMetadata snapshots
                         */
    
                        /**
                         * Constructs a new CreateTunedModelMetadata.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CreateTunedModelMetadata.
                         * @implements ICreateTunedModelMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata=} [properties] Properties to set
                         */
                        function CreateTunedModelMetadata(properties) {
                            this.snapshots = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateTunedModelMetadata tunedModel.
                         * @member {string} tunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.tunedModel = "";
    
                        /**
                         * CreateTunedModelMetadata totalSteps.
                         * @member {number} totalSteps
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.totalSteps = 0;
    
                        /**
                         * CreateTunedModelMetadata completedSteps.
                         * @member {number} completedSteps
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.completedSteps = 0;
    
                        /**
                         * CreateTunedModelMetadata completedPercent.
                         * @member {number} completedPercent
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.completedPercent = 0;
    
                        /**
                         * CreateTunedModelMetadata snapshots.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ITuningSnapshot>} snapshots
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.snapshots = $util.emptyArray;
    
                        /**
                         * Creates a new CreateTunedModelMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata} CreateTunedModelMetadata instance
                         */
                        CreateTunedModelMetadata.create = function create(properties) {
                            return new CreateTunedModelMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata} message CreateTunedModelMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.totalSteps != null && Object.hasOwnProperty.call(message, "totalSteps"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalSteps);
                            if (message.completedSteps != null && Object.hasOwnProperty.call(message, "completedSteps"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.completedSteps);
                            if (message.completedPercent != null && Object.hasOwnProperty.call(message, "completedPercent"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.completedPercent);
                            if (message.snapshots != null && message.snapshots.length)
                                for (var i = 0; i < message.snapshots.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.encode(message.snapshots[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                writer.uint32(/* id 5, wireType 2 =*/42).string(message.tunedModel);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata} message CreateTunedModelMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateTunedModelMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata} CreateTunedModelMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 5: {
                                        message.tunedModel = reader.string();
                                        break;
                                    }
                                case 1: {
                                        message.totalSteps = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.completedSteps = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.completedPercent = reader.float();
                                        break;
                                    }
                                case 4: {
                                        if (!(message.snapshots && message.snapshots.length))
                                            message.snapshots = [];
                                        message.snapshots.push($root.google.ai.generativelanguage.v1alpha.TuningSnapshot.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateTunedModelMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata} CreateTunedModelMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateTunedModelMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateTunedModelMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                if (!$util.isString(message.tunedModel))
                                    return "tunedModel: string expected";
                            if (message.totalSteps != null && message.hasOwnProperty("totalSteps"))
                                if (!$util.isInteger(message.totalSteps))
                                    return "totalSteps: integer expected";
                            if (message.completedSteps != null && message.hasOwnProperty("completedSteps"))
                                if (!$util.isInteger(message.completedSteps))
                                    return "completedSteps: integer expected";
                            if (message.completedPercent != null && message.hasOwnProperty("completedPercent"))
                                if (typeof message.completedPercent !== "number")
                                    return "completedPercent: number expected";
                            if (message.snapshots != null && message.hasOwnProperty("snapshots")) {
                                if (!Array.isArray(message.snapshots))
                                    return "snapshots: array expected";
                                for (var i = 0; i < message.snapshots.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.verify(message.snapshots[i]);
                                    if (error)
                                        return "snapshots." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateTunedModelMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata} CreateTunedModelMetadata
                         */
                        CreateTunedModelMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata();
                            if (object.tunedModel != null)
                                message.tunedModel = String(object.tunedModel);
                            if (object.totalSteps != null)
                                message.totalSteps = object.totalSteps | 0;
                            if (object.completedSteps != null)
                                message.completedSteps = object.completedSteps | 0;
                            if (object.completedPercent != null)
                                message.completedPercent = Number(object.completedPercent);
                            if (object.snapshots) {
                                if (!Array.isArray(object.snapshots))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata.snapshots: array expected");
                                message.snapshots = [];
                                for (var i = 0; i < object.snapshots.length; ++i) {
                                    if (typeof object.snapshots[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata.snapshots: object expected");
                                    message.snapshots[i] = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.fromObject(object.snapshots[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateTunedModelMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata} message CreateTunedModelMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateTunedModelMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.snapshots = [];
                            if (options.defaults) {
                                object.totalSteps = 0;
                                object.completedSteps = 0;
                                object.completedPercent = 0;
                                object.tunedModel = "";
                            }
                            if (message.totalSteps != null && message.hasOwnProperty("totalSteps"))
                                object.totalSteps = message.totalSteps;
                            if (message.completedSteps != null && message.hasOwnProperty("completedSteps"))
                                object.completedSteps = message.completedSteps;
                            if (message.completedPercent != null && message.hasOwnProperty("completedPercent"))
                                object.completedPercent = options.json && !isFinite(message.completedPercent) ? String(message.completedPercent) : message.completedPercent;
                            if (message.snapshots && message.snapshots.length) {
                                object.snapshots = [];
                                for (var j = 0; j < message.snapshots.length; ++j)
                                    object.snapshots[j] = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.toObject(message.snapshots[j], options);
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = message.tunedModel;
                            return object;
                        };
    
                        /**
                         * Converts this CreateTunedModelMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateTunedModelMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateTunedModelMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateTunedModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata";
                        };
    
                        return CreateTunedModelMetadata;
                    })();
    
                    v1alpha.UpdateTunedModelRequest = (function() {
    
                        /**
                         * Properties of an UpdateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IUpdateTunedModelRequest
                         * @property {google.ai.generativelanguage.v1alpha.ITunedModel|null} [tunedModel] UpdateTunedModelRequest tunedModel
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTunedModelRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an UpdateTunedModelRequest.
                         * @implements IUpdateTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest=} [properties] Properties to set
                         */
                        function UpdateTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdateTunedModelRequest tunedModel.
                         * @member {google.ai.generativelanguage.v1alpha.ITunedModel|null|undefined} tunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @instance
                         */
                        UpdateTunedModelRequest.prototype.tunedModel = null;
    
                        /**
                         * UpdateTunedModelRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @instance
                         */
                        UpdateTunedModelRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdateTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest} UpdateTunedModelRequest instance
                         */
                        UpdateTunedModelRequest.create = function create(properties) {
                            return new UpdateTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest} message UpdateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                $root.google.ai.generativelanguage.v1alpha.TunedModel.encode(message.tunedModel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest} message UpdateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdateTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest} UpdateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdateTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest} UpdateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdateTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdateTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.TunedModel.verify(message.tunedModel);
                                if (error)
                                    return "tunedModel." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdateTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest} UpdateTunedModelRequest
                         */
                        UpdateTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest();
                            if (object.tunedModel != null) {
                                if (typeof object.tunedModel !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest.tunedModel: object expected");
                                message.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.fromObject(object.tunedModel);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdateTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest} message UpdateTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdateTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.tunedModel = null;
                                object.updateMask = null;
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.toObject(message.tunedModel, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdateTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdateTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdateTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdateTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest";
                        };
    
                        return UpdateTunedModelRequest;
                    })();
    
                    v1alpha.DeleteTunedModelRequest = (function() {
    
                        /**
                         * Properties of a DeleteTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IDeleteTunedModelRequest
                         * @property {string|null} [name] DeleteTunedModelRequest name
                         */
    
                        /**
                         * Constructs a new DeleteTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a DeleteTunedModelRequest.
                         * @implements IDeleteTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest=} [properties] Properties to set
                         */
                        function DeleteTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteTunedModelRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest
                         * @instance
                         */
                        DeleteTunedModelRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeleteTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest} DeleteTunedModelRequest instance
                         */
                        DeleteTunedModelRequest.create = function create(properties) {
                            return new DeleteTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest} message DeleteTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest} message DeleteTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest} DeleteTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest} DeleteTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest} DeleteTunedModelRequest
                         */
                        DeleteTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest} message DeleteTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest";
                        };
    
                        return DeleteTunedModelRequest;
                    })();
    
                    v1alpha.TunedModel = (function() {
    
                        /**
                         * Properties of a TunedModel.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITunedModel
                         * @property {google.ai.generativelanguage.v1alpha.ITunedModelSource|null} [tunedModelSource] TunedModel tunedModelSource
                         * @property {string|null} [baseModel] TunedModel baseModel
                         * @property {string|null} [name] TunedModel name
                         * @property {string|null} [displayName] TunedModel displayName
                         * @property {string|null} [description] TunedModel description
                         * @property {number|null} [temperature] TunedModel temperature
                         * @property {number|null} [topP] TunedModel topP
                         * @property {number|null} [topK] TunedModel topK
                         * @property {google.ai.generativelanguage.v1alpha.TunedModel.State|null} [state] TunedModel state
                         * @property {google.protobuf.ITimestamp|null} [createTime] TunedModel createTime
                         * @property {google.protobuf.ITimestamp|null} [updateTime] TunedModel updateTime
                         * @property {google.ai.generativelanguage.v1alpha.ITuningTask|null} [tuningTask] TunedModel tuningTask
                         * @property {Array.<number|Long>|null} [readerProjectNumbers] TunedModel readerProjectNumbers
                         */
    
                        /**
                         * Constructs a new TunedModel.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TunedModel.
                         * @implements ITunedModel
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITunedModel=} [properties] Properties to set
                         */
                        function TunedModel(properties) {
                            this.readerProjectNumbers = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TunedModel tunedModelSource.
                         * @member {google.ai.generativelanguage.v1alpha.ITunedModelSource|null|undefined} tunedModelSource
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.tunedModelSource = null;
    
                        /**
                         * TunedModel baseModel.
                         * @member {string|null|undefined} baseModel
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.baseModel = null;
    
                        /**
                         * TunedModel name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.name = "";
    
                        /**
                         * TunedModel displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.displayName = "";
    
                        /**
                         * TunedModel description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.description = "";
    
                        /**
                         * TunedModel temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.temperature = null;
    
                        /**
                         * TunedModel topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.topP = null;
    
                        /**
                         * TunedModel topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.topK = null;
    
                        /**
                         * TunedModel state.
                         * @member {google.ai.generativelanguage.v1alpha.TunedModel.State} state
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.state = 0;
    
                        /**
                         * TunedModel createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.createTime = null;
    
                        /**
                         * TunedModel updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.updateTime = null;
    
                        /**
                         * TunedModel tuningTask.
                         * @member {google.ai.generativelanguage.v1alpha.ITuningTask|null|undefined} tuningTask
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.tuningTask = null;
    
                        /**
                         * TunedModel readerProjectNumbers.
                         * @member {Array.<number|Long>} readerProjectNumbers
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.readerProjectNumbers = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TunedModel sourceModel.
                         * @member {"tunedModelSource"|"baseModel"|undefined} sourceModel
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "sourceModel", {
                            get: $util.oneOfGetter($oneOfFields = ["tunedModelSource", "baseModel"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * TunedModel _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * TunedModel _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * TunedModel _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TunedModel instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITunedModel=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TunedModel} TunedModel instance
                         */
                        TunedModel.create = function create(properties) {
                            return new TunedModel(properties);
                        };
    
                        /**
                         * Encodes the specified TunedModel message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModel.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITunedModel} message TunedModel message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModel.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.tunedModelSource != null && Object.hasOwnProperty.call(message, "tunedModelSource"))
                                $root.google.ai.generativelanguage.v1alpha.TunedModelSource.encode(message.tunedModelSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.baseModel);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 6, wireType 2 =*/50).string(message.description);
                            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state);
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                            if (message.tuningTask != null && Object.hasOwnProperty.call(message, "tuningTask"))
                                $root.google.ai.generativelanguage.v1alpha.TuningTask.encode(message.tuningTask, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 11, wireType 5 =*/93).float(message.temperature);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 12, wireType 5 =*/101).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 13, wireType 0 =*/104).int32(message.topK);
                            if (message.readerProjectNumbers != null && message.readerProjectNumbers.length) {
                                writer.uint32(/* id 14, wireType 2 =*/114).fork();
                                for (var i = 0; i < message.readerProjectNumbers.length; ++i)
                                    writer.int64(message.readerProjectNumbers[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TunedModel message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModel.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITunedModel} message TunedModel message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModel.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TunedModel message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TunedModel} TunedModel
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModel.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TunedModel();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.tunedModelSource = $root.google.ai.generativelanguage.v1alpha.TunedModelSource.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.baseModel = reader.string();
                                        break;
                                    }
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 5: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 11: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 12: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 13: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                case 7: {
                                        message.state = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 9: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 10: {
                                        message.tuningTask = $root.google.ai.generativelanguage.v1alpha.TuningTask.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 14: {
                                        if (!(message.readerProjectNumbers && message.readerProjectNumbers.length))
                                            message.readerProjectNumbers = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.readerProjectNumbers.push(reader.int64());
                                        } else
                                            message.readerProjectNumbers.push(reader.int64());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TunedModel message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TunedModel} TunedModel
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModel.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TunedModel message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TunedModel.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.tunedModelSource != null && message.hasOwnProperty("tunedModelSource")) {
                                properties.sourceModel = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.TunedModelSource.verify(message.tunedModelSource);
                                    if (error)
                                        return "tunedModelSource." + error;
                                }
                            }
                            if (message.baseModel != null && message.hasOwnProperty("baseModel")) {
                                if (properties.sourceModel === 1)
                                    return "sourceModel: multiple values";
                                properties.sourceModel = 1;
                                if (!$util.isString(message.baseModel))
                                    return "baseModel: string expected";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            if (message.state != null && message.hasOwnProperty("state"))
                                switch (message.state) {
                                default:
                                    return "state: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            if (message.tuningTask != null && message.hasOwnProperty("tuningTask")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.TuningTask.verify(message.tuningTask);
                                if (error)
                                    return "tuningTask." + error;
                            }
                            if (message.readerProjectNumbers != null && message.hasOwnProperty("readerProjectNumbers")) {
                                if (!Array.isArray(message.readerProjectNumbers))
                                    return "readerProjectNumbers: array expected";
                                for (var i = 0; i < message.readerProjectNumbers.length; ++i)
                                    if (!$util.isInteger(message.readerProjectNumbers[i]) && !(message.readerProjectNumbers[i] && $util.isInteger(message.readerProjectNumbers[i].low) && $util.isInteger(message.readerProjectNumbers[i].high)))
                                        return "readerProjectNumbers: integer|Long[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TunedModel message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TunedModel} TunedModel
                         */
                        TunedModel.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TunedModel)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TunedModel();
                            if (object.tunedModelSource != null) {
                                if (typeof object.tunedModelSource !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TunedModel.tunedModelSource: object expected");
                                message.tunedModelSource = $root.google.ai.generativelanguage.v1alpha.TunedModelSource.fromObject(object.tunedModelSource);
                            }
                            if (object.baseModel != null)
                                message.baseModel = String(object.baseModel);
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            switch (object.state) {
                            default:
                                if (typeof object.state === "number") {
                                    message.state = object.state;
                                    break;
                                }
                                break;
                            case "STATE_UNSPECIFIED":
                            case 0:
                                message.state = 0;
                                break;
                            case "CREATING":
                            case 1:
                                message.state = 1;
                                break;
                            case "ACTIVE":
                            case 2:
                                message.state = 2;
                                break;
                            case "FAILED":
                            case 3:
                                message.state = 3;
                                break;
                            }
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TunedModel.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TunedModel.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            if (object.tuningTask != null) {
                                if (typeof object.tuningTask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TunedModel.tuningTask: object expected");
                                message.tuningTask = $root.google.ai.generativelanguage.v1alpha.TuningTask.fromObject(object.tuningTask);
                            }
                            if (object.readerProjectNumbers) {
                                if (!Array.isArray(object.readerProjectNumbers))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TunedModel.readerProjectNumbers: array expected");
                                message.readerProjectNumbers = [];
                                for (var i = 0; i < object.readerProjectNumbers.length; ++i)
                                    if ($util.Long)
                                        (message.readerProjectNumbers[i] = $util.Long.fromValue(object.readerProjectNumbers[i])).unsigned = false;
                                    else if (typeof object.readerProjectNumbers[i] === "string")
                                        message.readerProjectNumbers[i] = parseInt(object.readerProjectNumbers[i], 10);
                                    else if (typeof object.readerProjectNumbers[i] === "number")
                                        message.readerProjectNumbers[i] = object.readerProjectNumbers[i];
                                    else if (typeof object.readerProjectNumbers[i] === "object")
                                        message.readerProjectNumbers[i] = new $util.LongBits(object.readerProjectNumbers[i].low >>> 0, object.readerProjectNumbers[i].high >>> 0).toNumber();
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TunedModel message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TunedModel} message TunedModel
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TunedModel.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.readerProjectNumbers = [];
                            if (options.defaults) {
                                object.name = "";
                                object.displayName = "";
                                object.description = "";
                                object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
                                object.createTime = null;
                                object.updateTime = null;
                                object.tuningTask = null;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.tunedModelSource != null && message.hasOwnProperty("tunedModelSource")) {
                                object.tunedModelSource = $root.google.ai.generativelanguage.v1alpha.TunedModelSource.toObject(message.tunedModelSource, options);
                                if (options.oneofs)
                                    object.sourceModel = "tunedModelSource";
                            }
                            if (message.baseModel != null && message.hasOwnProperty("baseModel")) {
                                object.baseModel = message.baseModel;
                                if (options.oneofs)
                                    object.sourceModel = "baseModel";
                            }
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.state != null && message.hasOwnProperty("state"))
                                object.state = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.TunedModel.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1alpha.TunedModel.State[message.state] : message.state;
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            if (message.tuningTask != null && message.hasOwnProperty("tuningTask"))
                                object.tuningTask = $root.google.ai.generativelanguage.v1alpha.TuningTask.toObject(message.tuningTask, options);
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.readerProjectNumbers && message.readerProjectNumbers.length) {
                                object.readerProjectNumbers = [];
                                for (var j = 0; j < message.readerProjectNumbers.length; ++j)
                                    if (typeof message.readerProjectNumbers[j] === "number")
                                        object.readerProjectNumbers[j] = options.longs === String ? String(message.readerProjectNumbers[j]) : message.readerProjectNumbers[j];
                                    else
                                        object.readerProjectNumbers[j] = options.longs === String ? $util.Long.prototype.toString.call(message.readerProjectNumbers[j]) : options.longs === Number ? new $util.LongBits(message.readerProjectNumbers[j].low >>> 0, message.readerProjectNumbers[j].high >>> 0).toNumber() : message.readerProjectNumbers[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TunedModel to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TunedModel.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TunedModel
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModel
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TunedModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TunedModel";
                        };
    
                        /**
                         * State enum.
                         * @name google.ai.generativelanguage.v1alpha.TunedModel.State
                         * @enum {number}
                         * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value
                         * @property {number} CREATING=1 CREATING value
                         * @property {number} ACTIVE=2 ACTIVE value
                         * @property {number} FAILED=3 FAILED value
                         */
                        TunedModel.State = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "STATE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "CREATING"] = 1;
                            values[valuesById[2] = "ACTIVE"] = 2;
                            values[valuesById[3] = "FAILED"] = 3;
                            return values;
                        })();
    
                        return TunedModel;
                    })();
    
                    v1alpha.TunedModelSource = (function() {
    
                        /**
                         * Properties of a TunedModelSource.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITunedModelSource
                         * @property {string|null} [tunedModel] TunedModelSource tunedModel
                         * @property {string|null} [baseModel] TunedModelSource baseModel
                         */
    
                        /**
                         * Constructs a new TunedModelSource.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TunedModelSource.
                         * @implements ITunedModelSource
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITunedModelSource=} [properties] Properties to set
                         */
                        function TunedModelSource(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TunedModelSource tunedModel.
                         * @member {string} tunedModel
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @instance
                         */
                        TunedModelSource.prototype.tunedModel = "";
    
                        /**
                         * TunedModelSource baseModel.
                         * @member {string} baseModel
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @instance
                         */
                        TunedModelSource.prototype.baseModel = "";
    
                        /**
                         * Creates a new TunedModelSource instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITunedModelSource=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TunedModelSource} TunedModelSource instance
                         */
                        TunedModelSource.create = function create(properties) {
                            return new TunedModelSource(properties);
                        };
    
                        /**
                         * Encodes the specified TunedModelSource message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModelSource.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITunedModelSource} message TunedModelSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModelSource.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModel);
                            if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModel);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TunedModelSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModelSource.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITunedModelSource} message TunedModelSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModelSource.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TunedModelSource message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TunedModelSource} TunedModelSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModelSource.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TunedModelSource();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tunedModel = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.baseModel = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TunedModelSource message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TunedModelSource} TunedModelSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModelSource.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TunedModelSource message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TunedModelSource.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                if (!$util.isString(message.tunedModel))
                                    return "tunedModel: string expected";
                            if (message.baseModel != null && message.hasOwnProperty("baseModel"))
                                if (!$util.isString(message.baseModel))
                                    return "baseModel: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TunedModelSource message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TunedModelSource} TunedModelSource
                         */
                        TunedModelSource.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TunedModelSource)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TunedModelSource();
                            if (object.tunedModel != null)
                                message.tunedModel = String(object.tunedModel);
                            if (object.baseModel != null)
                                message.baseModel = String(object.baseModel);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TunedModelSource message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TunedModelSource} message TunedModelSource
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TunedModelSource.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.tunedModel = "";
                                object.baseModel = "";
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = message.tunedModel;
                            if (message.baseModel != null && message.hasOwnProperty("baseModel"))
                                object.baseModel = message.baseModel;
                            return object;
                        };
    
                        /**
                         * Converts this TunedModelSource to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TunedModelSource.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TunedModelSource
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TunedModelSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TunedModelSource";
                        };
    
                        return TunedModelSource;
                    })();
    
                    v1alpha.TuningTask = (function() {
    
                        /**
                         * Properties of a TuningTask.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITuningTask
                         * @property {google.protobuf.ITimestamp|null} [startTime] TuningTask startTime
                         * @property {google.protobuf.ITimestamp|null} [completeTime] TuningTask completeTime
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ITuningSnapshot>|null} [snapshots] TuningTask snapshots
                         * @property {google.ai.generativelanguage.v1alpha.IDataset|null} [trainingData] TuningTask trainingData
                         * @property {google.ai.generativelanguage.v1alpha.IHyperparameters|null} [hyperparameters] TuningTask hyperparameters
                         */
    
                        /**
                         * Constructs a new TuningTask.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TuningTask.
                         * @implements ITuningTask
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITuningTask=} [properties] Properties to set
                         */
                        function TuningTask(properties) {
                            this.snapshots = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningTask startTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} startTime
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.startTime = null;
    
                        /**
                         * TuningTask completeTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} completeTime
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.completeTime = null;
    
                        /**
                         * TuningTask snapshots.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ITuningSnapshot>} snapshots
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.snapshots = $util.emptyArray;
    
                        /**
                         * TuningTask trainingData.
                         * @member {google.ai.generativelanguage.v1alpha.IDataset|null|undefined} trainingData
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.trainingData = null;
    
                        /**
                         * TuningTask hyperparameters.
                         * @member {google.ai.generativelanguage.v1alpha.IHyperparameters|null|undefined} hyperparameters
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.hyperparameters = null;
    
                        /**
                         * Creates a new TuningTask instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningTask=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TuningTask} TuningTask instance
                         */
                        TuningTask.create = function create(properties) {
                            return new TuningTask(properties);
                        };
    
                        /**
                         * Encodes the specified TuningTask message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningTask.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningTask} message TuningTask message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningTask.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
                                $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime"))
                                $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.snapshots != null && message.snapshots.length)
                                for (var i = 0; i < message.snapshots.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.encode(message.snapshots[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.trainingData != null && Object.hasOwnProperty.call(message, "trainingData"))
                                $root.google.ai.generativelanguage.v1alpha.Dataset.encode(message.trainingData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.hyperparameters != null && Object.hasOwnProperty.call(message, "hyperparameters"))
                                $root.google.ai.generativelanguage.v1alpha.Hyperparameters.encode(message.hyperparameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningTask message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningTask.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningTask} message TuningTask message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningTask.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningTask message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TuningTask} TuningTask
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningTask.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TuningTask();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.snapshots && message.snapshots.length))
                                            message.snapshots = [];
                                        message.snapshots.push($root.google.ai.generativelanguage.v1alpha.TuningSnapshot.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.trainingData = $root.google.ai.generativelanguage.v1alpha.Dataset.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        message.hyperparameters = $root.google.ai.generativelanguage.v1alpha.Hyperparameters.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningTask message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TuningTask} TuningTask
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningTask.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningTask message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningTask.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.startTime != null && message.hasOwnProperty("startTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.startTime);
                                if (error)
                                    return "startTime." + error;
                            }
                            if (message.completeTime != null && message.hasOwnProperty("completeTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.completeTime);
                                if (error)
                                    return "completeTime." + error;
                            }
                            if (message.snapshots != null && message.hasOwnProperty("snapshots")) {
                                if (!Array.isArray(message.snapshots))
                                    return "snapshots: array expected";
                                for (var i = 0; i < message.snapshots.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.verify(message.snapshots[i]);
                                    if (error)
                                        return "snapshots." + error;
                                }
                            }
                            if (message.trainingData != null && message.hasOwnProperty("trainingData")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Dataset.verify(message.trainingData);
                                if (error)
                                    return "trainingData." + error;
                            }
                            if (message.hyperparameters != null && message.hasOwnProperty("hyperparameters")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Hyperparameters.verify(message.hyperparameters);
                                if (error)
                                    return "hyperparameters." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TuningTask message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TuningTask} TuningTask
                         */
                        TuningTask.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningTask)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TuningTask();
                            if (object.startTime != null) {
                                if (typeof object.startTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.startTime: object expected");
                                message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime);
                            }
                            if (object.completeTime != null) {
                                if (typeof object.completeTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.completeTime: object expected");
                                message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime);
                            }
                            if (object.snapshots) {
                                if (!Array.isArray(object.snapshots))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.snapshots: array expected");
                                message.snapshots = [];
                                for (var i = 0; i < object.snapshots.length; ++i) {
                                    if (typeof object.snapshots[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.snapshots: object expected");
                                    message.snapshots[i] = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.fromObject(object.snapshots[i]);
                                }
                            }
                            if (object.trainingData != null) {
                                if (typeof object.trainingData !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.trainingData: object expected");
                                message.trainingData = $root.google.ai.generativelanguage.v1alpha.Dataset.fromObject(object.trainingData);
                            }
                            if (object.hyperparameters != null) {
                                if (typeof object.hyperparameters !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.hyperparameters: object expected");
                                message.hyperparameters = $root.google.ai.generativelanguage.v1alpha.Hyperparameters.fromObject(object.hyperparameters);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningTask message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TuningTask} message TuningTask
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningTask.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.snapshots = [];
                            if (options.defaults) {
                                object.startTime = null;
                                object.completeTime = null;
                                object.trainingData = null;
                                object.hyperparameters = null;
                            }
                            if (message.startTime != null && message.hasOwnProperty("startTime"))
                                object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options);
                            if (message.completeTime != null && message.hasOwnProperty("completeTime"))
                                object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options);
                            if (message.snapshots && message.snapshots.length) {
                                object.snapshots = [];
                                for (var j = 0; j < message.snapshots.length; ++j)
                                    object.snapshots[j] = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.toObject(message.snapshots[j], options);
                            }
                            if (message.trainingData != null && message.hasOwnProperty("trainingData"))
                                object.trainingData = $root.google.ai.generativelanguage.v1alpha.Dataset.toObject(message.trainingData, options);
                            if (message.hyperparameters != null && message.hasOwnProperty("hyperparameters"))
                                object.hyperparameters = $root.google.ai.generativelanguage.v1alpha.Hyperparameters.toObject(message.hyperparameters, options);
                            return object;
                        };
    
                        /**
                         * Converts this TuningTask to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningTask.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningTask
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TuningTask
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningTask";
                        };
    
                        return TuningTask;
                    })();
    
                    v1alpha.Hyperparameters = (function() {
    
                        /**
                         * Properties of a Hyperparameters.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IHyperparameters
                         * @property {number|null} [learningRate] Hyperparameters learningRate
                         * @property {number|null} [learningRateMultiplier] Hyperparameters learningRateMultiplier
                         * @property {number|null} [epochCount] Hyperparameters epochCount
                         * @property {number|null} [batchSize] Hyperparameters batchSize
                         */
    
                        /**
                         * Constructs a new Hyperparameters.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Hyperparameters.
                         * @implements IHyperparameters
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IHyperparameters=} [properties] Properties to set
                         */
                        function Hyperparameters(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Hyperparameters learningRate.
                         * @member {number|null|undefined} learningRate
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @instance
                         */
                        Hyperparameters.prototype.learningRate = null;
    
                        /**
                         * Hyperparameters learningRateMultiplier.
                         * @member {number|null|undefined} learningRateMultiplier
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @instance
                         */
                        Hyperparameters.prototype.learningRateMultiplier = null;
    
                        /**
                         * Hyperparameters epochCount.
                         * @member {number|null|undefined} epochCount
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @instance
                         */
                        Hyperparameters.prototype.epochCount = null;
    
                        /**
                         * Hyperparameters batchSize.
                         * @member {number|null|undefined} batchSize
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @instance
                         */
                        Hyperparameters.prototype.batchSize = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Hyperparameters learningRateOption.
                         * @member {"learningRate"|"learningRateMultiplier"|undefined} learningRateOption
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @instance
                         */
                        Object.defineProperty(Hyperparameters.prototype, "learningRateOption", {
                            get: $util.oneOfGetter($oneOfFields = ["learningRate", "learningRateMultiplier"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Hyperparameters _epochCount.
                         * @member {"epochCount"|undefined} _epochCount
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @instance
                         */
                        Object.defineProperty(Hyperparameters.prototype, "_epochCount", {
                            get: $util.oneOfGetter($oneOfFields = ["epochCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Hyperparameters _batchSize.
                         * @member {"batchSize"|undefined} _batchSize
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @instance
                         */
                        Object.defineProperty(Hyperparameters.prototype, "_batchSize", {
                            get: $util.oneOfGetter($oneOfFields = ["batchSize"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Hyperparameters instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IHyperparameters=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Hyperparameters} Hyperparameters instance
                         */
                        Hyperparameters.create = function create(properties) {
                            return new Hyperparameters(properties);
                        };
    
                        /**
                         * Encodes the specified Hyperparameters message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Hyperparameters.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IHyperparameters} message Hyperparameters message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Hyperparameters.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.epochCount != null && Object.hasOwnProperty.call(message, "epochCount"))
                                writer.uint32(/* id 14, wireType 0 =*/112).int32(message.epochCount);
                            if (message.batchSize != null && Object.hasOwnProperty.call(message, "batchSize"))
                                writer.uint32(/* id 15, wireType 0 =*/120).int32(message.batchSize);
                            if (message.learningRate != null && Object.hasOwnProperty.call(message, "learningRate"))
                                writer.uint32(/* id 16, wireType 5 =*/133).float(message.learningRate);
                            if (message.learningRateMultiplier != null && Object.hasOwnProperty.call(message, "learningRateMultiplier"))
                                writer.uint32(/* id 17, wireType 5 =*/141).float(message.learningRateMultiplier);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Hyperparameters message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Hyperparameters.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IHyperparameters} message Hyperparameters message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Hyperparameters.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Hyperparameters message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Hyperparameters} Hyperparameters
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Hyperparameters.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Hyperparameters();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 16: {
                                        message.learningRate = reader.float();
                                        break;
                                    }
                                case 17: {
                                        message.learningRateMultiplier = reader.float();
                                        break;
                                    }
                                case 14: {
                                        message.epochCount = reader.int32();
                                        break;
                                    }
                                case 15: {
                                        message.batchSize = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Hyperparameters message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Hyperparameters} Hyperparameters
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Hyperparameters.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Hyperparameters message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Hyperparameters.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.learningRate != null && message.hasOwnProperty("learningRate")) {
                                properties.learningRateOption = 1;
                                if (typeof message.learningRate !== "number")
                                    return "learningRate: number expected";
                            }
                            if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) {
                                if (properties.learningRateOption === 1)
                                    return "learningRateOption: multiple values";
                                properties.learningRateOption = 1;
                                if (typeof message.learningRateMultiplier !== "number")
                                    return "learningRateMultiplier: number expected";
                            }
                            if (message.epochCount != null && message.hasOwnProperty("epochCount")) {
                                properties._epochCount = 1;
                                if (!$util.isInteger(message.epochCount))
                                    return "epochCount: integer expected";
                            }
                            if (message.batchSize != null && message.hasOwnProperty("batchSize")) {
                                properties._batchSize = 1;
                                if (!$util.isInteger(message.batchSize))
                                    return "batchSize: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Hyperparameters message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Hyperparameters} Hyperparameters
                         */
                        Hyperparameters.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Hyperparameters)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Hyperparameters();
                            if (object.learningRate != null)
                                message.learningRate = Number(object.learningRate);
                            if (object.learningRateMultiplier != null)
                                message.learningRateMultiplier = Number(object.learningRateMultiplier);
                            if (object.epochCount != null)
                                message.epochCount = object.epochCount | 0;
                            if (object.batchSize != null)
                                message.batchSize = object.batchSize | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Hyperparameters message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Hyperparameters} message Hyperparameters
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Hyperparameters.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.epochCount != null && message.hasOwnProperty("epochCount")) {
                                object.epochCount = message.epochCount;
                                if (options.oneofs)
                                    object._epochCount = "epochCount";
                            }
                            if (message.batchSize != null && message.hasOwnProperty("batchSize")) {
                                object.batchSize = message.batchSize;
                                if (options.oneofs)
                                    object._batchSize = "batchSize";
                            }
                            if (message.learningRate != null && message.hasOwnProperty("learningRate")) {
                                object.learningRate = options.json && !isFinite(message.learningRate) ? String(message.learningRate) : message.learningRate;
                                if (options.oneofs)
                                    object.learningRateOption = "learningRate";
                            }
                            if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) {
                                object.learningRateMultiplier = options.json && !isFinite(message.learningRateMultiplier) ? String(message.learningRateMultiplier) : message.learningRateMultiplier;
                                if (options.oneofs)
                                    object.learningRateOption = "learningRateMultiplier";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Hyperparameters to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Hyperparameters.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Hyperparameters
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Hyperparameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Hyperparameters";
                        };
    
                        return Hyperparameters;
                    })();
    
                    v1alpha.Dataset = (function() {
    
                        /**
                         * Properties of a Dataset.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IDataset
                         * @property {google.ai.generativelanguage.v1alpha.ITuningExamples|null} [examples] Dataset examples
                         */
    
                        /**
                         * Constructs a new Dataset.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Dataset.
                         * @implements IDataset
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IDataset=} [properties] Properties to set
                         */
                        function Dataset(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Dataset examples.
                         * @member {google.ai.generativelanguage.v1alpha.ITuningExamples|null|undefined} examples
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @instance
                         */
                        Dataset.prototype.examples = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Dataset dataset.
                         * @member {"examples"|undefined} dataset
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @instance
                         */
                        Object.defineProperty(Dataset.prototype, "dataset", {
                            get: $util.oneOfGetter($oneOfFields = ["examples"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Dataset instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDataset=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Dataset} Dataset instance
                         */
                        Dataset.create = function create(properties) {
                            return new Dataset(properties);
                        };
    
                        /**
                         * Encodes the specified Dataset message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Dataset.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDataset} message Dataset message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Dataset.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.examples != null && Object.hasOwnProperty.call(message, "examples"))
                                $root.google.ai.generativelanguage.v1alpha.TuningExamples.encode(message.examples, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Dataset.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDataset} message Dataset message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Dataset.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Dataset message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Dataset} Dataset
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Dataset.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Dataset();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.examples = $root.google.ai.generativelanguage.v1alpha.TuningExamples.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Dataset message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Dataset} Dataset
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Dataset.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Dataset message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Dataset.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                properties.dataset = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.TuningExamples.verify(message.examples);
                                    if (error)
                                        return "examples." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Dataset message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Dataset} Dataset
                         */
                        Dataset.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Dataset)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Dataset();
                            if (object.examples != null) {
                                if (typeof object.examples !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Dataset.examples: object expected");
                                message.examples = $root.google.ai.generativelanguage.v1alpha.TuningExamples.fromObject(object.examples);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Dataset message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Dataset} message Dataset
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Dataset.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                object.examples = $root.google.ai.generativelanguage.v1alpha.TuningExamples.toObject(message.examples, options);
                                if (options.oneofs)
                                    object.dataset = "examples";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Dataset to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Dataset.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Dataset
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Dataset
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Dataset";
                        };
    
                        return Dataset;
                    })();
    
                    v1alpha.TuningExamples = (function() {
    
                        /**
                         * Properties of a TuningExamples.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITuningExamples
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ITuningExample>|null} [examples] TuningExamples examples
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ITuningMultiturnExample>|null} [multiturnExamples] TuningExamples multiturnExamples
                         */
    
                        /**
                         * Constructs a new TuningExamples.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TuningExamples.
                         * @implements ITuningExamples
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITuningExamples=} [properties] Properties to set
                         */
                        function TuningExamples(properties) {
                            this.examples = [];
                            this.multiturnExamples = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningExamples examples.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ITuningExample>} examples
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @instance
                         */
                        TuningExamples.prototype.examples = $util.emptyArray;
    
                        /**
                         * TuningExamples multiturnExamples.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ITuningMultiturnExample>} multiturnExamples
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @instance
                         */
                        TuningExamples.prototype.multiturnExamples = $util.emptyArray;
    
                        /**
                         * Creates a new TuningExamples instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningExamples=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TuningExamples} TuningExamples instance
                         */
                        TuningExamples.create = function create(properties) {
                            return new TuningExamples(properties);
                        };
    
                        /**
                         * Encodes the specified TuningExamples message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExamples.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningExamples} message TuningExamples message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExamples.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.examples != null && message.examples.length)
                                for (var i = 0; i < message.examples.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.TuningExample.encode(message.examples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.multiturnExamples != null && message.multiturnExamples.length)
                                for (var i = 0; i < message.multiturnExamples.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample.encode(message.multiturnExamples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningExamples message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExamples.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningExamples} message TuningExamples message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExamples.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningExamples message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TuningExamples} TuningExamples
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExamples.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TuningExamples();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.examples && message.examples.length))
                                            message.examples = [];
                                        message.examples.push($root.google.ai.generativelanguage.v1alpha.TuningExample.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        if (!(message.multiturnExamples && message.multiturnExamples.length))
                                            message.multiturnExamples = [];
                                        message.multiturnExamples.push($root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningExamples message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TuningExamples} TuningExamples
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExamples.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningExamples message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningExamples.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                if (!Array.isArray(message.examples))
                                    return "examples: array expected";
                                for (var i = 0; i < message.examples.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.TuningExample.verify(message.examples[i]);
                                    if (error)
                                        return "examples." + error;
                                }
                            }
                            if (message.multiturnExamples != null && message.hasOwnProperty("multiturnExamples")) {
                                if (!Array.isArray(message.multiturnExamples))
                                    return "multiturnExamples: array expected";
                                for (var i = 0; i < message.multiturnExamples.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample.verify(message.multiturnExamples[i]);
                                    if (error)
                                        return "multiturnExamples." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TuningExamples message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TuningExamples} TuningExamples
                         */
                        TuningExamples.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningExamples)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TuningExamples();
                            if (object.examples) {
                                if (!Array.isArray(object.examples))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TuningExamples.examples: array expected");
                                message.examples = [];
                                for (var i = 0; i < object.examples.length; ++i) {
                                    if (typeof object.examples[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.TuningExamples.examples: object expected");
                                    message.examples[i] = $root.google.ai.generativelanguage.v1alpha.TuningExample.fromObject(object.examples[i]);
                                }
                            }
                            if (object.multiturnExamples) {
                                if (!Array.isArray(object.multiturnExamples))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TuningExamples.multiturnExamples: array expected");
                                message.multiturnExamples = [];
                                for (var i = 0; i < object.multiturnExamples.length; ++i) {
                                    if (typeof object.multiturnExamples[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.TuningExamples.multiturnExamples: object expected");
                                    message.multiturnExamples[i] = $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample.fromObject(object.multiturnExamples[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningExamples message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TuningExamples} message TuningExamples
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningExamples.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.examples = [];
                                object.multiturnExamples = [];
                            }
                            if (message.examples && message.examples.length) {
                                object.examples = [];
                                for (var j = 0; j < message.examples.length; ++j)
                                    object.examples[j] = $root.google.ai.generativelanguage.v1alpha.TuningExample.toObject(message.examples[j], options);
                            }
                            if (message.multiturnExamples && message.multiturnExamples.length) {
                                object.multiturnExamples = [];
                                for (var j = 0; j < message.multiturnExamples.length; ++j)
                                    object.multiturnExamples[j] = $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample.toObject(message.multiturnExamples[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TuningExamples to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningExamples.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningExamples
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExamples
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningExamples.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningExamples";
                        };
    
                        return TuningExamples;
                    })();
    
                    v1alpha.TuningPart = (function() {
    
                        /**
                         * Properties of a TuningPart.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITuningPart
                         * @property {string|null} [text] TuningPart text
                         */
    
                        /**
                         * Constructs a new TuningPart.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TuningPart.
                         * @implements ITuningPart
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITuningPart=} [properties] Properties to set
                         */
                        function TuningPart(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningPart text.
                         * @member {string|null|undefined} text
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @instance
                         */
                        TuningPart.prototype.text = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TuningPart data.
                         * @member {"text"|undefined} data
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @instance
                         */
                        Object.defineProperty(TuningPart.prototype, "data", {
                            get: $util.oneOfGetter($oneOfFields = ["text"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TuningPart instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningPart=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TuningPart} TuningPart instance
                         */
                        TuningPart.create = function create(properties) {
                            return new TuningPart(properties);
                        };
    
                        /**
                         * Encodes the specified TuningPart message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningPart.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningPart} message TuningPart message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningPart.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningPart message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningPart.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningPart} message TuningPart message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningPart.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningPart message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TuningPart} TuningPart
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningPart.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TuningPart();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningPart message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TuningPart} TuningPart
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningPart.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningPart message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningPart.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.text != null && message.hasOwnProperty("text")) {
                                properties.data = 1;
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TuningPart message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TuningPart} TuningPart
                         */
                        TuningPart.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningPart)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TuningPart();
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningPart message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TuningPart} message TuningPart
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningPart.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.text != null && message.hasOwnProperty("text")) {
                                object.text = message.text;
                                if (options.oneofs)
                                    object.data = "text";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TuningPart to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningPart.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningPart
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TuningPart
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningPart.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningPart";
                        };
    
                        return TuningPart;
                    })();
    
                    v1alpha.TuningContent = (function() {
    
                        /**
                         * Properties of a TuningContent.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITuningContent
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ITuningPart>|null} [parts] TuningContent parts
                         * @property {string|null} [role] TuningContent role
                         */
    
                        /**
                         * Constructs a new TuningContent.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TuningContent.
                         * @implements ITuningContent
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITuningContent=} [properties] Properties to set
                         */
                        function TuningContent(properties) {
                            this.parts = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningContent parts.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ITuningPart>} parts
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @instance
                         */
                        TuningContent.prototype.parts = $util.emptyArray;
    
                        /**
                         * TuningContent role.
                         * @member {string} role
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @instance
                         */
                        TuningContent.prototype.role = "";
    
                        /**
                         * Creates a new TuningContent instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningContent=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TuningContent} TuningContent instance
                         */
                        TuningContent.create = function create(properties) {
                            return new TuningContent(properties);
                        };
    
                        /**
                         * Encodes the specified TuningContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningContent.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningContent} message TuningContent message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningContent.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parts != null && message.parts.length)
                                for (var i = 0; i < message.parts.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.TuningPart.encode(message.parts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.role != null && Object.hasOwnProperty.call(message, "role"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.role);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningContent.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningContent} message TuningContent message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningContent.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningContent message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TuningContent} TuningContent
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningContent.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TuningContent();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.parts && message.parts.length))
                                            message.parts = [];
                                        message.parts.push($root.google.ai.generativelanguage.v1alpha.TuningPart.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.role = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningContent message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TuningContent} TuningContent
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningContent.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningContent message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningContent.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parts != null && message.hasOwnProperty("parts")) {
                                if (!Array.isArray(message.parts))
                                    return "parts: array expected";
                                for (var i = 0; i < message.parts.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.TuningPart.verify(message.parts[i]);
                                    if (error)
                                        return "parts." + error;
                                }
                            }
                            if (message.role != null && message.hasOwnProperty("role"))
                                if (!$util.isString(message.role))
                                    return "role: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TuningContent message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TuningContent} TuningContent
                         */
                        TuningContent.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningContent)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TuningContent();
                            if (object.parts) {
                                if (!Array.isArray(object.parts))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TuningContent.parts: array expected");
                                message.parts = [];
                                for (var i = 0; i < object.parts.length; ++i) {
                                    if (typeof object.parts[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.TuningContent.parts: object expected");
                                    message.parts[i] = $root.google.ai.generativelanguage.v1alpha.TuningPart.fromObject(object.parts[i]);
                                }
                            }
                            if (object.role != null)
                                message.role = String(object.role);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningContent message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TuningContent} message TuningContent
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningContent.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.parts = [];
                            if (options.defaults)
                                object.role = "";
                            if (message.parts && message.parts.length) {
                                object.parts = [];
                                for (var j = 0; j < message.parts.length; ++j)
                                    object.parts[j] = $root.google.ai.generativelanguage.v1alpha.TuningPart.toObject(message.parts[j], options);
                            }
                            if (message.role != null && message.hasOwnProperty("role"))
                                object.role = message.role;
                            return object;
                        };
    
                        /**
                         * Converts this TuningContent to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningContent.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningContent
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TuningContent
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningContent";
                        };
    
                        return TuningContent;
                    })();
    
                    v1alpha.TuningMultiturnExample = (function() {
    
                        /**
                         * Properties of a TuningMultiturnExample.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITuningMultiturnExample
                         * @property {google.ai.generativelanguage.v1alpha.ITuningContent|null} [systemInstruction] TuningMultiturnExample systemInstruction
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ITuningContent>|null} [contents] TuningMultiturnExample contents
                         */
    
                        /**
                         * Constructs a new TuningMultiturnExample.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TuningMultiturnExample.
                         * @implements ITuningMultiturnExample
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITuningMultiturnExample=} [properties] Properties to set
                         */
                        function TuningMultiturnExample(properties) {
                            this.contents = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningMultiturnExample systemInstruction.
                         * @member {google.ai.generativelanguage.v1alpha.ITuningContent|null|undefined} systemInstruction
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @instance
                         */
                        TuningMultiturnExample.prototype.systemInstruction = null;
    
                        /**
                         * TuningMultiturnExample contents.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ITuningContent>} contents
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @instance
                         */
                        TuningMultiturnExample.prototype.contents = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TuningMultiturnExample _systemInstruction.
                         * @member {"systemInstruction"|undefined} _systemInstruction
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @instance
                         */
                        Object.defineProperty(TuningMultiturnExample.prototype, "_systemInstruction", {
                            get: $util.oneOfGetter($oneOfFields = ["systemInstruction"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TuningMultiturnExample instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningMultiturnExample=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TuningMultiturnExample} TuningMultiturnExample instance
                         */
                        TuningMultiturnExample.create = function create(properties) {
                            return new TuningMultiturnExample(properties);
                        };
    
                        /**
                         * Encodes the specified TuningMultiturnExample message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningMultiturnExample.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningMultiturnExample} message TuningMultiturnExample message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningMultiturnExample.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.contents != null && message.contents.length)
                                for (var i = 0; i < message.contents.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.TuningContent.encode(message.contents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction"))
                                $root.google.ai.generativelanguage.v1alpha.TuningContent.encode(message.systemInstruction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningMultiturnExample message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningMultiturnExample.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningMultiturnExample} message TuningMultiturnExample message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningMultiturnExample.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningMultiturnExample message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TuningMultiturnExample} TuningMultiturnExample
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningMultiturnExample.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 8: {
                                        message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.TuningContent.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 1: {
                                        if (!(message.contents && message.contents.length))
                                            message.contents = [];
                                        message.contents.push($root.google.ai.generativelanguage.v1alpha.TuningContent.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningMultiturnExample message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TuningMultiturnExample} TuningMultiturnExample
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningMultiturnExample.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningMultiturnExample message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningMultiturnExample.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) {
                                properties._systemInstruction = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.TuningContent.verify(message.systemInstruction);
                                    if (error)
                                        return "systemInstruction." + error;
                                }
                            }
                            if (message.contents != null && message.hasOwnProperty("contents")) {
                                if (!Array.isArray(message.contents))
                                    return "contents: array expected";
                                for (var i = 0; i < message.contents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.TuningContent.verify(message.contents[i]);
                                    if (error)
                                        return "contents." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TuningMultiturnExample message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TuningMultiturnExample} TuningMultiturnExample
                         */
                        TuningMultiturnExample.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample();
                            if (object.systemInstruction != null) {
                                if (typeof object.systemInstruction !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TuningMultiturnExample.systemInstruction: object expected");
                                message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.TuningContent.fromObject(object.systemInstruction);
                            }
                            if (object.contents) {
                                if (!Array.isArray(object.contents))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TuningMultiturnExample.contents: array expected");
                                message.contents = [];
                                for (var i = 0; i < object.contents.length; ++i) {
                                    if (typeof object.contents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.TuningMultiturnExample.contents: object expected");
                                    message.contents[i] = $root.google.ai.generativelanguage.v1alpha.TuningContent.fromObject(object.contents[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningMultiturnExample message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TuningMultiturnExample} message TuningMultiturnExample
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningMultiturnExample.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.contents = [];
                            if (message.contents && message.contents.length) {
                                object.contents = [];
                                for (var j = 0; j < message.contents.length; ++j)
                                    object.contents[j] = $root.google.ai.generativelanguage.v1alpha.TuningContent.toObject(message.contents[j], options);
                            }
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) {
                                object.systemInstruction = $root.google.ai.generativelanguage.v1alpha.TuningContent.toObject(message.systemInstruction, options);
                                if (options.oneofs)
                                    object._systemInstruction = "systemInstruction";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TuningMultiturnExample to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningMultiturnExample.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningMultiturnExample
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningMultiturnExample.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningMultiturnExample";
                        };
    
                        return TuningMultiturnExample;
                    })();
    
                    v1alpha.TuningExample = (function() {
    
                        /**
                         * Properties of a TuningExample.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITuningExample
                         * @property {string|null} [textInput] TuningExample textInput
                         * @property {string|null} [output] TuningExample output
                         */
    
                        /**
                         * Constructs a new TuningExample.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TuningExample.
                         * @implements ITuningExample
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITuningExample=} [properties] Properties to set
                         */
                        function TuningExample(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningExample textInput.
                         * @member {string|null|undefined} textInput
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @instance
                         */
                        TuningExample.prototype.textInput = null;
    
                        /**
                         * TuningExample output.
                         * @member {string} output
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @instance
                         */
                        TuningExample.prototype.output = "";
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TuningExample modelInput.
                         * @member {"textInput"|undefined} modelInput
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @instance
                         */
                        Object.defineProperty(TuningExample.prototype, "modelInput", {
                            get: $util.oneOfGetter($oneOfFields = ["textInput"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TuningExample instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningExample=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TuningExample} TuningExample instance
                         */
                        TuningExample.create = function create(properties) {
                            return new TuningExample(properties);
                        };
    
                        /**
                         * Encodes the specified TuningExample message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExample.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningExample} message TuningExample message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExample.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.textInput != null && Object.hasOwnProperty.call(message, "textInput"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.textInput);
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.output);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningExample message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExample.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningExample} message TuningExample message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExample.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningExample message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TuningExample} TuningExample
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExample.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TuningExample();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.textInput = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.output = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningExample message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TuningExample} TuningExample
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExample.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningExample message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningExample.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.textInput != null && message.hasOwnProperty("textInput")) {
                                properties.modelInput = 1;
                                if (!$util.isString(message.textInput))
                                    return "textInput: string expected";
                            }
                            if (message.output != null && message.hasOwnProperty("output"))
                                if (!$util.isString(message.output))
                                    return "output: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TuningExample message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TuningExample} TuningExample
                         */
                        TuningExample.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningExample)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TuningExample();
                            if (object.textInput != null)
                                message.textInput = String(object.textInput);
                            if (object.output != null)
                                message.output = String(object.output);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningExample message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TuningExample} message TuningExample
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningExample.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.output = "";
                            if (message.textInput != null && message.hasOwnProperty("textInput")) {
                                object.textInput = message.textInput;
                                if (options.oneofs)
                                    object.modelInput = "textInput";
                            }
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = message.output;
                            return object;
                        };
    
                        /**
                         * Converts this TuningExample to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningExample.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningExample
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TuningExample
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningExample.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningExample";
                        };
    
                        return TuningExample;
                    })();
    
                    v1alpha.TuningSnapshot = (function() {
    
                        /**
                         * Properties of a TuningSnapshot.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITuningSnapshot
                         * @property {number|null} [step] TuningSnapshot step
                         * @property {number|null} [epoch] TuningSnapshot epoch
                         * @property {number|null} [meanLoss] TuningSnapshot meanLoss
                         * @property {google.protobuf.ITimestamp|null} [computeTime] TuningSnapshot computeTime
                         */
    
                        /**
                         * Constructs a new TuningSnapshot.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TuningSnapshot.
                         * @implements ITuningSnapshot
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITuningSnapshot=} [properties] Properties to set
                         */
                        function TuningSnapshot(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningSnapshot step.
                         * @member {number} step
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.step = 0;
    
                        /**
                         * TuningSnapshot epoch.
                         * @member {number} epoch
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.epoch = 0;
    
                        /**
                         * TuningSnapshot meanLoss.
                         * @member {number} meanLoss
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.meanLoss = 0;
    
                        /**
                         * TuningSnapshot computeTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} computeTime
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.computeTime = null;
    
                        /**
                         * Creates a new TuningSnapshot instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningSnapshot=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TuningSnapshot} TuningSnapshot instance
                         */
                        TuningSnapshot.create = function create(properties) {
                            return new TuningSnapshot(properties);
                        };
    
                        /**
                         * Encodes the specified TuningSnapshot message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningSnapshot.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningSnapshot} message TuningSnapshot message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningSnapshot.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.step != null && Object.hasOwnProperty.call(message, "step"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.step);
                            if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.epoch);
                            if (message.meanLoss != null && Object.hasOwnProperty.call(message, "meanLoss"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.meanLoss);
                            if (message.computeTime != null && Object.hasOwnProperty.call(message, "computeTime"))
                                $root.google.protobuf.Timestamp.encode(message.computeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningSnapshot message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningSnapshot.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITuningSnapshot} message TuningSnapshot message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningSnapshot.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningSnapshot message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TuningSnapshot} TuningSnapshot
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningSnapshot.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TuningSnapshot();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.step = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.epoch = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.meanLoss = reader.float();
                                        break;
                                    }
                                case 4: {
                                        message.computeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningSnapshot message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TuningSnapshot} TuningSnapshot
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningSnapshot.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningSnapshot message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningSnapshot.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.step != null && message.hasOwnProperty("step"))
                                if (!$util.isInteger(message.step))
                                    return "step: integer expected";
                            if (message.epoch != null && message.hasOwnProperty("epoch"))
                                if (!$util.isInteger(message.epoch))
                                    return "epoch: integer expected";
                            if (message.meanLoss != null && message.hasOwnProperty("meanLoss"))
                                if (typeof message.meanLoss !== "number")
                                    return "meanLoss: number expected";
                            if (message.computeTime != null && message.hasOwnProperty("computeTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.computeTime);
                                if (error)
                                    return "computeTime." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TuningSnapshot message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TuningSnapshot} TuningSnapshot
                         */
                        TuningSnapshot.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningSnapshot)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TuningSnapshot();
                            if (object.step != null)
                                message.step = object.step | 0;
                            if (object.epoch != null)
                                message.epoch = object.epoch | 0;
                            if (object.meanLoss != null)
                                message.meanLoss = Number(object.meanLoss);
                            if (object.computeTime != null) {
                                if (typeof object.computeTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TuningSnapshot.computeTime: object expected");
                                message.computeTime = $root.google.protobuf.Timestamp.fromObject(object.computeTime);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningSnapshot message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TuningSnapshot} message TuningSnapshot
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningSnapshot.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.step = 0;
                                object.epoch = 0;
                                object.meanLoss = 0;
                                object.computeTime = null;
                            }
                            if (message.step != null && message.hasOwnProperty("step"))
                                object.step = message.step;
                            if (message.epoch != null && message.hasOwnProperty("epoch"))
                                object.epoch = message.epoch;
                            if (message.meanLoss != null && message.hasOwnProperty("meanLoss"))
                                object.meanLoss = options.json && !isFinite(message.meanLoss) ? String(message.meanLoss) : message.meanLoss;
                            if (message.computeTime != null && message.hasOwnProperty("computeTime"))
                                object.computeTime = $root.google.protobuf.Timestamp.toObject(message.computeTime, options);
                            return object;
                        };
    
                        /**
                         * Converts this TuningSnapshot to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningSnapshot.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningSnapshot
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningSnapshot";
                        };
    
                        return TuningSnapshot;
                    })();
    
                    v1alpha.Permission = (function() {
    
                        /**
                         * Properties of a Permission.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IPermission
                         * @property {string|null} [name] Permission name
                         * @property {google.ai.generativelanguage.v1alpha.Permission.GranteeType|null} [granteeType] Permission granteeType
                         * @property {string|null} [emailAddress] Permission emailAddress
                         * @property {google.ai.generativelanguage.v1alpha.Permission.Role|null} [role] Permission role
                         */
    
                        /**
                         * Constructs a new Permission.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a Permission.
                         * @implements IPermission
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IPermission=} [properties] Properties to set
                         */
                        function Permission(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Permission name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @instance
                         */
                        Permission.prototype.name = "";
    
                        /**
                         * Permission granteeType.
                         * @member {google.ai.generativelanguage.v1alpha.Permission.GranteeType|null|undefined} granteeType
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @instance
                         */
                        Permission.prototype.granteeType = null;
    
                        /**
                         * Permission emailAddress.
                         * @member {string|null|undefined} emailAddress
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @instance
                         */
                        Permission.prototype.emailAddress = null;
    
                        /**
                         * Permission role.
                         * @member {google.ai.generativelanguage.v1alpha.Permission.Role|null|undefined} role
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @instance
                         */
                        Permission.prototype.role = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Permission _granteeType.
                         * @member {"granteeType"|undefined} _granteeType
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @instance
                         */
                        Object.defineProperty(Permission.prototype, "_granteeType", {
                            get: $util.oneOfGetter($oneOfFields = ["granteeType"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Permission _emailAddress.
                         * @member {"emailAddress"|undefined} _emailAddress
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @instance
                         */
                        Object.defineProperty(Permission.prototype, "_emailAddress", {
                            get: $util.oneOfGetter($oneOfFields = ["emailAddress"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Permission _role.
                         * @member {"role"|undefined} _role
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @instance
                         */
                        Object.defineProperty(Permission.prototype, "_role", {
                            get: $util.oneOfGetter($oneOfFields = ["role"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Permission instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPermission=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Permission} Permission instance
                         */
                        Permission.create = function create(properties) {
                            return new Permission(properties);
                        };
    
                        /**
                         * Encodes the specified Permission message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Permission.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPermission} message Permission message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Permission.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.granteeType != null && Object.hasOwnProperty.call(message, "granteeType"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.granteeType);
                            if (message.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.emailAddress);
                            if (message.role != null && Object.hasOwnProperty.call(message, "role"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.role);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Permission message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Permission.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPermission} message Permission message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Permission.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Permission message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Permission} Permission
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Permission.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Permission();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.granteeType = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.emailAddress = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.role = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Permission message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Permission} Permission
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Permission.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Permission message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Permission.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.granteeType != null && message.hasOwnProperty("granteeType")) {
                                properties._granteeType = 1;
                                switch (message.granteeType) {
                                default:
                                    return "granteeType: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            }
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) {
                                properties._emailAddress = 1;
                                if (!$util.isString(message.emailAddress))
                                    return "emailAddress: string expected";
                            }
                            if (message.role != null && message.hasOwnProperty("role")) {
                                properties._role = 1;
                                switch (message.role) {
                                default:
                                    return "role: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Permission message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Permission} Permission
                         */
                        Permission.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Permission)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Permission();
                            if (object.name != null)
                                message.name = String(object.name);
                            switch (object.granteeType) {
                            default:
                                if (typeof object.granteeType === "number") {
                                    message.granteeType = object.granteeType;
                                    break;
                                }
                                break;
                            case "GRANTEE_TYPE_UNSPECIFIED":
                            case 0:
                                message.granteeType = 0;
                                break;
                            case "USER":
                            case 1:
                                message.granteeType = 1;
                                break;
                            case "GROUP":
                            case 2:
                                message.granteeType = 2;
                                break;
                            case "EVERYONE":
                            case 3:
                                message.granteeType = 3;
                                break;
                            }
                            if (object.emailAddress != null)
                                message.emailAddress = String(object.emailAddress);
                            switch (object.role) {
                            default:
                                if (typeof object.role === "number") {
                                    message.role = object.role;
                                    break;
                                }
                                break;
                            case "ROLE_UNSPECIFIED":
                            case 0:
                                message.role = 0;
                                break;
                            case "OWNER":
                            case 1:
                                message.role = 1;
                                break;
                            case "WRITER":
                            case 2:
                                message.role = 2;
                                break;
                            case "READER":
                            case 3:
                                message.role = 3;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Permission message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Permission} message Permission
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Permission.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.granteeType != null && message.hasOwnProperty("granteeType")) {
                                object.granteeType = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Permission.GranteeType[message.granteeType] === undefined ? message.granteeType : $root.google.ai.generativelanguage.v1alpha.Permission.GranteeType[message.granteeType] : message.granteeType;
                                if (options.oneofs)
                                    object._granteeType = "granteeType";
                            }
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) {
                                object.emailAddress = message.emailAddress;
                                if (options.oneofs)
                                    object._emailAddress = "emailAddress";
                            }
                            if (message.role != null && message.hasOwnProperty("role")) {
                                object.role = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Permission.Role[message.role] === undefined ? message.role : $root.google.ai.generativelanguage.v1alpha.Permission.Role[message.role] : message.role;
                                if (options.oneofs)
                                    object._role = "role";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Permission to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Permission.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Permission
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Permission
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Permission.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Permission";
                        };
    
                        /**
                         * GranteeType enum.
                         * @name google.ai.generativelanguage.v1alpha.Permission.GranteeType
                         * @enum {number}
                         * @property {number} GRANTEE_TYPE_UNSPECIFIED=0 GRANTEE_TYPE_UNSPECIFIED value
                         * @property {number} USER=1 USER value
                         * @property {number} GROUP=2 GROUP value
                         * @property {number} EVERYONE=3 EVERYONE value
                         */
                        Permission.GranteeType = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "GRANTEE_TYPE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "USER"] = 1;
                            values[valuesById[2] = "GROUP"] = 2;
                            values[valuesById[3] = "EVERYONE"] = 3;
                            return values;
                        })();
    
                        /**
                         * Role enum.
                         * @name google.ai.generativelanguage.v1alpha.Permission.Role
                         * @enum {number}
                         * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value
                         * @property {number} OWNER=1 OWNER value
                         * @property {number} WRITER=2 WRITER value
                         * @property {number} READER=3 READER value
                         */
                        Permission.Role = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "OWNER"] = 1;
                            values[valuesById[2] = "WRITER"] = 2;
                            values[valuesById[3] = "READER"] = 3;
                            return values;
                        })();
    
                        return Permission;
                    })();
    
                    v1alpha.PermissionService = (function() {
    
                        /**
                         * Constructs a new PermissionService service.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a PermissionService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function PermissionService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (PermissionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PermissionService;
    
                        /**
                         * Creates new PermissionService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {PermissionService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        PermissionService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|createPermission}.
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @typedef CreatePermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Permission} [response] Permission
                         */
    
                        /**
                         * Calls CreatePermission.
                         * @function createPermission
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest} request CreatePermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.PermissionService.CreatePermissionCallback} callback Node-style callback called with the error, if any, and Permission
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.createPermission = function createPermission(request, callback) {
                            return this.rpcCall(createPermission, $root.google.ai.generativelanguage.v1alpha.CreatePermissionRequest, $root.google.ai.generativelanguage.v1alpha.Permission, request, callback);
                        }, "name", { value: "CreatePermission" });
    
                        /**
                         * Calls CreatePermission.
                         * @function createPermission
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest} request CreatePermissionRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Permission>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|getPermission}.
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @typedef GetPermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Permission} [response] Permission
                         */
    
                        /**
                         * Calls GetPermission.
                         * @function getPermission
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest} request GetPermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.PermissionService.GetPermissionCallback} callback Node-style callback called with the error, if any, and Permission
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.getPermission = function getPermission(request, callback) {
                            return this.rpcCall(getPermission, $root.google.ai.generativelanguage.v1alpha.GetPermissionRequest, $root.google.ai.generativelanguage.v1alpha.Permission, request, callback);
                        }, "name", { value: "GetPermission" });
    
                        /**
                         * Calls GetPermission.
                         * @function getPermission
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest} request GetPermissionRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Permission>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|listPermissions}.
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @typedef ListPermissionsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} [response] ListPermissionsResponse
                         */
    
                        /**
                         * Calls ListPermissions.
                         * @function listPermissions
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest} request ListPermissionsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.PermissionService.ListPermissionsCallback} callback Node-style callback called with the error, if any, and ListPermissionsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.listPermissions = function listPermissions(request, callback) {
                            return this.rpcCall(listPermissions, $root.google.ai.generativelanguage.v1alpha.ListPermissionsRequest, $root.google.ai.generativelanguage.v1alpha.ListPermissionsResponse, request, callback);
                        }, "name", { value: "ListPermissions" });
    
                        /**
                         * Calls ListPermissions.
                         * @function listPermissions
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest} request ListPermissionsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.ListPermissionsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|updatePermission}.
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @typedef UpdatePermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Permission} [response] Permission
                         */
    
                        /**
                         * Calls UpdatePermission.
                         * @function updatePermission
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest} request UpdatePermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.PermissionService.UpdatePermissionCallback} callback Node-style callback called with the error, if any, and Permission
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.updatePermission = function updatePermission(request, callback) {
                            return this.rpcCall(updatePermission, $root.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest, $root.google.ai.generativelanguage.v1alpha.Permission, request, callback);
                        }, "name", { value: "UpdatePermission" });
    
                        /**
                         * Calls UpdatePermission.
                         * @function updatePermission
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest} request UpdatePermissionRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Permission>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|deletePermission}.
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @typedef DeletePermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeletePermission.
                         * @function deletePermission
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest} request DeletePermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.PermissionService.DeletePermissionCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.deletePermission = function deletePermission(request, callback) {
                            return this.rpcCall(deletePermission, $root.google.ai.generativelanguage.v1alpha.DeletePermissionRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeletePermission" });
    
                        /**
                         * Calls DeletePermission.
                         * @function deletePermission
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest} request DeletePermissionRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|transferOwnership}.
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @typedef TransferOwnershipCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} [response] TransferOwnershipResponse
                         */
    
                        /**
                         * Calls TransferOwnership.
                         * @function transferOwnership
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest} request TransferOwnershipRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.PermissionService.TransferOwnershipCallback} callback Node-style callback called with the error, if any, and TransferOwnershipResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.transferOwnership = function transferOwnership(request, callback) {
                            return this.rpcCall(transferOwnership, $root.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest, $root.google.ai.generativelanguage.v1alpha.TransferOwnershipResponse, request, callback);
                        }, "name", { value: "TransferOwnership" });
    
                        /**
                         * Calls TransferOwnership.
                         * @function transferOwnership
                         * @memberof google.ai.generativelanguage.v1alpha.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest} request TransferOwnershipRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.TransferOwnershipResponse>} Promise
                         * @variation 2
                         */
    
                        return PermissionService;
                    })();
    
                    v1alpha.CreatePermissionRequest = (function() {
    
                        /**
                         * Properties of a CreatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICreatePermissionRequest
                         * @property {string|null} [parent] CreatePermissionRequest parent
                         * @property {google.ai.generativelanguage.v1alpha.IPermission|null} [permission] CreatePermissionRequest permission
                         */
    
                        /**
                         * Constructs a new CreatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CreatePermissionRequest.
                         * @implements ICreatePermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest=} [properties] Properties to set
                         */
                        function CreatePermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreatePermissionRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @instance
                         */
                        CreatePermissionRequest.prototype.parent = "";
    
                        /**
                         * CreatePermissionRequest permission.
                         * @member {google.ai.generativelanguage.v1alpha.IPermission|null|undefined} permission
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @instance
                         */
                        CreatePermissionRequest.prototype.permission = null;
    
                        /**
                         * Creates a new CreatePermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CreatePermissionRequest} CreatePermissionRequest instance
                         */
                        CreatePermissionRequest.create = function create(properties) {
                            return new CreatePermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreatePermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest} message CreatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreatePermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.permission != null && Object.hasOwnProperty.call(message, "permission"))
                                $root.google.ai.generativelanguage.v1alpha.Permission.encode(message.permission, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreatePermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest} message CreatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreatePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreatePermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CreatePermissionRequest} CreatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreatePermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreatePermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.permission = $root.google.ai.generativelanguage.v1alpha.Permission.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreatePermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CreatePermissionRequest} CreatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreatePermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreatePermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreatePermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.permission != null && message.hasOwnProperty("permission")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Permission.verify(message.permission);
                                if (error)
                                    return "permission." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreatePermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CreatePermissionRequest} CreatePermissionRequest
                         */
                        CreatePermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreatePermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CreatePermissionRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.permission != null) {
                                if (typeof object.permission !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CreatePermissionRequest.permission: object expected");
                                message.permission = $root.google.ai.generativelanguage.v1alpha.Permission.fromObject(object.permission);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreatePermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CreatePermissionRequest} message CreatePermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreatePermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.permission = null;
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.permission != null && message.hasOwnProperty("permission"))
                                object.permission = $root.google.ai.generativelanguage.v1alpha.Permission.toObject(message.permission, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreatePermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreatePermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreatePermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreatePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreatePermissionRequest";
                        };
    
                        return CreatePermissionRequest;
                    })();
    
                    v1alpha.GetPermissionRequest = (function() {
    
                        /**
                         * Properties of a GetPermissionRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGetPermissionRequest
                         * @property {string|null} [name] GetPermissionRequest name
                         */
    
                        /**
                         * Constructs a new GetPermissionRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GetPermissionRequest.
                         * @implements IGetPermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest=} [properties] Properties to set
                         */
                        function GetPermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetPermissionRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest
                         * @instance
                         */
                        GetPermissionRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetPermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GetPermissionRequest} GetPermissionRequest instance
                         */
                        GetPermissionRequest.create = function create(properties) {
                            return new GetPermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetPermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetPermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest} message GetPermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetPermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetPermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetPermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest} message GetPermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetPermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetPermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GetPermissionRequest} GetPermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetPermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetPermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetPermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GetPermissionRequest} GetPermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetPermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetPermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetPermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetPermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GetPermissionRequest} GetPermissionRequest
                         */
                        GetPermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetPermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GetPermissionRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetPermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GetPermissionRequest} message GetPermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetPermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetPermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetPermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetPermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetPermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetPermissionRequest";
                        };
    
                        return GetPermissionRequest;
                    })();
    
                    v1alpha.ListPermissionsRequest = (function() {
    
                        /**
                         * Properties of a ListPermissionsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListPermissionsRequest
                         * @property {string|null} [parent] ListPermissionsRequest parent
                         * @property {number|null} [pageSize] ListPermissionsRequest pageSize
                         * @property {string|null} [pageToken] ListPermissionsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListPermissionsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListPermissionsRequest.
                         * @implements IListPermissionsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest=} [properties] Properties to set
                         */
                        function ListPermissionsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListPermissionsRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @instance
                         */
                        ListPermissionsRequest.prototype.parent = "";
    
                        /**
                         * ListPermissionsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @instance
                         */
                        ListPermissionsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListPermissionsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @instance
                         */
                        ListPermissionsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListPermissionsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsRequest} ListPermissionsRequest instance
                         */
                        ListPermissionsRequest.create = function create(properties) {
                            return new ListPermissionsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListPermissionsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListPermissionsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListPermissionsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsRequest} ListPermissionsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListPermissionsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListPermissionsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsRequest} ListPermissionsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListPermissionsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListPermissionsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListPermissionsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsRequest} ListPermissionsRequest
                         */
                        ListPermissionsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListPermissionsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListPermissionsRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListPermissionsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListPermissionsRequest} message ListPermissionsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListPermissionsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListPermissionsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListPermissionsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListPermissionsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListPermissionsRequest";
                        };
    
                        return ListPermissionsRequest;
                    })();
    
                    v1alpha.ListPermissionsResponse = (function() {
    
                        /**
                         * Properties of a ListPermissionsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListPermissionsResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IPermission>|null} [permissions] ListPermissionsResponse permissions
                         * @property {string|null} [nextPageToken] ListPermissionsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListPermissionsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListPermissionsResponse.
                         * @implements IListPermissionsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListPermissionsResponse=} [properties] Properties to set
                         */
                        function ListPermissionsResponse(properties) {
                            this.permissions = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListPermissionsResponse permissions.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IPermission>} permissions
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @instance
                         */
                        ListPermissionsResponse.prototype.permissions = $util.emptyArray;
    
                        /**
                         * ListPermissionsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @instance
                         */
                        ListPermissionsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListPermissionsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListPermissionsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} ListPermissionsResponse instance
                         */
                        ListPermissionsResponse.create = function create(properties) {
                            return new ListPermissionsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListPermissionsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.permissions != null && message.permissions.length)
                                for (var i = 0; i < message.permissions.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Permission.encode(message.permissions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListPermissionsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListPermissionsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} ListPermissionsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListPermissionsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.permissions && message.permissions.length))
                                            message.permissions = [];
                                        message.permissions.push($root.google.ai.generativelanguage.v1alpha.Permission.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListPermissionsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} ListPermissionsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListPermissionsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListPermissionsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.permissions != null && message.hasOwnProperty("permissions")) {
                                if (!Array.isArray(message.permissions))
                                    return "permissions: array expected";
                                for (var i = 0; i < message.permissions.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Permission.verify(message.permissions[i]);
                                    if (error)
                                        return "permissions." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListPermissionsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} ListPermissionsResponse
                         */
                        ListPermissionsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListPermissionsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListPermissionsResponse();
                            if (object.permissions) {
                                if (!Array.isArray(object.permissions))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.ListPermissionsResponse.permissions: array expected");
                                message.permissions = [];
                                for (var i = 0; i < object.permissions.length; ++i) {
                                    if (typeof object.permissions[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.ListPermissionsResponse.permissions: object expected");
                                    message.permissions[i] = $root.google.ai.generativelanguage.v1alpha.Permission.fromObject(object.permissions[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListPermissionsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} message ListPermissionsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListPermissionsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.permissions = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.permissions && message.permissions.length) {
                                object.permissions = [];
                                for (var j = 0; j < message.permissions.length; ++j)
                                    object.permissions[j] = $root.google.ai.generativelanguage.v1alpha.Permission.toObject(message.permissions[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListPermissionsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListPermissionsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListPermissionsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListPermissionsResponse";
                        };
    
                        return ListPermissionsResponse;
                    })();
    
                    v1alpha.UpdatePermissionRequest = (function() {
    
                        /**
                         * Properties of an UpdatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IUpdatePermissionRequest
                         * @property {google.ai.generativelanguage.v1alpha.IPermission|null} [permission] UpdatePermissionRequest permission
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePermissionRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an UpdatePermissionRequest.
                         * @implements IUpdatePermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest=} [properties] Properties to set
                         */
                        function UpdatePermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdatePermissionRequest permission.
                         * @member {google.ai.generativelanguage.v1alpha.IPermission|null|undefined} permission
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @instance
                         */
                        UpdatePermissionRequest.prototype.permission = null;
    
                        /**
                         * UpdatePermissionRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @instance
                         */
                        UpdatePermissionRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdatePermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.UpdatePermissionRequest} UpdatePermissionRequest instance
                         */
                        UpdatePermissionRequest.create = function create(properties) {
                            return new UpdatePermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdatePermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest} message UpdatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdatePermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.permission != null && Object.hasOwnProperty.call(message, "permission"))
                                $root.google.ai.generativelanguage.v1alpha.Permission.encode(message.permission, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdatePermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest} message UpdatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdatePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdatePermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.UpdatePermissionRequest} UpdatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdatePermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.permission = $root.google.ai.generativelanguage.v1alpha.Permission.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdatePermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.UpdatePermissionRequest} UpdatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdatePermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdatePermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdatePermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.permission != null && message.hasOwnProperty("permission")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Permission.verify(message.permission);
                                if (error)
                                    return "permission." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdatePermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.UpdatePermissionRequest} UpdatePermissionRequest
                         */
                        UpdatePermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest();
                            if (object.permission != null) {
                                if (typeof object.permission !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdatePermissionRequest.permission: object expected");
                                message.permission = $root.google.ai.generativelanguage.v1alpha.Permission.fromObject(object.permission);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdatePermissionRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdatePermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.UpdatePermissionRequest} message UpdatePermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdatePermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.permission = null;
                                object.updateMask = null;
                            }
                            if (message.permission != null && message.hasOwnProperty("permission"))
                                object.permission = $root.google.ai.generativelanguage.v1alpha.Permission.toObject(message.permission, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdatePermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdatePermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdatePermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdatePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdatePermissionRequest";
                        };
    
                        return UpdatePermissionRequest;
                    })();
    
                    v1alpha.DeletePermissionRequest = (function() {
    
                        /**
                         * Properties of a DeletePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IDeletePermissionRequest
                         * @property {string|null} [name] DeletePermissionRequest name
                         */
    
                        /**
                         * Constructs a new DeletePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a DeletePermissionRequest.
                         * @implements IDeletePermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest=} [properties] Properties to set
                         */
                        function DeletePermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeletePermissionRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest
                         * @instance
                         */
                        DeletePermissionRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeletePermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.DeletePermissionRequest} DeletePermissionRequest instance
                         */
                        DeletePermissionRequest.create = function create(properties) {
                            return new DeletePermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeletePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeletePermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest} message DeletePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeletePermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeletePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeletePermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest} message DeletePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeletePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeletePermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.DeletePermissionRequest} DeletePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeletePermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DeletePermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeletePermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.DeletePermissionRequest} DeletePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeletePermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeletePermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeletePermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeletePermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.DeletePermissionRequest} DeletePermissionRequest
                         */
                        DeletePermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeletePermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.DeletePermissionRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeletePermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.DeletePermissionRequest} message DeletePermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeletePermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeletePermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeletePermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeletePermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeletePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeletePermissionRequest";
                        };
    
                        return DeletePermissionRequest;
                    })();
    
                    v1alpha.TransferOwnershipRequest = (function() {
    
                        /**
                         * Properties of a TransferOwnershipRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITransferOwnershipRequest
                         * @property {string|null} [name] TransferOwnershipRequest name
                         * @property {string|null} [emailAddress] TransferOwnershipRequest emailAddress
                         */
    
                        /**
                         * Constructs a new TransferOwnershipRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TransferOwnershipRequest.
                         * @implements ITransferOwnershipRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest=} [properties] Properties to set
                         */
                        function TransferOwnershipRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TransferOwnershipRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @instance
                         */
                        TransferOwnershipRequest.prototype.name = "";
    
                        /**
                         * TransferOwnershipRequest emailAddress.
                         * @member {string} emailAddress
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @instance
                         */
                        TransferOwnershipRequest.prototype.emailAddress = "";
    
                        /**
                         * Creates a new TransferOwnershipRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipRequest} TransferOwnershipRequest instance
                         */
                        TransferOwnershipRequest.create = function create(properties) {
                            return new TransferOwnershipRequest(properties);
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest} message TransferOwnershipRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.emailAddress);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest} message TransferOwnershipRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TransferOwnershipRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipRequest} TransferOwnershipRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.emailAddress = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TransferOwnershipRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipRequest} TransferOwnershipRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TransferOwnershipRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TransferOwnershipRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress"))
                                if (!$util.isString(message.emailAddress))
                                    return "emailAddress: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TransferOwnershipRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipRequest} TransferOwnershipRequest
                         */
                        TransferOwnershipRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.emailAddress != null)
                                message.emailAddress = String(object.emailAddress);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TransferOwnershipRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TransferOwnershipRequest} message TransferOwnershipRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TransferOwnershipRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.emailAddress = "";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress"))
                                object.emailAddress = message.emailAddress;
                            return object;
                        };
    
                        /**
                         * Converts this TransferOwnershipRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TransferOwnershipRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TransferOwnershipRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TransferOwnershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TransferOwnershipRequest";
                        };
    
                        return TransferOwnershipRequest;
                    })();
    
                    v1alpha.TransferOwnershipResponse = (function() {
    
                        /**
                         * Properties of a TransferOwnershipResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITransferOwnershipResponse
                         */
    
                        /**
                         * Constructs a new TransferOwnershipResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TransferOwnershipResponse.
                         * @implements ITransferOwnershipResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse=} [properties] Properties to set
                         */
                        function TransferOwnershipResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Creates a new TransferOwnershipResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} TransferOwnershipResponse instance
                         */
                        TransferOwnershipResponse.create = function create(properties) {
                            return new TransferOwnershipResponse(properties);
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse} message TransferOwnershipResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse} message TransferOwnershipResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TransferOwnershipResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} TransferOwnershipResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TransferOwnershipResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TransferOwnershipResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} TransferOwnershipResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TransferOwnershipResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TransferOwnershipResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            return null;
                        };
    
                        /**
                         * Creates a TransferOwnershipResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} TransferOwnershipResponse
                         */
                        TransferOwnershipResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TransferOwnershipResponse)
                                return object;
                            return new $root.google.ai.generativelanguage.v1alpha.TransferOwnershipResponse();
                        };
    
                        /**
                         * Creates a plain object from a TransferOwnershipResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} message TransferOwnershipResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TransferOwnershipResponse.toObject = function toObject() {
                            return {};
                        };
    
                        /**
                         * Converts this TransferOwnershipResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TransferOwnershipResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TransferOwnershipResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TransferOwnershipResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TransferOwnershipResponse";
                        };
    
                        return TransferOwnershipResponse;
                    })();
    
                    v1alpha.PredictionService = (function() {
    
                        /**
                         * Constructs a new PredictionService service.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a PredictionService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function PredictionService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService;
    
                        /**
                         * Creates new PredictionService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.PredictionService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {PredictionService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.PredictionService|predict}.
                         * @memberof google.ai.generativelanguage.v1alpha.PredictionService
                         * @typedef PredictCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.PredictResponse} [response] PredictResponse
                         */
    
                        /**
                         * Calls Predict.
                         * @function predict
                         * @memberof google.ai.generativelanguage.v1alpha.PredictionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IPredictRequest} request PredictRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) {
                            return this.rpcCall(predict, $root.google.ai.generativelanguage.v1alpha.PredictRequest, $root.google.ai.generativelanguage.v1alpha.PredictResponse, request, callback);
                        }, "name", { value: "Predict" });
    
                        /**
                         * Calls Predict.
                         * @function predict
                         * @memberof google.ai.generativelanguage.v1alpha.PredictionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IPredictRequest} request PredictRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.PredictResponse>} Promise
                         * @variation 2
                         */
    
                        return PredictionService;
                    })();
    
                    v1alpha.PredictRequest = (function() {
    
                        /**
                         * Properties of a PredictRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IPredictRequest
                         * @property {string|null} [model] PredictRequest model
                         * @property {Array.<google.protobuf.IValue>|null} [instances] PredictRequest instances
                         * @property {google.protobuf.IValue|null} [parameters] PredictRequest parameters
                         */
    
                        /**
                         * Constructs a new PredictRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a PredictRequest.
                         * @implements IPredictRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IPredictRequest=} [properties] Properties to set
                         */
                        function PredictRequest(properties) {
                            this.instances = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * PredictRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @instance
                         */
                        PredictRequest.prototype.model = "";
    
                        /**
                         * PredictRequest instances.
                         * @member {Array.<google.protobuf.IValue>} instances
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @instance
                         */
                        PredictRequest.prototype.instances = $util.emptyArray;
    
                        /**
                         * PredictRequest parameters.
                         * @member {google.protobuf.IValue|null|undefined} parameters
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @instance
                         */
                        PredictRequest.prototype.parameters = null;
    
                        /**
                         * Creates a new PredictRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPredictRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.PredictRequest} PredictRequest instance
                         */
                        PredictRequest.create = function create(properties) {
                            return new PredictRequest(properties);
                        };
    
                        /**
                         * Encodes the specified PredictRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PredictRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPredictRequest} message PredictRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PredictRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.instances != null && message.instances.length)
                                for (var i = 0; i < message.instances.length; ++i)
                                    $root.google.protobuf.Value.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters"))
                                $root.google.protobuf.Value.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PredictRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPredictRequest} message PredictRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PredictRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a PredictRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.PredictRequest} PredictRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PredictRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.PredictRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.instances && message.instances.length))
                                            message.instances = [];
                                        message.instances.push($root.google.protobuf.Value.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        message.parameters = $root.google.protobuf.Value.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a PredictRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.PredictRequest} PredictRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PredictRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a PredictRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        PredictRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.instances != null && message.hasOwnProperty("instances")) {
                                if (!Array.isArray(message.instances))
                                    return "instances: array expected";
                                for (var i = 0; i < message.instances.length; ++i) {
                                    var error = $root.google.protobuf.Value.verify(message.instances[i]);
                                    if (error)
                                        return "instances." + error;
                                }
                            }
                            if (message.parameters != null && message.hasOwnProperty("parameters")) {
                                var error = $root.google.protobuf.Value.verify(message.parameters);
                                if (error)
                                    return "parameters." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.PredictRequest} PredictRequest
                         */
                        PredictRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.PredictRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.PredictRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.instances) {
                                if (!Array.isArray(object.instances))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.PredictRequest.instances: array expected");
                                message.instances = [];
                                for (var i = 0; i < object.instances.length; ++i) {
                                    if (typeof object.instances[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.PredictRequest.instances: object expected");
                                    message.instances[i] = $root.google.protobuf.Value.fromObject(object.instances[i]);
                                }
                            }
                            if (object.parameters != null) {
                                if (typeof object.parameters !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.PredictRequest.parameters: object expected");
                                message.parameters = $root.google.protobuf.Value.fromObject(object.parameters);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a PredictRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.PredictRequest} message PredictRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        PredictRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.instances = [];
                            if (options.defaults) {
                                object.model = "";
                                object.parameters = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.instances && message.instances.length) {
                                object.instances = [];
                                for (var j = 0; j < message.instances.length; ++j)
                                    object.instances[j] = $root.google.protobuf.Value.toObject(message.instances[j], options);
                            }
                            if (message.parameters != null && message.hasOwnProperty("parameters"))
                                object.parameters = $root.google.protobuf.Value.toObject(message.parameters, options);
                            return object;
                        };
    
                        /**
                         * Converts this PredictRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        PredictRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for PredictRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.PredictRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        PredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.PredictRequest";
                        };
    
                        return PredictRequest;
                    })();
    
                    v1alpha.PredictResponse = (function() {
    
                        /**
                         * Properties of a PredictResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IPredictResponse
                         * @property {Array.<google.protobuf.IValue>|null} [predictions] PredictResponse predictions
                         */
    
                        /**
                         * Constructs a new PredictResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a PredictResponse.
                         * @implements IPredictResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IPredictResponse=} [properties] Properties to set
                         */
                        function PredictResponse(properties) {
                            this.predictions = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * PredictResponse predictions.
                         * @member {Array.<google.protobuf.IValue>} predictions
                         * @memberof google.ai.generativelanguage.v1alpha.PredictResponse
                         * @instance
                         */
                        PredictResponse.prototype.predictions = $util.emptyArray;
    
                        /**
                         * Creates a new PredictResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.PredictResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPredictResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.PredictResponse} PredictResponse instance
                         */
                        PredictResponse.create = function create(properties) {
                            return new PredictResponse(properties);
                        };
    
                        /**
                         * Encodes the specified PredictResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PredictResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.PredictResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPredictResponse} message PredictResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PredictResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.predictions != null && message.predictions.length)
                                for (var i = 0; i < message.predictions.length; ++i)
                                    $root.google.protobuf.Value.encode(message.predictions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PredictResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.PredictResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IPredictResponse} message PredictResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PredictResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a PredictResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.PredictResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.PredictResponse} PredictResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PredictResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.PredictResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.predictions && message.predictions.length))
                                            message.predictions = [];
                                        message.predictions.push($root.google.protobuf.Value.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a PredictResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.PredictResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.PredictResponse} PredictResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PredictResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a PredictResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.PredictResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        PredictResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.predictions != null && message.hasOwnProperty("predictions")) {
                                if (!Array.isArray(message.predictions))
                                    return "predictions: array expected";
                                for (var i = 0; i < message.predictions.length; ++i) {
                                    var error = $root.google.protobuf.Value.verify(message.predictions[i]);
                                    if (error)
                                        return "predictions." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.PredictResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.PredictResponse} PredictResponse
                         */
                        PredictResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.PredictResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.PredictResponse();
                            if (object.predictions) {
                                if (!Array.isArray(object.predictions))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.PredictResponse.predictions: array expected");
                                message.predictions = [];
                                for (var i = 0; i < object.predictions.length; ++i) {
                                    if (typeof object.predictions[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.PredictResponse.predictions: object expected");
                                    message.predictions[i] = $root.google.protobuf.Value.fromObject(object.predictions[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a PredictResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.PredictResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.PredictResponse} message PredictResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        PredictResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.predictions = [];
                            if (message.predictions && message.predictions.length) {
                                object.predictions = [];
                                for (var j = 0; j < message.predictions.length; ++j)
                                    object.predictions[j] = $root.google.protobuf.Value.toObject(message.predictions[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this PredictResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.PredictResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        PredictResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for PredictResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.PredictResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        PredictResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.PredictResponse";
                        };
    
                        return PredictResponse;
                    })();
    
                    v1alpha.RetrieverService = (function() {
    
                        /**
                         * Constructs a new RetrieverService service.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a RetrieverService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function RetrieverService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (RetrieverService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RetrieverService;
    
                        /**
                         * Creates new RetrieverService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {RetrieverService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        RetrieverService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|createCorpus}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef CreateCorpusCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Corpus} [response] Corpus
                         */
    
                        /**
                         * Calls CreateCorpus.
                         * @function createCorpus
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest} request CreateCorpusRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.CreateCorpusCallback} callback Node-style callback called with the error, if any, and Corpus
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.createCorpus = function createCorpus(request, callback) {
                            return this.rpcCall(createCorpus, $root.google.ai.generativelanguage.v1alpha.CreateCorpusRequest, $root.google.ai.generativelanguage.v1alpha.Corpus, request, callback);
                        }, "name", { value: "CreateCorpus" });
    
                        /**
                         * Calls CreateCorpus.
                         * @function createCorpus
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest} request CreateCorpusRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Corpus>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|getCorpus}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef GetCorpusCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Corpus} [response] Corpus
                         */
    
                        /**
                         * Calls GetCorpus.
                         * @function getCorpus
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest} request GetCorpusRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.GetCorpusCallback} callback Node-style callback called with the error, if any, and Corpus
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.getCorpus = function getCorpus(request, callback) {
                            return this.rpcCall(getCorpus, $root.google.ai.generativelanguage.v1alpha.GetCorpusRequest, $root.google.ai.generativelanguage.v1alpha.Corpus, request, callback);
                        }, "name", { value: "GetCorpus" });
    
                        /**
                         * Calls GetCorpus.
                         * @function getCorpus
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest} request GetCorpusRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Corpus>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|updateCorpus}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef UpdateCorpusCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Corpus} [response] Corpus
                         */
    
                        /**
                         * Calls UpdateCorpus.
                         * @function updateCorpus
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest} request UpdateCorpusRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.UpdateCorpusCallback} callback Node-style callback called with the error, if any, and Corpus
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.updateCorpus = function updateCorpus(request, callback) {
                            return this.rpcCall(updateCorpus, $root.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest, $root.google.ai.generativelanguage.v1alpha.Corpus, request, callback);
                        }, "name", { value: "UpdateCorpus" });
    
                        /**
                         * Calls UpdateCorpus.
                         * @function updateCorpus
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest} request UpdateCorpusRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Corpus>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|deleteCorpus}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef DeleteCorpusCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteCorpus.
                         * @function deleteCorpus
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest} request DeleteCorpusRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.DeleteCorpusCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.deleteCorpus = function deleteCorpus(request, callback) {
                            return this.rpcCall(deleteCorpus, $root.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteCorpus" });
    
                        /**
                         * Calls DeleteCorpus.
                         * @function deleteCorpus
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest} request DeleteCorpusRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|listCorpora}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef ListCorporaCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.ListCorporaResponse} [response] ListCorporaResponse
                         */
    
                        /**
                         * Calls ListCorpora.
                         * @function listCorpora
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest} request ListCorporaRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.ListCorporaCallback} callback Node-style callback called with the error, if any, and ListCorporaResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.listCorpora = function listCorpora(request, callback) {
                            return this.rpcCall(listCorpora, $root.google.ai.generativelanguage.v1alpha.ListCorporaRequest, $root.google.ai.generativelanguage.v1alpha.ListCorporaResponse, request, callback);
                        }, "name", { value: "ListCorpora" });
    
                        /**
                         * Calls ListCorpora.
                         * @function listCorpora
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest} request ListCorporaRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.ListCorporaResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|queryCorpus}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef QueryCorpusCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} [response] QueryCorpusResponse
                         */
    
                        /**
                         * Calls QueryCorpus.
                         * @function queryCorpus
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest} request QueryCorpusRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.QueryCorpusCallback} callback Node-style callback called with the error, if any, and QueryCorpusResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.queryCorpus = function queryCorpus(request, callback) {
                            return this.rpcCall(queryCorpus, $root.google.ai.generativelanguage.v1alpha.QueryCorpusRequest, $root.google.ai.generativelanguage.v1alpha.QueryCorpusResponse, request, callback);
                        }, "name", { value: "QueryCorpus" });
    
                        /**
                         * Calls QueryCorpus.
                         * @function queryCorpus
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest} request QueryCorpusRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.QueryCorpusResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|createDocument}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef CreateDocumentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Document} [response] Document
                         */
    
                        /**
                         * Calls CreateDocument.
                         * @function createDocument
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest} request CreateDocumentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.CreateDocumentCallback} callback Node-style callback called with the error, if any, and Document
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.createDocument = function createDocument(request, callback) {
                            return this.rpcCall(createDocument, $root.google.ai.generativelanguage.v1alpha.CreateDocumentRequest, $root.google.ai.generativelanguage.v1alpha.Document, request, callback);
                        }, "name", { value: "CreateDocument" });
    
                        /**
                         * Calls CreateDocument.
                         * @function createDocument
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest} request CreateDocumentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Document>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|getDocument}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef GetDocumentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Document} [response] Document
                         */
    
                        /**
                         * Calls GetDocument.
                         * @function getDocument
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest} request GetDocumentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.GetDocumentCallback} callback Node-style callback called with the error, if any, and Document
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.getDocument = function getDocument(request, callback) {
                            return this.rpcCall(getDocument, $root.google.ai.generativelanguage.v1alpha.GetDocumentRequest, $root.google.ai.generativelanguage.v1alpha.Document, request, callback);
                        }, "name", { value: "GetDocument" });
    
                        /**
                         * Calls GetDocument.
                         * @function getDocument
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest} request GetDocumentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Document>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|updateDocument}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef UpdateDocumentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Document} [response] Document
                         */
    
                        /**
                         * Calls UpdateDocument.
                         * @function updateDocument
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.UpdateDocumentCallback} callback Node-style callback called with the error, if any, and Document
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.updateDocument = function updateDocument(request, callback) {
                            return this.rpcCall(updateDocument, $root.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest, $root.google.ai.generativelanguage.v1alpha.Document, request, callback);
                        }, "name", { value: "UpdateDocument" });
    
                        /**
                         * Calls UpdateDocument.
                         * @function updateDocument
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Document>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|deleteDocument}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef DeleteDocumentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteDocument.
                         * @function deleteDocument
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.DeleteDocumentCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.deleteDocument = function deleteDocument(request, callback) {
                            return this.rpcCall(deleteDocument, $root.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteDocument" });
    
                        /**
                         * Calls DeleteDocument.
                         * @function deleteDocument
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|listDocuments}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef ListDocumentsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} [response] ListDocumentsResponse
                         */
    
                        /**
                         * Calls ListDocuments.
                         * @function listDocuments
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest} request ListDocumentsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.ListDocumentsCallback} callback Node-style callback called with the error, if any, and ListDocumentsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.listDocuments = function listDocuments(request, callback) {
                            return this.rpcCall(listDocuments, $root.google.ai.generativelanguage.v1alpha.ListDocumentsRequest, $root.google.ai.generativelanguage.v1alpha.ListDocumentsResponse, request, callback);
                        }, "name", { value: "ListDocuments" });
    
                        /**
                         * Calls ListDocuments.
                         * @function listDocuments
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest} request ListDocumentsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.ListDocumentsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|queryDocument}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef QueryDocumentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} [response] QueryDocumentResponse
                         */
    
                        /**
                         * Calls QueryDocument.
                         * @function queryDocument
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest} request QueryDocumentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.QueryDocumentCallback} callback Node-style callback called with the error, if any, and QueryDocumentResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.queryDocument = function queryDocument(request, callback) {
                            return this.rpcCall(queryDocument, $root.google.ai.generativelanguage.v1alpha.QueryDocumentRequest, $root.google.ai.generativelanguage.v1alpha.QueryDocumentResponse, request, callback);
                        }, "name", { value: "QueryDocument" });
    
                        /**
                         * Calls QueryDocument.
                         * @function queryDocument
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest} request QueryDocumentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.QueryDocumentResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|createChunk}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef CreateChunkCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Chunk} [response] Chunk
                         */
    
                        /**
                         * Calls CreateChunk.
                         * @function createChunk
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest} request CreateChunkRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.CreateChunkCallback} callback Node-style callback called with the error, if any, and Chunk
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.createChunk = function createChunk(request, callback) {
                            return this.rpcCall(createChunk, $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest, $root.google.ai.generativelanguage.v1alpha.Chunk, request, callback);
                        }, "name", { value: "CreateChunk" });
    
                        /**
                         * Calls CreateChunk.
                         * @function createChunk
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest} request CreateChunkRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Chunk>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|batchCreateChunks}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef BatchCreateChunksCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} [response] BatchCreateChunksResponse
                         */
    
                        /**
                         * Calls BatchCreateChunks.
                         * @function batchCreateChunks
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest} request BatchCreateChunksRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.BatchCreateChunksCallback} callback Node-style callback called with the error, if any, and BatchCreateChunksResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.batchCreateChunks = function batchCreateChunks(request, callback) {
                            return this.rpcCall(batchCreateChunks, $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest, $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse, request, callback);
                        }, "name", { value: "BatchCreateChunks" });
    
                        /**
                         * Calls BatchCreateChunks.
                         * @function batchCreateChunks
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest} request BatchCreateChunksRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|getChunk}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef GetChunkCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Chunk} [response] Chunk
                         */
    
                        /**
                         * Calls GetChunk.
                         * @function getChunk
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest} request GetChunkRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.GetChunkCallback} callback Node-style callback called with the error, if any, and Chunk
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.getChunk = function getChunk(request, callback) {
                            return this.rpcCall(getChunk, $root.google.ai.generativelanguage.v1alpha.GetChunkRequest, $root.google.ai.generativelanguage.v1alpha.Chunk, request, callback);
                        }, "name", { value: "GetChunk" });
    
                        /**
                         * Calls GetChunk.
                         * @function getChunk
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest} request GetChunkRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Chunk>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|updateChunk}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef UpdateChunkCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.Chunk} [response] Chunk
                         */
    
                        /**
                         * Calls UpdateChunk.
                         * @function updateChunk
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest} request UpdateChunkRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.UpdateChunkCallback} callback Node-style callback called with the error, if any, and Chunk
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.updateChunk = function updateChunk(request, callback) {
                            return this.rpcCall(updateChunk, $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest, $root.google.ai.generativelanguage.v1alpha.Chunk, request, callback);
                        }, "name", { value: "UpdateChunk" });
    
                        /**
                         * Calls UpdateChunk.
                         * @function updateChunk
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest} request UpdateChunkRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.Chunk>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|batchUpdateChunks}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef BatchUpdateChunksCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} [response] BatchUpdateChunksResponse
                         */
    
                        /**
                         * Calls BatchUpdateChunks.
                         * @function batchUpdateChunks
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest} request BatchUpdateChunksRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.BatchUpdateChunksCallback} callback Node-style callback called with the error, if any, and BatchUpdateChunksResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.batchUpdateChunks = function batchUpdateChunks(request, callback) {
                            return this.rpcCall(batchUpdateChunks, $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest, $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse, request, callback);
                        }, "name", { value: "BatchUpdateChunks" });
    
                        /**
                         * Calls BatchUpdateChunks.
                         * @function batchUpdateChunks
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest} request BatchUpdateChunksRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|deleteChunk}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef DeleteChunkCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteChunk.
                         * @function deleteChunk
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest} request DeleteChunkRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.DeleteChunkCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.deleteChunk = function deleteChunk(request, callback) {
                            return this.rpcCall(deleteChunk, $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteChunk" });
    
                        /**
                         * Calls DeleteChunk.
                         * @function deleteChunk
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest} request DeleteChunkRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|batchDeleteChunks}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef BatchDeleteChunksCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls BatchDeleteChunks.
                         * @function batchDeleteChunks
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest} request BatchDeleteChunksRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.BatchDeleteChunksCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.batchDeleteChunks = function batchDeleteChunks(request, callback) {
                            return this.rpcCall(batchDeleteChunks, $root.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "BatchDeleteChunks" });
    
                        /**
                         * Calls BatchDeleteChunks.
                         * @function batchDeleteChunks
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest} request BatchDeleteChunksRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|listChunks}.
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @typedef ListChunksCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.ListChunksResponse} [response] ListChunksResponse
                         */
    
                        /**
                         * Calls ListChunks.
                         * @function listChunks
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest} request ListChunksRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.RetrieverService.ListChunksCallback} callback Node-style callback called with the error, if any, and ListChunksResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.listChunks = function listChunks(request, callback) {
                            return this.rpcCall(listChunks, $root.google.ai.generativelanguage.v1alpha.ListChunksRequest, $root.google.ai.generativelanguage.v1alpha.ListChunksResponse, request, callback);
                        }, "name", { value: "ListChunks" });
    
                        /**
                         * Calls ListChunks.
                         * @function listChunks
                         * @memberof google.ai.generativelanguage.v1alpha.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest} request ListChunksRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.ListChunksResponse>} Promise
                         * @variation 2
                         */
    
                        return RetrieverService;
                    })();
    
                    v1alpha.CreateCorpusRequest = (function() {
    
                        /**
                         * Properties of a CreateCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICreateCorpusRequest
                         * @property {google.ai.generativelanguage.v1alpha.ICorpus|null} [corpus] CreateCorpusRequest corpus
                         */
    
                        /**
                         * Constructs a new CreateCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CreateCorpusRequest.
                         * @implements ICreateCorpusRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest=} [properties] Properties to set
                         */
                        function CreateCorpusRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateCorpusRequest corpus.
                         * @member {google.ai.generativelanguage.v1alpha.ICorpus|null|undefined} corpus
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest
                         * @instance
                         */
                        CreateCorpusRequest.prototype.corpus = null;
    
                        /**
                         * Creates a new CreateCorpusRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CreateCorpusRequest} CreateCorpusRequest instance
                         */
                        CreateCorpusRequest.create = function create(properties) {
                            return new CreateCorpusRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateCorpusRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest} message CreateCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateCorpusRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.corpus != null && Object.hasOwnProperty.call(message, "corpus"))
                                $root.google.ai.generativelanguage.v1alpha.Corpus.encode(message.corpus, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateCorpusRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest} message CreateCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateCorpusRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CreateCorpusRequest} CreateCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateCorpusRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateCorpusRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateCorpusRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CreateCorpusRequest} CreateCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateCorpusRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateCorpusRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateCorpusRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.corpus != null && message.hasOwnProperty("corpus")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Corpus.verify(message.corpus);
                                if (error)
                                    return "corpus." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateCorpusRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CreateCorpusRequest} CreateCorpusRequest
                         */
                        CreateCorpusRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateCorpusRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CreateCorpusRequest();
                            if (object.corpus != null) {
                                if (typeof object.corpus !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CreateCorpusRequest.corpus: object expected");
                                message.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.fromObject(object.corpus);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateCorpusRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CreateCorpusRequest} message CreateCorpusRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateCorpusRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.corpus = null;
                            if (message.corpus != null && message.hasOwnProperty("corpus"))
                                object.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.toObject(message.corpus, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateCorpusRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateCorpusRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateCorpusRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateCorpusRequest";
                        };
    
                        return CreateCorpusRequest;
                    })();
    
                    v1alpha.GetCorpusRequest = (function() {
    
                        /**
                         * Properties of a GetCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGetCorpusRequest
                         * @property {string|null} [name] GetCorpusRequest name
                         */
    
                        /**
                         * Constructs a new GetCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GetCorpusRequest.
                         * @implements IGetCorpusRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest=} [properties] Properties to set
                         */
                        function GetCorpusRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetCorpusRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest
                         * @instance
                         */
                        GetCorpusRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetCorpusRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GetCorpusRequest} GetCorpusRequest instance
                         */
                        GetCorpusRequest.create = function create(properties) {
                            return new GetCorpusRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetCorpusRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest} message GetCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetCorpusRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetCorpusRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest} message GetCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetCorpusRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GetCorpusRequest} GetCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetCorpusRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetCorpusRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetCorpusRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GetCorpusRequest} GetCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetCorpusRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetCorpusRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetCorpusRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetCorpusRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GetCorpusRequest} GetCorpusRequest
                         */
                        GetCorpusRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetCorpusRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GetCorpusRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetCorpusRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GetCorpusRequest} message GetCorpusRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetCorpusRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetCorpusRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetCorpusRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetCorpusRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetCorpusRequest";
                        };
    
                        return GetCorpusRequest;
                    })();
    
                    v1alpha.UpdateCorpusRequest = (function() {
    
                        /**
                         * Properties of an UpdateCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IUpdateCorpusRequest
                         * @property {google.ai.generativelanguage.v1alpha.ICorpus|null} [corpus] UpdateCorpusRequest corpus
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCorpusRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdateCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an UpdateCorpusRequest.
                         * @implements IUpdateCorpusRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest=} [properties] Properties to set
                         */
                        function UpdateCorpusRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdateCorpusRequest corpus.
                         * @member {google.ai.generativelanguage.v1alpha.ICorpus|null|undefined} corpus
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @instance
                         */
                        UpdateCorpusRequest.prototype.corpus = null;
    
                        /**
                         * UpdateCorpusRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @instance
                         */
                        UpdateCorpusRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdateCorpusRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateCorpusRequest} UpdateCorpusRequest instance
                         */
                        UpdateCorpusRequest.create = function create(properties) {
                            return new UpdateCorpusRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdateCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateCorpusRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest} message UpdateCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateCorpusRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.corpus != null && Object.hasOwnProperty.call(message, "corpus"))
                                $root.google.ai.generativelanguage.v1alpha.Corpus.encode(message.corpus, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdateCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateCorpusRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest} message UpdateCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdateCorpusRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateCorpusRequest} UpdateCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateCorpusRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdateCorpusRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateCorpusRequest} UpdateCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateCorpusRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdateCorpusRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdateCorpusRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.corpus != null && message.hasOwnProperty("corpus")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Corpus.verify(message.corpus);
                                if (error)
                                    return "corpus." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdateCorpusRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateCorpusRequest} UpdateCorpusRequest
                         */
                        UpdateCorpusRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest();
                            if (object.corpus != null) {
                                if (typeof object.corpus !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateCorpusRequest.corpus: object expected");
                                message.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.fromObject(object.corpus);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateCorpusRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdateCorpusRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.UpdateCorpusRequest} message UpdateCorpusRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdateCorpusRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.corpus = null;
                                object.updateMask = null;
                            }
                            if (message.corpus != null && message.hasOwnProperty("corpus"))
                                object.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.toObject(message.corpus, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdateCorpusRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdateCorpusRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdateCorpusRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdateCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdateCorpusRequest";
                        };
    
                        return UpdateCorpusRequest;
                    })();
    
                    v1alpha.DeleteCorpusRequest = (function() {
    
                        /**
                         * Properties of a DeleteCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IDeleteCorpusRequest
                         * @property {string|null} [name] DeleteCorpusRequest name
                         * @property {boolean|null} [force] DeleteCorpusRequest force
                         */
    
                        /**
                         * Constructs a new DeleteCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a DeleteCorpusRequest.
                         * @implements IDeleteCorpusRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest=} [properties] Properties to set
                         */
                        function DeleteCorpusRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteCorpusRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @instance
                         */
                        DeleteCorpusRequest.prototype.name = "";
    
                        /**
                         * DeleteCorpusRequest force.
                         * @member {boolean} force
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @instance
                         */
                        DeleteCorpusRequest.prototype.force = false;
    
                        /**
                         * Creates a new DeleteCorpusRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteCorpusRequest} DeleteCorpusRequest instance
                         */
                        DeleteCorpusRequest.create = function create(properties) {
                            return new DeleteCorpusRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteCorpusRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest} message DeleteCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteCorpusRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.force != null && Object.hasOwnProperty.call(message, "force"))
                                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteCorpusRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest} message DeleteCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteCorpusRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteCorpusRequest} DeleteCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteCorpusRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.force = reader.bool();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteCorpusRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteCorpusRequest} DeleteCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteCorpusRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteCorpusRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteCorpusRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.force != null && message.hasOwnProperty("force"))
                                if (typeof message.force !== "boolean")
                                    return "force: boolean expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteCorpusRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteCorpusRequest} DeleteCorpusRequest
                         */
                        DeleteCorpusRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.force != null)
                                message.force = Boolean(object.force);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteCorpusRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.DeleteCorpusRequest} message DeleteCorpusRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteCorpusRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.force = false;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.force != null && message.hasOwnProperty("force"))
                                object.force = message.force;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteCorpusRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteCorpusRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteCorpusRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteCorpusRequest";
                        };
    
                        return DeleteCorpusRequest;
                    })();
    
                    v1alpha.ListCorporaRequest = (function() {
    
                        /**
                         * Properties of a ListCorporaRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListCorporaRequest
                         * @property {number|null} [pageSize] ListCorporaRequest pageSize
                         * @property {string|null} [pageToken] ListCorporaRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListCorporaRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListCorporaRequest.
                         * @implements IListCorporaRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest=} [properties] Properties to set
                         */
                        function ListCorporaRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListCorporaRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @instance
                         */
                        ListCorporaRequest.prototype.pageSize = 0;
    
                        /**
                         * ListCorporaRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @instance
                         */
                        ListCorporaRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListCorporaRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListCorporaRequest} ListCorporaRequest instance
                         */
                        ListCorporaRequest.create = function create(properties) {
                            return new ListCorporaRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListCorporaRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest} message ListCorporaRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCorporaRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListCorporaRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest} message ListCorporaRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCorporaRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListCorporaRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListCorporaRequest} ListCorporaRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCorporaRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListCorporaRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListCorporaRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListCorporaRequest} ListCorporaRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCorporaRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListCorporaRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListCorporaRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListCorporaRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListCorporaRequest} ListCorporaRequest
                         */
                        ListCorporaRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListCorporaRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListCorporaRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListCorporaRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListCorporaRequest} message ListCorporaRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListCorporaRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListCorporaRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListCorporaRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListCorporaRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListCorporaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListCorporaRequest";
                        };
    
                        return ListCorporaRequest;
                    })();
    
                    v1alpha.ListCorporaResponse = (function() {
    
                        /**
                         * Properties of a ListCorporaResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListCorporaResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ICorpus>|null} [corpora] ListCorporaResponse corpora
                         * @property {string|null} [nextPageToken] ListCorporaResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListCorporaResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListCorporaResponse.
                         * @implements IListCorporaResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListCorporaResponse=} [properties] Properties to set
                         */
                        function ListCorporaResponse(properties) {
                            this.corpora = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListCorporaResponse corpora.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ICorpus>} corpora
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @instance
                         */
                        ListCorporaResponse.prototype.corpora = $util.emptyArray;
    
                        /**
                         * ListCorporaResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @instance
                         */
                        ListCorporaResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListCorporaResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCorporaResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListCorporaResponse} ListCorporaResponse instance
                         */
                        ListCorporaResponse.create = function create(properties) {
                            return new ListCorporaResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListCorporaResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCorporaResponse} message ListCorporaResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCorporaResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.corpora != null && message.corpora.length)
                                for (var i = 0; i < message.corpora.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Corpus.encode(message.corpora[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListCorporaResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListCorporaResponse} message ListCorporaResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCorporaResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListCorporaResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListCorporaResponse} ListCorporaResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCorporaResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListCorporaResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.corpora && message.corpora.length))
                                            message.corpora = [];
                                        message.corpora.push($root.google.ai.generativelanguage.v1alpha.Corpus.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListCorporaResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListCorporaResponse} ListCorporaResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCorporaResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListCorporaResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListCorporaResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.corpora != null && message.hasOwnProperty("corpora")) {
                                if (!Array.isArray(message.corpora))
                                    return "corpora: array expected";
                                for (var i = 0; i < message.corpora.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Corpus.verify(message.corpora[i]);
                                    if (error)
                                        return "corpora." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListCorporaResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListCorporaResponse} ListCorporaResponse
                         */
                        ListCorporaResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListCorporaResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListCorporaResponse();
                            if (object.corpora) {
                                if (!Array.isArray(object.corpora))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.ListCorporaResponse.corpora: array expected");
                                message.corpora = [];
                                for (var i = 0; i < object.corpora.length; ++i) {
                                    if (typeof object.corpora[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.ListCorporaResponse.corpora: object expected");
                                    message.corpora[i] = $root.google.ai.generativelanguage.v1alpha.Corpus.fromObject(object.corpora[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListCorporaResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListCorporaResponse} message ListCorporaResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListCorporaResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.corpora = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.corpora && message.corpora.length) {
                                object.corpora = [];
                                for (var j = 0; j < message.corpora.length; ++j)
                                    object.corpora[j] = $root.google.ai.generativelanguage.v1alpha.Corpus.toObject(message.corpora[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListCorporaResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListCorporaResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListCorporaResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListCorporaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListCorporaResponse";
                        };
    
                        return ListCorporaResponse;
                    })();
    
                    v1alpha.QueryCorpusRequest = (function() {
    
                        /**
                         * Properties of a QueryCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IQueryCorpusRequest
                         * @property {string|null} [name] QueryCorpusRequest name
                         * @property {string|null} [query] QueryCorpusRequest query
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IMetadataFilter>|null} [metadataFilters] QueryCorpusRequest metadataFilters
                         * @property {number|null} [resultsCount] QueryCorpusRequest resultsCount
                         */
    
                        /**
                         * Constructs a new QueryCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a QueryCorpusRequest.
                         * @implements IQueryCorpusRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest=} [properties] Properties to set
                         */
                        function QueryCorpusRequest(properties) {
                            this.metadataFilters = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * QueryCorpusRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @instance
                         */
                        QueryCorpusRequest.prototype.name = "";
    
                        /**
                         * QueryCorpusRequest query.
                         * @member {string} query
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @instance
                         */
                        QueryCorpusRequest.prototype.query = "";
    
                        /**
                         * QueryCorpusRequest metadataFilters.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IMetadataFilter>} metadataFilters
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @instance
                         */
                        QueryCorpusRequest.prototype.metadataFilters = $util.emptyArray;
    
                        /**
                         * QueryCorpusRequest resultsCount.
                         * @member {number} resultsCount
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @instance
                         */
                        QueryCorpusRequest.prototype.resultsCount = 0;
    
                        /**
                         * Creates a new QueryCorpusRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusRequest} QueryCorpusRequest instance
                         */
                        QueryCorpusRequest.create = function create(properties) {
                            return new QueryCorpusRequest(properties);
                        };
    
                        /**
                         * Encodes the specified QueryCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest} message QueryCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryCorpusRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.query != null && Object.hasOwnProperty.call(message, "query"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.query);
                            if (message.metadataFilters != null && message.metadataFilters.length)
                                for (var i = 0; i < message.metadataFilters.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.MetadataFilter.encode(message.metadataFilters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.resultsCount != null && Object.hasOwnProperty.call(message, "resultsCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.resultsCount);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified QueryCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest} message QueryCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a QueryCorpusRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusRequest} QueryCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryCorpusRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.QueryCorpusRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.query = reader.string();
                                        break;
                                    }
                                case 3: {
                                        if (!(message.metadataFilters && message.metadataFilters.length))
                                            message.metadataFilters = [];
                                        message.metadataFilters.push($root.google.ai.generativelanguage.v1alpha.MetadataFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.resultsCount = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a QueryCorpusRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusRequest} QueryCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryCorpusRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a QueryCorpusRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        QueryCorpusRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.query != null && message.hasOwnProperty("query"))
                                if (!$util.isString(message.query))
                                    return "query: string expected";
                            if (message.metadataFilters != null && message.hasOwnProperty("metadataFilters")) {
                                if (!Array.isArray(message.metadataFilters))
                                    return "metadataFilters: array expected";
                                for (var i = 0; i < message.metadataFilters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.verify(message.metadataFilters[i]);
                                    if (error)
                                        return "metadataFilters." + error;
                                }
                            }
                            if (message.resultsCount != null && message.hasOwnProperty("resultsCount"))
                                if (!$util.isInteger(message.resultsCount))
                                    return "resultsCount: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a QueryCorpusRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusRequest} QueryCorpusRequest
                         */
                        QueryCorpusRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.QueryCorpusRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.QueryCorpusRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.query != null)
                                message.query = String(object.query);
                            if (object.metadataFilters) {
                                if (!Array.isArray(object.metadataFilters))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.QueryCorpusRequest.metadataFilters: array expected");
                                message.metadataFilters = [];
                                for (var i = 0; i < object.metadataFilters.length; ++i) {
                                    if (typeof object.metadataFilters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.QueryCorpusRequest.metadataFilters: object expected");
                                    message.metadataFilters[i] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.fromObject(object.metadataFilters[i]);
                                }
                            }
                            if (object.resultsCount != null)
                                message.resultsCount = object.resultsCount | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a QueryCorpusRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.QueryCorpusRequest} message QueryCorpusRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        QueryCorpusRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.metadataFilters = [];
                            if (options.defaults) {
                                object.name = "";
                                object.query = "";
                                object.resultsCount = 0;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.query != null && message.hasOwnProperty("query"))
                                object.query = message.query;
                            if (message.metadataFilters && message.metadataFilters.length) {
                                object.metadataFilters = [];
                                for (var j = 0; j < message.metadataFilters.length; ++j)
                                    object.metadataFilters[j] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.toObject(message.metadataFilters[j], options);
                            }
                            if (message.resultsCount != null && message.hasOwnProperty("resultsCount"))
                                object.resultsCount = message.resultsCount;
                            return object;
                        };
    
                        /**
                         * Converts this QueryCorpusRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        QueryCorpusRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for QueryCorpusRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        QueryCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.QueryCorpusRequest";
                        };
    
                        return QueryCorpusRequest;
                    })();
    
                    v1alpha.QueryCorpusResponse = (function() {
    
                        /**
                         * Properties of a QueryCorpusResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IQueryCorpusResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IRelevantChunk>|null} [relevantChunks] QueryCorpusResponse relevantChunks
                         */
    
                        /**
                         * Constructs a new QueryCorpusResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a QueryCorpusResponse.
                         * @implements IQueryCorpusResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusResponse=} [properties] Properties to set
                         */
                        function QueryCorpusResponse(properties) {
                            this.relevantChunks = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * QueryCorpusResponse relevantChunks.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IRelevantChunk>} relevantChunks
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse
                         * @instance
                         */
                        QueryCorpusResponse.prototype.relevantChunks = $util.emptyArray;
    
                        /**
                         * Creates a new QueryCorpusResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} QueryCorpusResponse instance
                         */
                        QueryCorpusResponse.create = function create(properties) {
                            return new QueryCorpusResponse(properties);
                        };
    
                        /**
                         * Encodes the specified QueryCorpusResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusResponse} message QueryCorpusResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryCorpusResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.relevantChunks != null && message.relevantChunks.length)
                                for (var i = 0; i < message.relevantChunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.RelevantChunk.encode(message.relevantChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified QueryCorpusResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusResponse} message QueryCorpusResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryCorpusResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a QueryCorpusResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} QueryCorpusResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryCorpusResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.QueryCorpusResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.relevantChunks && message.relevantChunks.length))
                                            message.relevantChunks = [];
                                        message.relevantChunks.push($root.google.ai.generativelanguage.v1alpha.RelevantChunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a QueryCorpusResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} QueryCorpusResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryCorpusResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a QueryCorpusResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        QueryCorpusResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.relevantChunks != null && message.hasOwnProperty("relevantChunks")) {
                                if (!Array.isArray(message.relevantChunks))
                                    return "relevantChunks: array expected";
                                for (var i = 0; i < message.relevantChunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.verify(message.relevantChunks[i]);
                                    if (error)
                                        return "relevantChunks." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a QueryCorpusResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} QueryCorpusResponse
                         */
                        QueryCorpusResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.QueryCorpusResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.QueryCorpusResponse();
                            if (object.relevantChunks) {
                                if (!Array.isArray(object.relevantChunks))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.QueryCorpusResponse.relevantChunks: array expected");
                                message.relevantChunks = [];
                                for (var i = 0; i < object.relevantChunks.length; ++i) {
                                    if (typeof object.relevantChunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.QueryCorpusResponse.relevantChunks: object expected");
                                    message.relevantChunks[i] = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.fromObject(object.relevantChunks[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a QueryCorpusResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} message QueryCorpusResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        QueryCorpusResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.relevantChunks = [];
                            if (message.relevantChunks && message.relevantChunks.length) {
                                object.relevantChunks = [];
                                for (var j = 0; j < message.relevantChunks.length; ++j)
                                    object.relevantChunks[j] = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.toObject(message.relevantChunks[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this QueryCorpusResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        QueryCorpusResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for QueryCorpusResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        QueryCorpusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.QueryCorpusResponse";
                        };
    
                        return QueryCorpusResponse;
                    })();
    
                    v1alpha.RelevantChunk = (function() {
    
                        /**
                         * Properties of a RelevantChunk.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IRelevantChunk
                         * @property {number|null} [chunkRelevanceScore] RelevantChunk chunkRelevanceScore
                         * @property {google.ai.generativelanguage.v1alpha.IChunk|null} [chunk] RelevantChunk chunk
                         */
    
                        /**
                         * Constructs a new RelevantChunk.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a RelevantChunk.
                         * @implements IRelevantChunk
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IRelevantChunk=} [properties] Properties to set
                         */
                        function RelevantChunk(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * RelevantChunk chunkRelevanceScore.
                         * @member {number} chunkRelevanceScore
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @instance
                         */
                        RelevantChunk.prototype.chunkRelevanceScore = 0;
    
                        /**
                         * RelevantChunk chunk.
                         * @member {google.ai.generativelanguage.v1alpha.IChunk|null|undefined} chunk
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @instance
                         */
                        RelevantChunk.prototype.chunk = null;
    
                        /**
                         * Creates a new RelevantChunk instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IRelevantChunk=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.RelevantChunk} RelevantChunk instance
                         */
                        RelevantChunk.create = function create(properties) {
                            return new RelevantChunk(properties);
                        };
    
                        /**
                         * Encodes the specified RelevantChunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RelevantChunk.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IRelevantChunk} message RelevantChunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        RelevantChunk.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.chunkRelevanceScore != null && Object.hasOwnProperty.call(message, "chunkRelevanceScore"))
                                writer.uint32(/* id 1, wireType 5 =*/13).float(message.chunkRelevanceScore);
                            if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk"))
                                $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunk, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified RelevantChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RelevantChunk.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IRelevantChunk} message RelevantChunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        RelevantChunk.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a RelevantChunk message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.RelevantChunk} RelevantChunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        RelevantChunk.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.RelevantChunk();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.chunkRelevanceScore = reader.float();
                                        break;
                                    }
                                case 2: {
                                        message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a RelevantChunk message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.RelevantChunk} RelevantChunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        RelevantChunk.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a RelevantChunk message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        RelevantChunk.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.chunkRelevanceScore != null && message.hasOwnProperty("chunkRelevanceScore"))
                                if (typeof message.chunkRelevanceScore !== "number")
                                    return "chunkRelevanceScore: number expected";
                            if (message.chunk != null && message.hasOwnProperty("chunk")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunk);
                                if (error)
                                    return "chunk." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a RelevantChunk message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.RelevantChunk} RelevantChunk
                         */
                        RelevantChunk.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.RelevantChunk)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.RelevantChunk();
                            if (object.chunkRelevanceScore != null)
                                message.chunkRelevanceScore = Number(object.chunkRelevanceScore);
                            if (object.chunk != null) {
                                if (typeof object.chunk !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.RelevantChunk.chunk: object expected");
                                message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunk);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a RelevantChunk message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.RelevantChunk} message RelevantChunk
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        RelevantChunk.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.chunkRelevanceScore = 0;
                                object.chunk = null;
                            }
                            if (message.chunkRelevanceScore != null && message.hasOwnProperty("chunkRelevanceScore"))
                                object.chunkRelevanceScore = options.json && !isFinite(message.chunkRelevanceScore) ? String(message.chunkRelevanceScore) : message.chunkRelevanceScore;
                            if (message.chunk != null && message.hasOwnProperty("chunk"))
                                object.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunk, options);
                            return object;
                        };
    
                        /**
                         * Converts this RelevantChunk to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        RelevantChunk.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for RelevantChunk
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        RelevantChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.RelevantChunk";
                        };
    
                        return RelevantChunk;
                    })();
    
                    v1alpha.CreateDocumentRequest = (function() {
    
                        /**
                         * Properties of a CreateDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICreateDocumentRequest
                         * @property {string|null} [parent] CreateDocumentRequest parent
                         * @property {google.ai.generativelanguage.v1alpha.IDocument|null} [document] CreateDocumentRequest document
                         */
    
                        /**
                         * Constructs a new CreateDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CreateDocumentRequest.
                         * @implements ICreateDocumentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest=} [properties] Properties to set
                         */
                        function CreateDocumentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateDocumentRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @instance
                         */
                        CreateDocumentRequest.prototype.parent = "";
    
                        /**
                         * CreateDocumentRequest document.
                         * @member {google.ai.generativelanguage.v1alpha.IDocument|null|undefined} document
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @instance
                         */
                        CreateDocumentRequest.prototype.document = null;
    
                        /**
                         * Creates a new CreateDocumentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CreateDocumentRequest} CreateDocumentRequest instance
                         */
                        CreateDocumentRequest.create = function create(properties) {
                            return new CreateDocumentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateDocumentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateDocumentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.document != null && Object.hasOwnProperty.call(message, "document"))
                                $root.google.ai.generativelanguage.v1alpha.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateDocumentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateDocumentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CreateDocumentRequest} CreateDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateDocumentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateDocumentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.document = $root.google.ai.generativelanguage.v1alpha.Document.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CreateDocumentRequest} CreateDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateDocumentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateDocumentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateDocumentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.document != null && message.hasOwnProperty("document")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Document.verify(message.document);
                                if (error)
                                    return "document." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CreateDocumentRequest} CreateDocumentRequest
                         */
                        CreateDocumentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateDocumentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CreateDocumentRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.document != null) {
                                if (typeof object.document !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CreateDocumentRequest.document: object expected");
                                message.document = $root.google.ai.generativelanguage.v1alpha.Document.fromObject(object.document);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CreateDocumentRequest} message CreateDocumentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateDocumentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.document = null;
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.document != null && message.hasOwnProperty("document"))
                                object.document = $root.google.ai.generativelanguage.v1alpha.Document.toObject(message.document, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateDocumentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateDocumentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateDocumentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateDocumentRequest";
                        };
    
                        return CreateDocumentRequest;
                    })();
    
                    v1alpha.GetDocumentRequest = (function() {
    
                        /**
                         * Properties of a GetDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGetDocumentRequest
                         * @property {string|null} [name] GetDocumentRequest name
                         */
    
                        /**
                         * Constructs a new GetDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GetDocumentRequest.
                         * @implements IGetDocumentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest=} [properties] Properties to set
                         */
                        function GetDocumentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetDocumentRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest
                         * @instance
                         */
                        GetDocumentRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetDocumentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GetDocumentRequest} GetDocumentRequest instance
                         */
                        GetDocumentRequest.create = function create(properties) {
                            return new GetDocumentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetDocumentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetDocumentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetDocumentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetDocumentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GetDocumentRequest} GetDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetDocumentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetDocumentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GetDocumentRequest} GetDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetDocumentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetDocumentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetDocumentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GetDocumentRequest} GetDocumentRequest
                         */
                        GetDocumentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetDocumentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GetDocumentRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GetDocumentRequest} message GetDocumentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetDocumentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetDocumentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetDocumentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetDocumentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetDocumentRequest";
                        };
    
                        return GetDocumentRequest;
                    })();
    
                    v1alpha.UpdateDocumentRequest = (function() {
    
                        /**
                         * Properties of an UpdateDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IUpdateDocumentRequest
                         * @property {google.ai.generativelanguage.v1alpha.IDocument|null} [document] UpdateDocumentRequest document
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDocumentRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdateDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an UpdateDocumentRequest.
                         * @implements IUpdateDocumentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest=} [properties] Properties to set
                         */
                        function UpdateDocumentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdateDocumentRequest document.
                         * @member {google.ai.generativelanguage.v1alpha.IDocument|null|undefined} document
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @instance
                         */
                        UpdateDocumentRequest.prototype.document = null;
    
                        /**
                         * UpdateDocumentRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @instance
                         */
                        UpdateDocumentRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdateDocumentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateDocumentRequest} UpdateDocumentRequest instance
                         */
                        UpdateDocumentRequest.create = function create(properties) {
                            return new UpdateDocumentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateDocumentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateDocumentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.document != null && Object.hasOwnProperty.call(message, "document"))
                                $root.google.ai.generativelanguage.v1alpha.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateDocumentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdateDocumentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateDocumentRequest} UpdateDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateDocumentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.document = $root.google.ai.generativelanguage.v1alpha.Document.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateDocumentRequest} UpdateDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateDocumentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdateDocumentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdateDocumentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.document != null && message.hasOwnProperty("document")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Document.verify(message.document);
                                if (error)
                                    return "document." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateDocumentRequest} UpdateDocumentRequest
                         */
                        UpdateDocumentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest();
                            if (object.document != null) {
                                if (typeof object.document !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateDocumentRequest.document: object expected");
                                message.document = $root.google.ai.generativelanguage.v1alpha.Document.fromObject(object.document);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateDocumentRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.UpdateDocumentRequest} message UpdateDocumentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdateDocumentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.document = null;
                                object.updateMask = null;
                            }
                            if (message.document != null && message.hasOwnProperty("document"))
                                object.document = $root.google.ai.generativelanguage.v1alpha.Document.toObject(message.document, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdateDocumentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdateDocumentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdateDocumentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdateDocumentRequest";
                        };
    
                        return UpdateDocumentRequest;
                    })();
    
                    v1alpha.DeleteDocumentRequest = (function() {
    
                        /**
                         * Properties of a DeleteDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IDeleteDocumentRequest
                         * @property {string|null} [name] DeleteDocumentRequest name
                         * @property {boolean|null} [force] DeleteDocumentRequest force
                         */
    
                        /**
                         * Constructs a new DeleteDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a DeleteDocumentRequest.
                         * @implements IDeleteDocumentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest=} [properties] Properties to set
                         */
                        function DeleteDocumentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteDocumentRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @instance
                         */
                        DeleteDocumentRequest.prototype.name = "";
    
                        /**
                         * DeleteDocumentRequest force.
                         * @member {boolean} force
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @instance
                         */
                        DeleteDocumentRequest.prototype.force = false;
    
                        /**
                         * Creates a new DeleteDocumentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteDocumentRequest} DeleteDocumentRequest instance
                         */
                        DeleteDocumentRequest.create = function create(properties) {
                            return new DeleteDocumentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteDocumentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteDocumentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.force != null && Object.hasOwnProperty.call(message, "force"))
                                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteDocumentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteDocumentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteDocumentRequest} DeleteDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteDocumentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.force = reader.bool();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteDocumentRequest} DeleteDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteDocumentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteDocumentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteDocumentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.force != null && message.hasOwnProperty("force"))
                                if (typeof message.force !== "boolean")
                                    return "force: boolean expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteDocumentRequest} DeleteDocumentRequest
                         */
                        DeleteDocumentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.force != null)
                                message.force = Boolean(object.force);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.DeleteDocumentRequest} message DeleteDocumentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteDocumentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.force = false;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.force != null && message.hasOwnProperty("force"))
                                object.force = message.force;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteDocumentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteDocumentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteDocumentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteDocumentRequest";
                        };
    
                        return DeleteDocumentRequest;
                    })();
    
                    v1alpha.ListDocumentsRequest = (function() {
    
                        /**
                         * Properties of a ListDocumentsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListDocumentsRequest
                         * @property {string|null} [parent] ListDocumentsRequest parent
                         * @property {number|null} [pageSize] ListDocumentsRequest pageSize
                         * @property {string|null} [pageToken] ListDocumentsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListDocumentsRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListDocumentsRequest.
                         * @implements IListDocumentsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest=} [properties] Properties to set
                         */
                        function ListDocumentsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListDocumentsRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @instance
                         */
                        ListDocumentsRequest.prototype.parent = "";
    
                        /**
                         * ListDocumentsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @instance
                         */
                        ListDocumentsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListDocumentsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @instance
                         */
                        ListDocumentsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListDocumentsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsRequest} ListDocumentsRequest instance
                         */
                        ListDocumentsRequest.create = function create(properties) {
                            return new ListDocumentsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListDocumentsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListDocumentsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsRequest} ListDocumentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListDocumentsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListDocumentsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsRequest} ListDocumentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListDocumentsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListDocumentsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListDocumentsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsRequest} ListDocumentsRequest
                         */
                        ListDocumentsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListDocumentsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListDocumentsRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListDocumentsRequest} message ListDocumentsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListDocumentsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListDocumentsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListDocumentsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListDocumentsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListDocumentsRequest";
                        };
    
                        return ListDocumentsRequest;
                    })();
    
                    v1alpha.ListDocumentsResponse = (function() {
    
                        /**
                         * Properties of a ListDocumentsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListDocumentsResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IDocument>|null} [documents] ListDocumentsResponse documents
                         * @property {string|null} [nextPageToken] ListDocumentsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListDocumentsResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListDocumentsResponse.
                         * @implements IListDocumentsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListDocumentsResponse=} [properties] Properties to set
                         */
                        function ListDocumentsResponse(properties) {
                            this.documents = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListDocumentsResponse documents.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IDocument>} documents
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @instance
                         */
                        ListDocumentsResponse.prototype.documents = $util.emptyArray;
    
                        /**
                         * ListDocumentsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @instance
                         */
                        ListDocumentsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListDocumentsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListDocumentsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} ListDocumentsResponse instance
                         */
                        ListDocumentsResponse.create = function create(properties) {
                            return new ListDocumentsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListDocumentsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.documents != null && message.documents.length)
                                for (var i = 0; i < message.documents.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListDocumentsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} ListDocumentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListDocumentsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListDocumentsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.documents && message.documents.length))
                                            message.documents = [];
                                        message.documents.push($root.google.ai.generativelanguage.v1alpha.Document.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} ListDocumentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListDocumentsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListDocumentsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListDocumentsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.documents != null && message.hasOwnProperty("documents")) {
                                if (!Array.isArray(message.documents))
                                    return "documents: array expected";
                                for (var i = 0; i < message.documents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Document.verify(message.documents[i]);
                                    if (error)
                                        return "documents." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} ListDocumentsResponse
                         */
                        ListDocumentsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListDocumentsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListDocumentsResponse();
                            if (object.documents) {
                                if (!Array.isArray(object.documents))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.ListDocumentsResponse.documents: array expected");
                                message.documents = [];
                                for (var i = 0; i < object.documents.length; ++i) {
                                    if (typeof object.documents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.ListDocumentsResponse.documents: object expected");
                                    message.documents[i] = $root.google.ai.generativelanguage.v1alpha.Document.fromObject(object.documents[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} message ListDocumentsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListDocumentsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.documents = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.documents && message.documents.length) {
                                object.documents = [];
                                for (var j = 0; j < message.documents.length; ++j)
                                    object.documents[j] = $root.google.ai.generativelanguage.v1alpha.Document.toObject(message.documents[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListDocumentsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListDocumentsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListDocumentsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListDocumentsResponse";
                        };
    
                        return ListDocumentsResponse;
                    })();
    
                    v1alpha.QueryDocumentRequest = (function() {
    
                        /**
                         * Properties of a QueryDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IQueryDocumentRequest
                         * @property {string|null} [name] QueryDocumentRequest name
                         * @property {string|null} [query] QueryDocumentRequest query
                         * @property {number|null} [resultsCount] QueryDocumentRequest resultsCount
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IMetadataFilter>|null} [metadataFilters] QueryDocumentRequest metadataFilters
                         */
    
                        /**
                         * Constructs a new QueryDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a QueryDocumentRequest.
                         * @implements IQueryDocumentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest=} [properties] Properties to set
                         */
                        function QueryDocumentRequest(properties) {
                            this.metadataFilters = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * QueryDocumentRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @instance
                         */
                        QueryDocumentRequest.prototype.name = "";
    
                        /**
                         * QueryDocumentRequest query.
                         * @member {string} query
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @instance
                         */
                        QueryDocumentRequest.prototype.query = "";
    
                        /**
                         * QueryDocumentRequest resultsCount.
                         * @member {number} resultsCount
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @instance
                         */
                        QueryDocumentRequest.prototype.resultsCount = 0;
    
                        /**
                         * QueryDocumentRequest metadataFilters.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IMetadataFilter>} metadataFilters
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @instance
                         */
                        QueryDocumentRequest.prototype.metadataFilters = $util.emptyArray;
    
                        /**
                         * Creates a new QueryDocumentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentRequest} QueryDocumentRequest instance
                         */
                        QueryDocumentRequest.create = function create(properties) {
                            return new QueryDocumentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified QueryDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest} message QueryDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryDocumentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.query != null && Object.hasOwnProperty.call(message, "query"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.query);
                            if (message.resultsCount != null && Object.hasOwnProperty.call(message, "resultsCount"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.resultsCount);
                            if (message.metadataFilters != null && message.metadataFilters.length)
                                for (var i = 0; i < message.metadataFilters.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.MetadataFilter.encode(message.metadataFilters[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified QueryDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest} message QueryDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a QueryDocumentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentRequest} QueryDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryDocumentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.QueryDocumentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.query = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.resultsCount = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        if (!(message.metadataFilters && message.metadataFilters.length))
                                            message.metadataFilters = [];
                                        message.metadataFilters.push($root.google.ai.generativelanguage.v1alpha.MetadataFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a QueryDocumentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentRequest} QueryDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryDocumentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a QueryDocumentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        QueryDocumentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.query != null && message.hasOwnProperty("query"))
                                if (!$util.isString(message.query))
                                    return "query: string expected";
                            if (message.resultsCount != null && message.hasOwnProperty("resultsCount"))
                                if (!$util.isInteger(message.resultsCount))
                                    return "resultsCount: integer expected";
                            if (message.metadataFilters != null && message.hasOwnProperty("metadataFilters")) {
                                if (!Array.isArray(message.metadataFilters))
                                    return "metadataFilters: array expected";
                                for (var i = 0; i < message.metadataFilters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.verify(message.metadataFilters[i]);
                                    if (error)
                                        return "metadataFilters." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a QueryDocumentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentRequest} QueryDocumentRequest
                         */
                        QueryDocumentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.QueryDocumentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.QueryDocumentRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.query != null)
                                message.query = String(object.query);
                            if (object.resultsCount != null)
                                message.resultsCount = object.resultsCount | 0;
                            if (object.metadataFilters) {
                                if (!Array.isArray(object.metadataFilters))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.QueryDocumentRequest.metadataFilters: array expected");
                                message.metadataFilters = [];
                                for (var i = 0; i < object.metadataFilters.length; ++i) {
                                    if (typeof object.metadataFilters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.QueryDocumentRequest.metadataFilters: object expected");
                                    message.metadataFilters[i] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.fromObject(object.metadataFilters[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a QueryDocumentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.QueryDocumentRequest} message QueryDocumentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        QueryDocumentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.metadataFilters = [];
                            if (options.defaults) {
                                object.name = "";
                                object.query = "";
                                object.resultsCount = 0;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.query != null && message.hasOwnProperty("query"))
                                object.query = message.query;
                            if (message.resultsCount != null && message.hasOwnProperty("resultsCount"))
                                object.resultsCount = message.resultsCount;
                            if (message.metadataFilters && message.metadataFilters.length) {
                                object.metadataFilters = [];
                                for (var j = 0; j < message.metadataFilters.length; ++j)
                                    object.metadataFilters[j] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.toObject(message.metadataFilters[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this QueryDocumentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        QueryDocumentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for QueryDocumentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        QueryDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.QueryDocumentRequest";
                        };
    
                        return QueryDocumentRequest;
                    })();
    
                    v1alpha.QueryDocumentResponse = (function() {
    
                        /**
                         * Properties of a QueryDocumentResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IQueryDocumentResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IRelevantChunk>|null} [relevantChunks] QueryDocumentResponse relevantChunks
                         */
    
                        /**
                         * Constructs a new QueryDocumentResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a QueryDocumentResponse.
                         * @implements IQueryDocumentResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentResponse=} [properties] Properties to set
                         */
                        function QueryDocumentResponse(properties) {
                            this.relevantChunks = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * QueryDocumentResponse relevantChunks.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IRelevantChunk>} relevantChunks
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse
                         * @instance
                         */
                        QueryDocumentResponse.prototype.relevantChunks = $util.emptyArray;
    
                        /**
                         * Creates a new QueryDocumentResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} QueryDocumentResponse instance
                         */
                        QueryDocumentResponse.create = function create(properties) {
                            return new QueryDocumentResponse(properties);
                        };
    
                        /**
                         * Encodes the specified QueryDocumentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentResponse} message QueryDocumentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryDocumentResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.relevantChunks != null && message.relevantChunks.length)
                                for (var i = 0; i < message.relevantChunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.RelevantChunk.encode(message.relevantChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified QueryDocumentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentResponse} message QueryDocumentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a QueryDocumentResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} QueryDocumentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryDocumentResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.QueryDocumentResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.relevantChunks && message.relevantChunks.length))
                                            message.relevantChunks = [];
                                        message.relevantChunks.push($root.google.ai.generativelanguage.v1alpha.RelevantChunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a QueryDocumentResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} QueryDocumentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryDocumentResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a QueryDocumentResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        QueryDocumentResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.relevantChunks != null && message.hasOwnProperty("relevantChunks")) {
                                if (!Array.isArray(message.relevantChunks))
                                    return "relevantChunks: array expected";
                                for (var i = 0; i < message.relevantChunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.verify(message.relevantChunks[i]);
                                    if (error)
                                        return "relevantChunks." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a QueryDocumentResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} QueryDocumentResponse
                         */
                        QueryDocumentResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.QueryDocumentResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.QueryDocumentResponse();
                            if (object.relevantChunks) {
                                if (!Array.isArray(object.relevantChunks))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.QueryDocumentResponse.relevantChunks: array expected");
                                message.relevantChunks = [];
                                for (var i = 0; i < object.relevantChunks.length; ++i) {
                                    if (typeof object.relevantChunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.QueryDocumentResponse.relevantChunks: object expected");
                                    message.relevantChunks[i] = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.fromObject(object.relevantChunks[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a QueryDocumentResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} message QueryDocumentResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        QueryDocumentResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.relevantChunks = [];
                            if (message.relevantChunks && message.relevantChunks.length) {
                                object.relevantChunks = [];
                                for (var j = 0; j < message.relevantChunks.length; ++j)
                                    object.relevantChunks[j] = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.toObject(message.relevantChunks[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this QueryDocumentResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        QueryDocumentResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for QueryDocumentResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        QueryDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.QueryDocumentResponse";
                        };
    
                        return QueryDocumentResponse;
                    })();
    
                    v1alpha.CreateChunkRequest = (function() {
    
                        /**
                         * Properties of a CreateChunkRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICreateChunkRequest
                         * @property {string|null} [parent] CreateChunkRequest parent
                         * @property {google.ai.generativelanguage.v1alpha.IChunk|null} [chunk] CreateChunkRequest chunk
                         */
    
                        /**
                         * Constructs a new CreateChunkRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CreateChunkRequest.
                         * @implements ICreateChunkRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest=} [properties] Properties to set
                         */
                        function CreateChunkRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateChunkRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @instance
                         */
                        CreateChunkRequest.prototype.parent = "";
    
                        /**
                         * CreateChunkRequest chunk.
                         * @member {google.ai.generativelanguage.v1alpha.IChunk|null|undefined} chunk
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @instance
                         */
                        CreateChunkRequest.prototype.chunk = null;
    
                        /**
                         * Creates a new CreateChunkRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CreateChunkRequest} CreateChunkRequest instance
                         */
                        CreateChunkRequest.create = function create(properties) {
                            return new CreateChunkRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateChunkRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest} message CreateChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateChunkRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk"))
                                $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunk, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateChunkRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest} message CreateChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateChunkRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateChunkRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CreateChunkRequest} CreateChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateChunkRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateChunkRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CreateChunkRequest} CreateChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateChunkRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateChunkRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateChunkRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.chunk != null && message.hasOwnProperty("chunk")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunk);
                                if (error)
                                    return "chunk." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateChunkRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CreateChunkRequest} CreateChunkRequest
                         */
                        CreateChunkRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.chunk != null) {
                                if (typeof object.chunk !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CreateChunkRequest.chunk: object expected");
                                message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunk);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateChunkRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CreateChunkRequest} message CreateChunkRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateChunkRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.chunk = null;
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.chunk != null && message.hasOwnProperty("chunk"))
                                object.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunk, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateChunkRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateChunkRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateChunkRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateChunkRequest";
                        };
    
                        return CreateChunkRequest;
                    })();
    
                    v1alpha.BatchCreateChunksRequest = (function() {
    
                        /**
                         * Properties of a BatchCreateChunksRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBatchCreateChunksRequest
                         * @property {string|null} [parent] BatchCreateChunksRequest parent
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ICreateChunkRequest>|null} [requests] BatchCreateChunksRequest requests
                         */
    
                        /**
                         * Constructs a new BatchCreateChunksRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BatchCreateChunksRequest.
                         * @implements IBatchCreateChunksRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest=} [properties] Properties to set
                         */
                        function BatchCreateChunksRequest(properties) {
                            this.requests = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchCreateChunksRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @instance
                         */
                        BatchCreateChunksRequest.prototype.parent = "";
    
                        /**
                         * BatchCreateChunksRequest requests.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ICreateChunkRequest>} requests
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @instance
                         */
                        BatchCreateChunksRequest.prototype.requests = $util.emptyArray;
    
                        /**
                         * Creates a new BatchCreateChunksRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest} BatchCreateChunksRequest instance
                         */
                        BatchCreateChunksRequest.create = function create(properties) {
                            return new BatchCreateChunksRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchCreateChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest} message BatchCreateChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchCreateChunksRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.requests != null && message.requests.length)
                                for (var i = 0; i < message.requests.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchCreateChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest} message BatchCreateChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchCreateChunksRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchCreateChunksRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest} BatchCreateChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchCreateChunksRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.requests && message.requests.length))
                                            message.requests = [];
                                        message.requests.push($root.google.ai.generativelanguage.v1alpha.CreateChunkRequest.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchCreateChunksRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest} BatchCreateChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchCreateChunksRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchCreateChunksRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchCreateChunksRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.requests != null && message.hasOwnProperty("requests")) {
                                if (!Array.isArray(message.requests))
                                    return "requests: array expected";
                                for (var i = 0; i < message.requests.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest.verify(message.requests[i]);
                                    if (error)
                                        return "requests." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchCreateChunksRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest} BatchCreateChunksRequest
                         */
                        BatchCreateChunksRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.requests) {
                                if (!Array.isArray(object.requests))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest.requests: array expected");
                                message.requests = [];
                                for (var i = 0; i < object.requests.length; ++i) {
                                    if (typeof object.requests[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest.requests: object expected");
                                    message.requests[i] = $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest.fromObject(object.requests[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchCreateChunksRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest} message BatchCreateChunksRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchCreateChunksRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.requests = [];
                            if (options.defaults)
                                object.parent = "";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.requests && message.requests.length) {
                                object.requests = [];
                                for (var j = 0; j < message.requests.length; ++j)
                                    object.requests[j] = $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest.toObject(message.requests[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchCreateChunksRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchCreateChunksRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchCreateChunksRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchCreateChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest";
                        };
    
                        return BatchCreateChunksRequest;
                    })();
    
                    v1alpha.BatchCreateChunksResponse = (function() {
    
                        /**
                         * Properties of a BatchCreateChunksResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBatchCreateChunksResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IChunk>|null} [chunks] BatchCreateChunksResponse chunks
                         */
    
                        /**
                         * Constructs a new BatchCreateChunksResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BatchCreateChunksResponse.
                         * @implements IBatchCreateChunksResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse=} [properties] Properties to set
                         */
                        function BatchCreateChunksResponse(properties) {
                            this.chunks = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchCreateChunksResponse chunks.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IChunk>} chunks
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse
                         * @instance
                         */
                        BatchCreateChunksResponse.prototype.chunks = $util.emptyArray;
    
                        /**
                         * Creates a new BatchCreateChunksResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} BatchCreateChunksResponse instance
                         */
                        BatchCreateChunksResponse.create = function create(properties) {
                            return new BatchCreateChunksResponse(properties);
                        };
    
                        /**
                         * Encodes the specified BatchCreateChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse} message BatchCreateChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchCreateChunksResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.chunks != null && message.chunks.length)
                                for (var i = 0; i < message.chunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchCreateChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse} message BatchCreateChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchCreateChunksResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchCreateChunksResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} BatchCreateChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchCreateChunksResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.chunks && message.chunks.length))
                                            message.chunks = [];
                                        message.chunks.push($root.google.ai.generativelanguage.v1alpha.Chunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchCreateChunksResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} BatchCreateChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchCreateChunksResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchCreateChunksResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchCreateChunksResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.chunks != null && message.hasOwnProperty("chunks")) {
                                if (!Array.isArray(message.chunks))
                                    return "chunks: array expected";
                                for (var i = 0; i < message.chunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunks[i]);
                                    if (error)
                                        return "chunks." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchCreateChunksResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} BatchCreateChunksResponse
                         */
                        BatchCreateChunksResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse();
                            if (object.chunks) {
                                if (!Array.isArray(object.chunks))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse.chunks: array expected");
                                message.chunks = [];
                                for (var i = 0; i < object.chunks.length; ++i) {
                                    if (typeof object.chunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse.chunks: object expected");
                                    message.chunks[i] = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunks[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchCreateChunksResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} message BatchCreateChunksResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchCreateChunksResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.chunks = [];
                            if (message.chunks && message.chunks.length) {
                                object.chunks = [];
                                for (var j = 0; j < message.chunks.length; ++j)
                                    object.chunks[j] = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunks[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchCreateChunksResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchCreateChunksResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchCreateChunksResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchCreateChunksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse";
                        };
    
                        return BatchCreateChunksResponse;
                    })();
    
                    v1alpha.GetChunkRequest = (function() {
    
                        /**
                         * Properties of a GetChunkRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGetChunkRequest
                         * @property {string|null} [name] GetChunkRequest name
                         */
    
                        /**
                         * Constructs a new GetChunkRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GetChunkRequest.
                         * @implements IGetChunkRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest=} [properties] Properties to set
                         */
                        function GetChunkRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetChunkRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest
                         * @instance
                         */
                        GetChunkRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetChunkRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GetChunkRequest} GetChunkRequest instance
                         */
                        GetChunkRequest.create = function create(properties) {
                            return new GetChunkRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetChunkRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest} message GetChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetChunkRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetChunkRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest} message GetChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetChunkRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetChunkRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GetChunkRequest} GetChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetChunkRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetChunkRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetChunkRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GetChunkRequest} GetChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetChunkRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetChunkRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetChunkRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetChunkRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GetChunkRequest} GetChunkRequest
                         */
                        GetChunkRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetChunkRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GetChunkRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetChunkRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GetChunkRequest} message GetChunkRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetChunkRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetChunkRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetChunkRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetChunkRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetChunkRequest";
                        };
    
                        return GetChunkRequest;
                    })();
    
                    v1alpha.UpdateChunkRequest = (function() {
    
                        /**
                         * Properties of an UpdateChunkRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IUpdateChunkRequest
                         * @property {google.ai.generativelanguage.v1alpha.IChunk|null} [chunk] UpdateChunkRequest chunk
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateChunkRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdateChunkRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an UpdateChunkRequest.
                         * @implements IUpdateChunkRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest=} [properties] Properties to set
                         */
                        function UpdateChunkRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdateChunkRequest chunk.
                         * @member {google.ai.generativelanguage.v1alpha.IChunk|null|undefined} chunk
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @instance
                         */
                        UpdateChunkRequest.prototype.chunk = null;
    
                        /**
                         * UpdateChunkRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @instance
                         */
                        UpdateChunkRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdateChunkRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateChunkRequest} UpdateChunkRequest instance
                         */
                        UpdateChunkRequest.create = function create(properties) {
                            return new UpdateChunkRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdateChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateChunkRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest} message UpdateChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateChunkRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk"))
                                $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunk, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdateChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateChunkRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest} message UpdateChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateChunkRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdateChunkRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateChunkRequest} UpdateChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateChunkRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdateChunkRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateChunkRequest} UpdateChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateChunkRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdateChunkRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdateChunkRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.chunk != null && message.hasOwnProperty("chunk")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunk);
                                if (error)
                                    return "chunk." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdateChunkRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.UpdateChunkRequest} UpdateChunkRequest
                         */
                        UpdateChunkRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest();
                            if (object.chunk != null) {
                                if (typeof object.chunk !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateChunkRequest.chunk: object expected");
                                message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunk);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateChunkRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdateChunkRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.UpdateChunkRequest} message UpdateChunkRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdateChunkRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.chunk = null;
                                object.updateMask = null;
                            }
                            if (message.chunk != null && message.hasOwnProperty("chunk"))
                                object.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunk, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdateChunkRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdateChunkRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdateChunkRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdateChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdateChunkRequest";
                        };
    
                        return UpdateChunkRequest;
                    })();
    
                    v1alpha.BatchUpdateChunksRequest = (function() {
    
                        /**
                         * Properties of a BatchUpdateChunksRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBatchUpdateChunksRequest
                         * @property {string|null} [parent] BatchUpdateChunksRequest parent
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IUpdateChunkRequest>|null} [requests] BatchUpdateChunksRequest requests
                         */
    
                        /**
                         * Constructs a new BatchUpdateChunksRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BatchUpdateChunksRequest.
                         * @implements IBatchUpdateChunksRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest=} [properties] Properties to set
                         */
                        function BatchUpdateChunksRequest(properties) {
                            this.requests = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchUpdateChunksRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @instance
                         */
                        BatchUpdateChunksRequest.prototype.parent = "";
    
                        /**
                         * BatchUpdateChunksRequest requests.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IUpdateChunkRequest>} requests
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @instance
                         */
                        BatchUpdateChunksRequest.prototype.requests = $util.emptyArray;
    
                        /**
                         * Creates a new BatchUpdateChunksRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest} BatchUpdateChunksRequest instance
                         */
                        BatchUpdateChunksRequest.create = function create(properties) {
                            return new BatchUpdateChunksRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchUpdateChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest} message BatchUpdateChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchUpdateChunksRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.requests != null && message.requests.length)
                                for (var i = 0; i < message.requests.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchUpdateChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest} message BatchUpdateChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchUpdateChunksRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchUpdateChunksRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest} BatchUpdateChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchUpdateChunksRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.requests && message.requests.length))
                                            message.requests = [];
                                        message.requests.push($root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchUpdateChunksRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest} BatchUpdateChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchUpdateChunksRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchUpdateChunksRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchUpdateChunksRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.requests != null && message.hasOwnProperty("requests")) {
                                if (!Array.isArray(message.requests))
                                    return "requests: array expected";
                                for (var i = 0; i < message.requests.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest.verify(message.requests[i]);
                                    if (error)
                                        return "requests." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchUpdateChunksRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest} BatchUpdateChunksRequest
                         */
                        BatchUpdateChunksRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.requests) {
                                if (!Array.isArray(object.requests))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest.requests: array expected");
                                message.requests = [];
                                for (var i = 0; i < object.requests.length; ++i) {
                                    if (typeof object.requests[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest.requests: object expected");
                                    message.requests[i] = $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest.fromObject(object.requests[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchUpdateChunksRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest} message BatchUpdateChunksRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchUpdateChunksRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.requests = [];
                            if (options.defaults)
                                object.parent = "";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.requests && message.requests.length) {
                                object.requests = [];
                                for (var j = 0; j < message.requests.length; ++j)
                                    object.requests[j] = $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest.toObject(message.requests[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchUpdateChunksRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchUpdateChunksRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchUpdateChunksRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchUpdateChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest";
                        };
    
                        return BatchUpdateChunksRequest;
                    })();
    
                    v1alpha.BatchUpdateChunksResponse = (function() {
    
                        /**
                         * Properties of a BatchUpdateChunksResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBatchUpdateChunksResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IChunk>|null} [chunks] BatchUpdateChunksResponse chunks
                         */
    
                        /**
                         * Constructs a new BatchUpdateChunksResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BatchUpdateChunksResponse.
                         * @implements IBatchUpdateChunksResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse=} [properties] Properties to set
                         */
                        function BatchUpdateChunksResponse(properties) {
                            this.chunks = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchUpdateChunksResponse chunks.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IChunk>} chunks
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse
                         * @instance
                         */
                        BatchUpdateChunksResponse.prototype.chunks = $util.emptyArray;
    
                        /**
                         * Creates a new BatchUpdateChunksResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} BatchUpdateChunksResponse instance
                         */
                        BatchUpdateChunksResponse.create = function create(properties) {
                            return new BatchUpdateChunksResponse(properties);
                        };
    
                        /**
                         * Encodes the specified BatchUpdateChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse} message BatchUpdateChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchUpdateChunksResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.chunks != null && message.chunks.length)
                                for (var i = 0; i < message.chunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchUpdateChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse} message BatchUpdateChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchUpdateChunksResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchUpdateChunksResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} BatchUpdateChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchUpdateChunksResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.chunks && message.chunks.length))
                                            message.chunks = [];
                                        message.chunks.push($root.google.ai.generativelanguage.v1alpha.Chunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchUpdateChunksResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} BatchUpdateChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchUpdateChunksResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchUpdateChunksResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchUpdateChunksResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.chunks != null && message.hasOwnProperty("chunks")) {
                                if (!Array.isArray(message.chunks))
                                    return "chunks: array expected";
                                for (var i = 0; i < message.chunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunks[i]);
                                    if (error)
                                        return "chunks." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchUpdateChunksResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} BatchUpdateChunksResponse
                         */
                        BatchUpdateChunksResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse();
                            if (object.chunks) {
                                if (!Array.isArray(object.chunks))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse.chunks: array expected");
                                message.chunks = [];
                                for (var i = 0; i < object.chunks.length; ++i) {
                                    if (typeof object.chunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse.chunks: object expected");
                                    message.chunks[i] = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunks[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchUpdateChunksResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} message BatchUpdateChunksResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchUpdateChunksResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.chunks = [];
                            if (message.chunks && message.chunks.length) {
                                object.chunks = [];
                                for (var j = 0; j < message.chunks.length; ++j)
                                    object.chunks[j] = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunks[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchUpdateChunksResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchUpdateChunksResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchUpdateChunksResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchUpdateChunksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse";
                        };
    
                        return BatchUpdateChunksResponse;
                    })();
    
                    v1alpha.DeleteChunkRequest = (function() {
    
                        /**
                         * Properties of a DeleteChunkRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IDeleteChunkRequest
                         * @property {string|null} [name] DeleteChunkRequest name
                         */
    
                        /**
                         * Constructs a new DeleteChunkRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a DeleteChunkRequest.
                         * @implements IDeleteChunkRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest=} [properties] Properties to set
                         */
                        function DeleteChunkRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteChunkRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest
                         * @instance
                         */
                        DeleteChunkRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeleteChunkRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteChunkRequest} DeleteChunkRequest instance
                         */
                        DeleteChunkRequest.create = function create(properties) {
                            return new DeleteChunkRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteChunkRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest} message DeleteChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteChunkRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteChunkRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest} message DeleteChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteChunkRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteChunkRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteChunkRequest} DeleteChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteChunkRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteChunkRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteChunkRequest} DeleteChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteChunkRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteChunkRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteChunkRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteChunkRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.DeleteChunkRequest} DeleteChunkRequest
                         */
                        DeleteChunkRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteChunkRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.DeleteChunkRequest} message DeleteChunkRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteChunkRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteChunkRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteChunkRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteChunkRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteChunkRequest";
                        };
    
                        return DeleteChunkRequest;
                    })();
    
                    v1alpha.BatchDeleteChunksRequest = (function() {
    
                        /**
                         * Properties of a BatchDeleteChunksRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBatchDeleteChunksRequest
                         * @property {string|null} [parent] BatchDeleteChunksRequest parent
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IDeleteChunkRequest>|null} [requests] BatchDeleteChunksRequest requests
                         */
    
                        /**
                         * Constructs a new BatchDeleteChunksRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BatchDeleteChunksRequest.
                         * @implements IBatchDeleteChunksRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest=} [properties] Properties to set
                         */
                        function BatchDeleteChunksRequest(properties) {
                            this.requests = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchDeleteChunksRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @instance
                         */
                        BatchDeleteChunksRequest.prototype.parent = "";
    
                        /**
                         * BatchDeleteChunksRequest requests.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IDeleteChunkRequest>} requests
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @instance
                         */
                        BatchDeleteChunksRequest.prototype.requests = $util.emptyArray;
    
                        /**
                         * Creates a new BatchDeleteChunksRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest} BatchDeleteChunksRequest instance
                         */
                        BatchDeleteChunksRequest.create = function create(properties) {
                            return new BatchDeleteChunksRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchDeleteChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest} message BatchDeleteChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchDeleteChunksRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.requests != null && message.requests.length)
                                for (var i = 0; i < message.requests.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchDeleteChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest} message BatchDeleteChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchDeleteChunksRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchDeleteChunksRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest} BatchDeleteChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchDeleteChunksRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.requests && message.requests.length))
                                            message.requests = [];
                                        message.requests.push($root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchDeleteChunksRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest} BatchDeleteChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchDeleteChunksRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchDeleteChunksRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchDeleteChunksRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.requests != null && message.hasOwnProperty("requests")) {
                                if (!Array.isArray(message.requests))
                                    return "requests: array expected";
                                for (var i = 0; i < message.requests.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest.verify(message.requests[i]);
                                    if (error)
                                        return "requests." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchDeleteChunksRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest} BatchDeleteChunksRequest
                         */
                        BatchDeleteChunksRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.requests) {
                                if (!Array.isArray(object.requests))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest.requests: array expected");
                                message.requests = [];
                                for (var i = 0; i < object.requests.length; ++i) {
                                    if (typeof object.requests[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest.requests: object expected");
                                    message.requests[i] = $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest.fromObject(object.requests[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchDeleteChunksRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest} message BatchDeleteChunksRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchDeleteChunksRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.requests = [];
                            if (options.defaults)
                                object.parent = "";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.requests && message.requests.length) {
                                object.requests = [];
                                for (var j = 0; j < message.requests.length; ++j)
                                    object.requests[j] = $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest.toObject(message.requests[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchDeleteChunksRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchDeleteChunksRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchDeleteChunksRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchDeleteChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest";
                        };
    
                        return BatchDeleteChunksRequest;
                    })();
    
                    v1alpha.ListChunksRequest = (function() {
    
                        /**
                         * Properties of a ListChunksRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListChunksRequest
                         * @property {string|null} [parent] ListChunksRequest parent
                         * @property {number|null} [pageSize] ListChunksRequest pageSize
                         * @property {string|null} [pageToken] ListChunksRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListChunksRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListChunksRequest.
                         * @implements IListChunksRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest=} [properties] Properties to set
                         */
                        function ListChunksRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListChunksRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @instance
                         */
                        ListChunksRequest.prototype.parent = "";
    
                        /**
                         * ListChunksRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @instance
                         */
                        ListChunksRequest.prototype.pageSize = 0;
    
                        /**
                         * ListChunksRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @instance
                         */
                        ListChunksRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListChunksRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListChunksRequest} ListChunksRequest instance
                         */
                        ListChunksRequest.create = function create(properties) {
                            return new ListChunksRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest} message ListChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListChunksRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest} message ListChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListChunksRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListChunksRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListChunksRequest} ListChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListChunksRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListChunksRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListChunksRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListChunksRequest} ListChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListChunksRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListChunksRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListChunksRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListChunksRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListChunksRequest} ListChunksRequest
                         */
                        ListChunksRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListChunksRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListChunksRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListChunksRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListChunksRequest} message ListChunksRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListChunksRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListChunksRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListChunksRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListChunksRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListChunksRequest";
                        };
    
                        return ListChunksRequest;
                    })();
    
                    v1alpha.ListChunksResponse = (function() {
    
                        /**
                         * Properties of a ListChunksResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IListChunksResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IChunk>|null} [chunks] ListChunksResponse chunks
                         * @property {string|null} [nextPageToken] ListChunksResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListChunksResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a ListChunksResponse.
                         * @implements IListChunksResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IListChunksResponse=} [properties] Properties to set
                         */
                        function ListChunksResponse(properties) {
                            this.chunks = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListChunksResponse chunks.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IChunk>} chunks
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @instance
                         */
                        ListChunksResponse.prototype.chunks = $util.emptyArray;
    
                        /**
                         * ListChunksResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @instance
                         */
                        ListChunksResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListChunksResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListChunksResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.ListChunksResponse} ListChunksResponse instance
                         */
                        ListChunksResponse.create = function create(properties) {
                            return new ListChunksResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListChunksResponse} message ListChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListChunksResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.chunks != null && message.chunks.length)
                                for (var i = 0; i < message.chunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IListChunksResponse} message ListChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListChunksResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListChunksResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.ListChunksResponse} ListChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListChunksResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListChunksResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.chunks && message.chunks.length))
                                            message.chunks = [];
                                        message.chunks.push($root.google.ai.generativelanguage.v1alpha.Chunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListChunksResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.ListChunksResponse} ListChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListChunksResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListChunksResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListChunksResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.chunks != null && message.hasOwnProperty("chunks")) {
                                if (!Array.isArray(message.chunks))
                                    return "chunks: array expected";
                                for (var i = 0; i < message.chunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunks[i]);
                                    if (error)
                                        return "chunks." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListChunksResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.ListChunksResponse} ListChunksResponse
                         */
                        ListChunksResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListChunksResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.ListChunksResponse();
                            if (object.chunks) {
                                if (!Array.isArray(object.chunks))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.ListChunksResponse.chunks: array expected");
                                message.chunks = [];
                                for (var i = 0; i < object.chunks.length; ++i) {
                                    if (typeof object.chunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.ListChunksResponse.chunks: object expected");
                                    message.chunks[i] = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunks[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListChunksResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ListChunksResponse} message ListChunksResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListChunksResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.chunks = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.chunks && message.chunks.length) {
                                object.chunks = [];
                                for (var j = 0; j < message.chunks.length; ++j)
                                    object.chunks[j] = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunks[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListChunksResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListChunksResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListChunksResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListChunksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListChunksResponse";
                        };
    
                        return ListChunksResponse;
                    })();
    
                    v1alpha.TextService = (function() {
    
                        /**
                         * Constructs a new TextService service.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TextService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function TextService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (TextService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TextService;
    
                        /**
                         * Creates new TextService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {TextService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        TextService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|generateText}.
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @typedef GenerateTextCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.GenerateTextResponse} [response] GenerateTextResponse
                         */
    
                        /**
                         * Calls GenerateText.
                         * @function generateText
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest} request GenerateTextRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.TextService.GenerateTextCallback} callback Node-style callback called with the error, if any, and GenerateTextResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.generateText = function generateText(request, callback) {
                            return this.rpcCall(generateText, $root.google.ai.generativelanguage.v1alpha.GenerateTextRequest, $root.google.ai.generativelanguage.v1alpha.GenerateTextResponse, request, callback);
                        }, "name", { value: "GenerateText" });
    
                        /**
                         * Calls GenerateText.
                         * @function generateText
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest} request GenerateTextRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.GenerateTextResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|embedText}.
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @typedef EmbedTextCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.EmbedTextResponse} [response] EmbedTextResponse
                         */
    
                        /**
                         * Calls EmbedText.
                         * @function embedText
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest} request EmbedTextRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.TextService.EmbedTextCallback} callback Node-style callback called with the error, if any, and EmbedTextResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.embedText = function embedText(request, callback) {
                            return this.rpcCall(embedText, $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest, $root.google.ai.generativelanguage.v1alpha.EmbedTextResponse, request, callback);
                        }, "name", { value: "EmbedText" });
    
                        /**
                         * Calls EmbedText.
                         * @function embedText
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest} request EmbedTextRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.EmbedTextResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|batchEmbedText}.
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @typedef BatchEmbedTextCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} [response] BatchEmbedTextResponse
                         */
    
                        /**
                         * Calls BatchEmbedText.
                         * @function batchEmbedText
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest} request BatchEmbedTextRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.TextService.BatchEmbedTextCallback} callback Node-style callback called with the error, if any, and BatchEmbedTextResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.batchEmbedText = function batchEmbedText(request, callback) {
                            return this.rpcCall(batchEmbedText, $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest, $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse, request, callback);
                        }, "name", { value: "BatchEmbedText" });
    
                        /**
                         * Calls BatchEmbedText.
                         * @function batchEmbedText
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest} request BatchEmbedTextRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|countTextTokens}.
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @typedef CountTextTokensCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} [response] CountTextTokensResponse
                         */
    
                        /**
                         * Calls CountTextTokens.
                         * @function countTextTokens
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest} request CountTextTokensRequest message or plain object
                         * @param {google.ai.generativelanguage.v1alpha.TextService.CountTextTokensCallback} callback Node-style callback called with the error, if any, and CountTextTokensResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.countTextTokens = function countTextTokens(request, callback) {
                            return this.rpcCall(countTextTokens, $root.google.ai.generativelanguage.v1alpha.CountTextTokensRequest, $root.google.ai.generativelanguage.v1alpha.CountTextTokensResponse, request, callback);
                        }, "name", { value: "CountTextTokens" });
    
                        /**
                         * Calls CountTextTokens.
                         * @function countTextTokens
                         * @memberof google.ai.generativelanguage.v1alpha.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest} request CountTextTokensRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1alpha.CountTextTokensResponse>} Promise
                         * @variation 2
                         */
    
                        return TextService;
                    })();
    
                    v1alpha.GenerateTextRequest = (function() {
    
                        /**
                         * Properties of a GenerateTextRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGenerateTextRequest
                         * @property {string|null} [model] GenerateTextRequest model
                         * @property {google.ai.generativelanguage.v1alpha.ITextPrompt|null} [prompt] GenerateTextRequest prompt
                         * @property {number|null} [temperature] GenerateTextRequest temperature
                         * @property {number|null} [candidateCount] GenerateTextRequest candidateCount
                         * @property {number|null} [maxOutputTokens] GenerateTextRequest maxOutputTokens
                         * @property {number|null} [topP] GenerateTextRequest topP
                         * @property {number|null} [topK] GenerateTextRequest topK
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ISafetySetting>|null} [safetySettings] GenerateTextRequest safetySettings
                         * @property {Array.<string>|null} [stopSequences] GenerateTextRequest stopSequences
                         */
    
                        /**
                         * Constructs a new GenerateTextRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GenerateTextRequest.
                         * @implements IGenerateTextRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest=} [properties] Properties to set
                         */
                        function GenerateTextRequest(properties) {
                            this.safetySettings = [];
                            this.stopSequences = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateTextRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.model = "";
    
                        /**
                         * GenerateTextRequest prompt.
                         * @member {google.ai.generativelanguage.v1alpha.ITextPrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.prompt = null;
    
                        /**
                         * GenerateTextRequest temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.temperature = null;
    
                        /**
                         * GenerateTextRequest candidateCount.
                         * @member {number|null|undefined} candidateCount
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.candidateCount = null;
    
                        /**
                         * GenerateTextRequest maxOutputTokens.
                         * @member {number|null|undefined} maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.maxOutputTokens = null;
    
                        /**
                         * GenerateTextRequest topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.topP = null;
    
                        /**
                         * GenerateTextRequest topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.topK = null;
    
                        /**
                         * GenerateTextRequest safetySettings.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ISafetySetting>} safetySettings
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.safetySettings = $util.emptyArray;
    
                        /**
                         * GenerateTextRequest stopSequences.
                         * @member {Array.<string>} stopSequences
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.stopSequences = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateTextRequest _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _candidateCount.
                         * @member {"candidateCount"|undefined} _candidateCount
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_candidateCount", {
                            get: $util.oneOfGetter($oneOfFields = ["candidateCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _maxOutputTokens.
                         * @member {"maxOutputTokens"|undefined} _maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_maxOutputTokens", {
                            get: $util.oneOfGetter($oneOfFields = ["maxOutputTokens"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateTextRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateTextRequest} GenerateTextRequest instance
                         */
                        GenerateTextRequest.create = function create(properties) {
                            return new GenerateTextRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1alpha.TextPrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature);
                            if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount);
                            if (message.maxOutputTokens != null && Object.hasOwnProperty.call(message, "maxOutputTokens"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxOutputTokens);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 6, wireType 5 =*/53).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.topK);
                            if (message.safetySettings != null && message.safetySettings.length)
                                for (var i = 0; i < message.safetySettings.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.stopSequences != null && message.stopSequences.length)
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    writer.uint32(/* id 9, wireType 2 =*/74).string(message.stopSequences[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateTextRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateTextRequest} GenerateTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateTextRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 4: {
                                        message.candidateCount = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.maxOutputTokens = reader.int32();
                                        break;
                                    }
                                case 6: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 7: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        if (!(message.safetySettings && message.safetySettings.length))
                                            message.safetySettings = [];
                                        message.safetySettings.push($root.google.ai.generativelanguage.v1alpha.SafetySetting.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 9: {
                                        if (!(message.stopSequences && message.stopSequences.length))
                                            message.stopSequences = [];
                                        message.stopSequences.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateTextRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateTextRequest} GenerateTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateTextRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateTextRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.TextPrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                properties._candidateCount = 1;
                                if (!$util.isInteger(message.candidateCount))
                                    return "candidateCount: integer expected";
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                properties._maxOutputTokens = 1;
                                if (!$util.isInteger(message.maxOutputTokens))
                                    return "maxOutputTokens: integer expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) {
                                if (!Array.isArray(message.safetySettings))
                                    return "safetySettings: array expected";
                                for (var i = 0; i < message.safetySettings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.SafetySetting.verify(message.safetySettings[i]);
                                    if (error)
                                        return "safetySettings." + error;
                                }
                            }
                            if (message.stopSequences != null && message.hasOwnProperty("stopSequences")) {
                                if (!Array.isArray(message.stopSequences))
                                    return "stopSequences: array expected";
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    if (!$util.isString(message.stopSequences[i]))
                                        return "stopSequences: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateTextRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateTextRequest} GenerateTextRequest
                         */
                        GenerateTextRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateTextRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GenerateTextRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.fromObject(object.prompt);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.candidateCount != null)
                                message.candidateCount = object.candidateCount | 0;
                            if (object.maxOutputTokens != null)
                                message.maxOutputTokens = object.maxOutputTokens | 0;
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            if (object.safetySettings) {
                                if (!Array.isArray(object.safetySettings))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextRequest.safetySettings: array expected");
                                message.safetySettings = [];
                                for (var i = 0; i < object.safetySettings.length; ++i) {
                                    if (typeof object.safetySettings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextRequest.safetySettings: object expected");
                                    message.safetySettings[i] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.fromObject(object.safetySettings[i]);
                                }
                            }
                            if (object.stopSequences) {
                                if (!Array.isArray(object.stopSequences))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextRequest.stopSequences: array expected");
                                message.stopSequences = [];
                                for (var i = 0; i < object.stopSequences.length; ++i)
                                    message.stopSequences[i] = String(object.stopSequences[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateTextRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GenerateTextRequest} message GenerateTextRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateTextRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.safetySettings = [];
                                object.stopSequences = [];
                            }
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.toObject(message.prompt, options);
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                object.candidateCount = message.candidateCount;
                                if (options.oneofs)
                                    object._candidateCount = "candidateCount";
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                object.maxOutputTokens = message.maxOutputTokens;
                                if (options.oneofs)
                                    object._maxOutputTokens = "maxOutputTokens";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.safetySettings && message.safetySettings.length) {
                                object.safetySettings = [];
                                for (var j = 0; j < message.safetySettings.length; ++j)
                                    object.safetySettings[j] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.toObject(message.safetySettings[j], options);
                            }
                            if (message.stopSequences && message.stopSequences.length) {
                                object.stopSequences = [];
                                for (var j = 0; j < message.stopSequences.length; ++j)
                                    object.stopSequences[j] = message.stopSequences[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateTextRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateTextRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateTextRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateTextRequest";
                        };
    
                        return GenerateTextRequest;
                    })();
    
                    v1alpha.GenerateTextResponse = (function() {
    
                        /**
                         * Properties of a GenerateTextResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IGenerateTextResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ITextCompletion>|null} [candidates] GenerateTextResponse candidates
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IContentFilter>|null} [filters] GenerateTextResponse filters
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ISafetyFeedback>|null} [safetyFeedback] GenerateTextResponse safetyFeedback
                         */
    
                        /**
                         * Constructs a new GenerateTextResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a GenerateTextResponse.
                         * @implements IGenerateTextResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateTextResponse=} [properties] Properties to set
                         */
                        function GenerateTextResponse(properties) {
                            this.candidates = [];
                            this.filters = [];
                            this.safetyFeedback = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateTextResponse candidates.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ITextCompletion>} candidates
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.candidates = $util.emptyArray;
    
                        /**
                         * GenerateTextResponse filters.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IContentFilter>} filters
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.filters = $util.emptyArray;
    
                        /**
                         * GenerateTextResponse safetyFeedback.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ISafetyFeedback>} safetyFeedback
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.safetyFeedback = $util.emptyArray;
    
                        /**
                         * Creates a new GenerateTextResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateTextResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateTextResponse} GenerateTextResponse instance
                         */
                        GenerateTextResponse.create = function create(properties) {
                            return new GenerateTextResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidates != null && message.candidates.length)
                                for (var i = 0; i < message.candidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.TextCompletion.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.filters != null && message.filters.length)
                                for (var i = 0; i < message.filters.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.safetyFeedback != null && message.safetyFeedback.length)
                                for (var i = 0; i < message.safetyFeedback.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.SafetyFeedback.encode(message.safetyFeedback[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateTextResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateTextResponse} GenerateTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateTextResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.candidates && message.candidates.length))
                                            message.candidates = [];
                                        message.candidates.push($root.google.ai.generativelanguage.v1alpha.TextCompletion.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.filters && message.filters.length))
                                            message.filters = [];
                                        message.filters.push($root.google.ai.generativelanguage.v1alpha.ContentFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        if (!(message.safetyFeedback && message.safetyFeedback.length))
                                            message.safetyFeedback = [];
                                        message.safetyFeedback.push($root.google.ai.generativelanguage.v1alpha.SafetyFeedback.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateTextResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateTextResponse} GenerateTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateTextResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateTextResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                if (!Array.isArray(message.candidates))
                                    return "candidates: array expected";
                                for (var i = 0; i < message.candidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.TextCompletion.verify(message.candidates[i]);
                                    if (error)
                                        return "candidates." + error;
                                }
                            }
                            if (message.filters != null && message.hasOwnProperty("filters")) {
                                if (!Array.isArray(message.filters))
                                    return "filters: array expected";
                                for (var i = 0; i < message.filters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.ContentFilter.verify(message.filters[i]);
                                    if (error)
                                        return "filters." + error;
                                }
                            }
                            if (message.safetyFeedback != null && message.hasOwnProperty("safetyFeedback")) {
                                if (!Array.isArray(message.safetyFeedback))
                                    return "safetyFeedback: array expected";
                                for (var i = 0; i < message.safetyFeedback.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.SafetyFeedback.verify(message.safetyFeedback[i]);
                                    if (error)
                                        return "safetyFeedback." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateTextResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.GenerateTextResponse} GenerateTextResponse
                         */
                        GenerateTextResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateTextResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.GenerateTextResponse();
                            if (object.candidates) {
                                if (!Array.isArray(object.candidates))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.candidates: array expected");
                                message.candidates = [];
                                for (var i = 0; i < object.candidates.length; ++i) {
                                    if (typeof object.candidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.candidates: object expected");
                                    message.candidates[i] = $root.google.ai.generativelanguage.v1alpha.TextCompletion.fromObject(object.candidates[i]);
                                }
                            }
                            if (object.filters) {
                                if (!Array.isArray(object.filters))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.filters: array expected");
                                message.filters = [];
                                for (var i = 0; i < object.filters.length; ++i) {
                                    if (typeof object.filters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.filters: object expected");
                                    message.filters[i] = $root.google.ai.generativelanguage.v1alpha.ContentFilter.fromObject(object.filters[i]);
                                }
                            }
                            if (object.safetyFeedback) {
                                if (!Array.isArray(object.safetyFeedback))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.safetyFeedback: array expected");
                                message.safetyFeedback = [];
                                for (var i = 0; i < object.safetyFeedback.length; ++i) {
                                    if (typeof object.safetyFeedback[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.safetyFeedback: object expected");
                                    message.safetyFeedback[i] = $root.google.ai.generativelanguage.v1alpha.SafetyFeedback.fromObject(object.safetyFeedback[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateTextResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.GenerateTextResponse} message GenerateTextResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateTextResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.candidates = [];
                                object.filters = [];
                                object.safetyFeedback = [];
                            }
                            if (message.candidates && message.candidates.length) {
                                object.candidates = [];
                                for (var j = 0; j < message.candidates.length; ++j)
                                    object.candidates[j] = $root.google.ai.generativelanguage.v1alpha.TextCompletion.toObject(message.candidates[j], options);
                            }
                            if (message.filters && message.filters.length) {
                                object.filters = [];
                                for (var j = 0; j < message.filters.length; ++j)
                                    object.filters[j] = $root.google.ai.generativelanguage.v1alpha.ContentFilter.toObject(message.filters[j], options);
                            }
                            if (message.safetyFeedback && message.safetyFeedback.length) {
                                object.safetyFeedback = [];
                                for (var j = 0; j < message.safetyFeedback.length; ++j)
                                    object.safetyFeedback[j] = $root.google.ai.generativelanguage.v1alpha.SafetyFeedback.toObject(message.safetyFeedback[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateTextResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateTextResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateTextResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateTextResponse";
                        };
    
                        return GenerateTextResponse;
                    })();
    
                    v1alpha.TextPrompt = (function() {
    
                        /**
                         * Properties of a TextPrompt.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITextPrompt
                         * @property {string|null} [text] TextPrompt text
                         */
    
                        /**
                         * Constructs a new TextPrompt.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TextPrompt.
                         * @implements ITextPrompt
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITextPrompt=} [properties] Properties to set
                         */
                        function TextPrompt(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TextPrompt text.
                         * @member {string} text
                         * @memberof google.ai.generativelanguage.v1alpha.TextPrompt
                         * @instance
                         */
                        TextPrompt.prototype.text = "";
    
                        /**
                         * Creates a new TextPrompt instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITextPrompt=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TextPrompt} TextPrompt instance
                         */
                        TextPrompt.create = function create(properties) {
                            return new TextPrompt(properties);
                        };
    
                        /**
                         * Encodes the specified TextPrompt message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextPrompt.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITextPrompt} message TextPrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextPrompt.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TextPrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextPrompt.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITextPrompt} message TextPrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextPrompt.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TextPrompt message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TextPrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TextPrompt} TextPrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextPrompt.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TextPrompt();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TextPrompt message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TextPrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TextPrompt} TextPrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextPrompt.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TextPrompt message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TextPrompt
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TextPrompt.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.text != null && message.hasOwnProperty("text"))
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TextPrompt message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TextPrompt
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TextPrompt} TextPrompt
                         */
                        TextPrompt.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TextPrompt)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TextPrompt();
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TextPrompt message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TextPrompt} message TextPrompt
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TextPrompt.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.text = "";
                            if (message.text != null && message.hasOwnProperty("text"))
                                object.text = message.text;
                            return object;
                        };
    
                        /**
                         * Converts this TextPrompt to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TextPrompt
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TextPrompt.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TextPrompt
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TextPrompt
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TextPrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TextPrompt";
                        };
    
                        return TextPrompt;
                    })();
    
                    v1alpha.TextCompletion = (function() {
    
                        /**
                         * Properties of a TextCompletion.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ITextCompletion
                         * @property {string|null} [output] TextCompletion output
                         * @property {Array.<google.ai.generativelanguage.v1alpha.ISafetyRating>|null} [safetyRatings] TextCompletion safetyRatings
                         * @property {google.ai.generativelanguage.v1alpha.ICitationMetadata|null} [citationMetadata] TextCompletion citationMetadata
                         */
    
                        /**
                         * Constructs a new TextCompletion.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a TextCompletion.
                         * @implements ITextCompletion
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ITextCompletion=} [properties] Properties to set
                         */
                        function TextCompletion(properties) {
                            this.safetyRatings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TextCompletion output.
                         * @member {string} output
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.output = "";
    
                        /**
                         * TextCompletion safetyRatings.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.ISafetyRating>} safetyRatings
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.safetyRatings = $util.emptyArray;
    
                        /**
                         * TextCompletion citationMetadata.
                         * @member {google.ai.generativelanguage.v1alpha.ICitationMetadata|null|undefined} citationMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.citationMetadata = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TextCompletion _citationMetadata.
                         * @member {"citationMetadata"|undefined} _citationMetadata
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @instance
                         */
                        Object.defineProperty(TextCompletion.prototype, "_citationMetadata", {
                            get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TextCompletion instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITextCompletion=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.TextCompletion} TextCompletion instance
                         */
                        TextCompletion.create = function create(properties) {
                            return new TextCompletion(properties);
                        };
    
                        /**
                         * Encodes the specified TextCompletion message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextCompletion.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITextCompletion} message TextCompletion message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextCompletion.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.output);
                            if (message.safetyRatings != null && message.safetyRatings.length)
                                for (var i = 0; i < message.safetyRatings.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata"))
                                $root.google.ai.generativelanguage.v1alpha.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TextCompletion message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextCompletion.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ITextCompletion} message TextCompletion message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextCompletion.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TextCompletion message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.TextCompletion} TextCompletion
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextCompletion.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TextCompletion();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.output = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.safetyRatings && message.safetyRatings.length))
                                            message.safetyRatings = [];
                                        message.safetyRatings.push($root.google.ai.generativelanguage.v1alpha.SafetyRating.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TextCompletion message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.TextCompletion} TextCompletion
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextCompletion.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TextCompletion message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TextCompletion.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.output != null && message.hasOwnProperty("output"))
                                if (!$util.isString(message.output))
                                    return "output: string expected";
                            if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                if (!Array.isArray(message.safetyRatings))
                                    return "safetyRatings: array expected";
                                for (var i = 0; i < message.safetyRatings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.SafetyRating.verify(message.safetyRatings[i]);
                                    if (error)
                                        return "safetyRatings." + error;
                                }
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                properties._citationMetadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.verify(message.citationMetadata);
                                    if (error)
                                        return "citationMetadata." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TextCompletion message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.TextCompletion} TextCompletion
                         */
                        TextCompletion.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.TextCompletion)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.TextCompletion();
                            if (object.output != null)
                                message.output = String(object.output);
                            if (object.safetyRatings) {
                                if (!Array.isArray(object.safetyRatings))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TextCompletion.safetyRatings: array expected");
                                message.safetyRatings = [];
                                for (var i = 0; i < object.safetyRatings.length; ++i) {
                                    if (typeof object.safetyRatings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.TextCompletion.safetyRatings: object expected");
                                    message.safetyRatings[i] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.fromObject(object.safetyRatings[i]);
                                }
                            }
                            if (object.citationMetadata != null) {
                                if (typeof object.citationMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.TextCompletion.citationMetadata: object expected");
                                message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.fromObject(object.citationMetadata);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TextCompletion message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.TextCompletion} message TextCompletion
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TextCompletion.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.safetyRatings = [];
                            if (options.defaults)
                                object.output = "";
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = message.output;
                            if (message.safetyRatings && message.safetyRatings.length) {
                                object.safetyRatings = [];
                                for (var j = 0; j < message.safetyRatings.length; ++j)
                                    object.safetyRatings[j] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.toObject(message.safetyRatings[j], options);
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                object.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.toObject(message.citationMetadata, options);
                                if (options.oneofs)
                                    object._citationMetadata = "citationMetadata";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TextCompletion to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TextCompletion.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TextCompletion
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.TextCompletion
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TextCompletion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TextCompletion";
                        };
    
                        return TextCompletion;
                    })();
    
                    v1alpha.EmbedTextRequest = (function() {
    
                        /**
                         * Properties of an EmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IEmbedTextRequest
                         * @property {string|null} [model] EmbedTextRequest model
                         * @property {string|null} [text] EmbedTextRequest text
                         */
    
                        /**
                         * Constructs a new EmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an EmbedTextRequest.
                         * @implements IEmbedTextRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest=} [properties] Properties to set
                         */
                        function EmbedTextRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedTextRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @instance
                         */
                        EmbedTextRequest.prototype.model = "";
    
                        /**
                         * EmbedTextRequest text.
                         * @member {string} text
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @instance
                         */
                        EmbedTextRequest.prototype.text = "";
    
                        /**
                         * Creates a new EmbedTextRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedTextRequest} EmbedTextRequest instance
                         */
                        EmbedTextRequest.create = function create(properties) {
                            return new EmbedTextRequest(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedTextRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedTextRequest} EmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedTextRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedTextRequest} EmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedTextRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedTextRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.text != null && message.hasOwnProperty("text"))
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            return null;
                        };
    
                        /**
                         * Creates an EmbedTextRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedTextRequest} EmbedTextRequest
                         */
                        EmbedTextRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedTextRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.EmbedTextRequest} message EmbedTextRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedTextRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.text = "";
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.text != null && message.hasOwnProperty("text"))
                                object.text = message.text;
                            return object;
                        };
    
                        /**
                         * Converts this EmbedTextRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedTextRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedTextRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.EmbedTextRequest";
                        };
    
                        return EmbedTextRequest;
                    })();
    
                    v1alpha.EmbedTextResponse = (function() {
    
                        /**
                         * Properties of an EmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IEmbedTextResponse
                         * @property {google.ai.generativelanguage.v1alpha.IEmbedding|null} [embedding] EmbedTextResponse embedding
                         */
    
                        /**
                         * Constructs a new EmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an EmbedTextResponse.
                         * @implements IEmbedTextResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedTextResponse=} [properties] Properties to set
                         */
                        function EmbedTextResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedTextResponse embedding.
                         * @member {google.ai.generativelanguage.v1alpha.IEmbedding|null|undefined} embedding
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @instance
                         */
                        EmbedTextResponse.prototype.embedding = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * EmbedTextResponse _embedding.
                         * @member {"embedding"|undefined} _embedding
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @instance
                         */
                        Object.defineProperty(EmbedTextResponse.prototype, "_embedding", {
                            get: $util.oneOfGetter($oneOfFields = ["embedding"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new EmbedTextResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedTextResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedTextResponse} EmbedTextResponse instance
                         */
                        EmbedTextResponse.create = function create(properties) {
                            return new EmbedTextResponse(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embedding != null && Object.hasOwnProperty.call(message, "embedding"))
                                $root.google.ai.generativelanguage.v1alpha.Embedding.encode(message.embedding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedTextResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedTextResponse} EmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.EmbedTextResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.embedding = $root.google.ai.generativelanguage.v1alpha.Embedding.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedTextResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedTextResponse} EmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedTextResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedTextResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.embedding != null && message.hasOwnProperty("embedding")) {
                                properties._embedding = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Embedding.verify(message.embedding);
                                    if (error)
                                        return "embedding." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates an EmbedTextResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.EmbedTextResponse} EmbedTextResponse
                         */
                        EmbedTextResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.EmbedTextResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.EmbedTextResponse();
                            if (object.embedding != null) {
                                if (typeof object.embedding !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.EmbedTextResponse.embedding: object expected");
                                message.embedding = $root.google.ai.generativelanguage.v1alpha.Embedding.fromObject(object.embedding);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedTextResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.EmbedTextResponse} message EmbedTextResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedTextResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.embedding != null && message.hasOwnProperty("embedding")) {
                                object.embedding = $root.google.ai.generativelanguage.v1alpha.Embedding.toObject(message.embedding, options);
                                if (options.oneofs)
                                    object._embedding = "embedding";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this EmbedTextResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedTextResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedTextResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.EmbedTextResponse";
                        };
    
                        return EmbedTextResponse;
                    })();
    
                    v1alpha.BatchEmbedTextRequest = (function() {
    
                        /**
                         * Properties of a BatchEmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBatchEmbedTextRequest
                         * @property {string|null} [model] BatchEmbedTextRequest model
                         * @property {Array.<string>|null} [texts] BatchEmbedTextRequest texts
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IEmbedTextRequest>|null} [requests] BatchEmbedTextRequest requests
                         */
    
                        /**
                         * Constructs a new BatchEmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BatchEmbedTextRequest.
                         * @implements IBatchEmbedTextRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest=} [properties] Properties to set
                         */
                        function BatchEmbedTextRequest(properties) {
                            this.texts = [];
                            this.requests = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedTextRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @instance
                         */
                        BatchEmbedTextRequest.prototype.model = "";
    
                        /**
                         * BatchEmbedTextRequest texts.
                         * @member {Array.<string>} texts
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @instance
                         */
                        BatchEmbedTextRequest.prototype.texts = $util.emptyArray;
    
                        /**
                         * BatchEmbedTextRequest requests.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IEmbedTextRequest>} requests
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @instance
                         */
                        BatchEmbedTextRequest.prototype.requests = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedTextRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest} BatchEmbedTextRequest instance
                         */
                        BatchEmbedTextRequest.create = function create(properties) {
                            return new BatchEmbedTextRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest} message BatchEmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.texts != null && message.texts.length)
                                for (var i = 0; i < message.texts.length; ++i)
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.texts[i]);
                            if (message.requests != null && message.requests.length)
                                for (var i = 0; i < message.requests.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest.encode(message.requests[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest} message BatchEmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedTextRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest} BatchEmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.texts && message.texts.length))
                                            message.texts = [];
                                        message.texts.push(reader.string());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.requests && message.requests.length))
                                            message.requests = [];
                                        message.requests.push($root.google.ai.generativelanguage.v1alpha.EmbedTextRequest.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedTextRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest} BatchEmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedTextRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedTextRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.texts != null && message.hasOwnProperty("texts")) {
                                if (!Array.isArray(message.texts))
                                    return "texts: array expected";
                                for (var i = 0; i < message.texts.length; ++i)
                                    if (!$util.isString(message.texts[i]))
                                        return "texts: string[] expected";
                            }
                            if (message.requests != null && message.hasOwnProperty("requests")) {
                                if (!Array.isArray(message.requests))
                                    return "requests: array expected";
                                for (var i = 0; i < message.requests.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest.verify(message.requests[i]);
                                    if (error)
                                        return "requests." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedTextRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest} BatchEmbedTextRequest
                         */
                        BatchEmbedTextRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.texts) {
                                if (!Array.isArray(object.texts))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.texts: array expected");
                                message.texts = [];
                                for (var i = 0; i < object.texts.length; ++i)
                                    message.texts[i] = String(object.texts[i]);
                            }
                            if (object.requests) {
                                if (!Array.isArray(object.requests))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.requests: array expected");
                                message.requests = [];
                                for (var i = 0; i < object.requests.length; ++i) {
                                    if (typeof object.requests[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.requests: object expected");
                                    message.requests[i] = $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest.fromObject(object.requests[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedTextRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest} message BatchEmbedTextRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedTextRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.texts = [];
                                object.requests = [];
                            }
                            if (options.defaults)
                                object.model = "";
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.texts && message.texts.length) {
                                object.texts = [];
                                for (var j = 0; j < message.texts.length; ++j)
                                    object.texts[j] = message.texts[j];
                            }
                            if (message.requests && message.requests.length) {
                                object.requests = [];
                                for (var j = 0; j < message.requests.length; ++j)
                                    object.requests[j] = $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest.toObject(message.requests[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedTextRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedTextRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedTextRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest";
                        };
    
                        return BatchEmbedTextRequest;
                    })();
    
                    v1alpha.BatchEmbedTextResponse = (function() {
    
                        /**
                         * Properties of a BatchEmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IBatchEmbedTextResponse
                         * @property {Array.<google.ai.generativelanguage.v1alpha.IEmbedding>|null} [embeddings] BatchEmbedTextResponse embeddings
                         */
    
                        /**
                         * Constructs a new BatchEmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a BatchEmbedTextResponse.
                         * @implements IBatchEmbedTextResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse=} [properties] Properties to set
                         */
                        function BatchEmbedTextResponse(properties) {
                            this.embeddings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedTextResponse embeddings.
                         * @member {Array.<google.ai.generativelanguage.v1alpha.IEmbedding>} embeddings
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse
                         * @instance
                         */
                        BatchEmbedTextResponse.prototype.embeddings = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedTextResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} BatchEmbedTextResponse instance
                         */
                        BatchEmbedTextResponse.create = function create(properties) {
                            return new BatchEmbedTextResponse(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse} message BatchEmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embeddings != null && message.embeddings.length)
                                for (var i = 0; i < message.embeddings.length; ++i)
                                    $root.google.ai.generativelanguage.v1alpha.Embedding.encode(message.embeddings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse} message BatchEmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedTextResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} BatchEmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.embeddings && message.embeddings.length))
                                            message.embeddings = [];
                                        message.embeddings.push($root.google.ai.generativelanguage.v1alpha.Embedding.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedTextResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} BatchEmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedTextResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedTextResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.embeddings != null && message.hasOwnProperty("embeddings")) {
                                if (!Array.isArray(message.embeddings))
                                    return "embeddings: array expected";
                                for (var i = 0; i < message.embeddings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1alpha.Embedding.verify(message.embeddings[i]);
                                    if (error)
                                        return "embeddings." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedTextResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} BatchEmbedTextResponse
                         */
                        BatchEmbedTextResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse();
                            if (object.embeddings) {
                                if (!Array.isArray(object.embeddings))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse.embeddings: array expected");
                                message.embeddings = [];
                                for (var i = 0; i < object.embeddings.length; ++i) {
                                    if (typeof object.embeddings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse.embeddings: object expected");
                                    message.embeddings[i] = $root.google.ai.generativelanguage.v1alpha.Embedding.fromObject(object.embeddings[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedTextResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} message BatchEmbedTextResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedTextResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.embeddings = [];
                            if (message.embeddings && message.embeddings.length) {
                                object.embeddings = [];
                                for (var j = 0; j < message.embeddings.length; ++j)
                                    object.embeddings[j] = $root.google.ai.generativelanguage.v1alpha.Embedding.toObject(message.embeddings[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedTextResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedTextResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedTextResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse";
                        };
    
                        return BatchEmbedTextResponse;
                    })();
    
                    v1alpha.Embedding = (function() {
    
                        /**
                         * Properties of an Embedding.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface IEmbedding
                         * @property {Array.<number>|null} [value] Embedding value
                         */
    
                        /**
                         * Constructs a new Embedding.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents an Embedding.
                         * @implements IEmbedding
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedding=} [properties] Properties to set
                         */
                        function Embedding(properties) {
                            this.value = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Embedding value.
                         * @member {Array.<number>} value
                         * @memberof google.ai.generativelanguage.v1alpha.Embedding
                         * @instance
                         */
                        Embedding.prototype.value = $util.emptyArray;
    
                        /**
                         * Creates a new Embedding instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedding=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.Embedding} Embedding instance
                         */
                        Embedding.create = function create(properties) {
                            return new Embedding(properties);
                        };
    
                        /**
                         * Encodes the specified Embedding message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Embedding.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedding} message Embedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Embedding.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.value != null && message.value.length) {
                                writer.uint32(/* id 1, wireType 2 =*/10).fork();
                                for (var i = 0; i < message.value.length; ++i)
                                    writer.float(message.value[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Embedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Embedding.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.IEmbedding} message Embedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Embedding.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an Embedding message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.Embedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.Embedding} Embedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Embedding.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Embedding();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.value && message.value.length))
                                            message.value = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.value.push(reader.float());
                                        } else
                                            message.value.push(reader.float());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an Embedding message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.Embedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.Embedding} Embedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Embedding.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an Embedding message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.Embedding
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Embedding.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.value != null && message.hasOwnProperty("value")) {
                                if (!Array.isArray(message.value))
                                    return "value: array expected";
                                for (var i = 0; i < message.value.length; ++i)
                                    if (typeof message.value[i] !== "number")
                                        return "value: number[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates an Embedding message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.Embedding
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.Embedding} Embedding
                         */
                        Embedding.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.Embedding)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.Embedding();
                            if (object.value) {
                                if (!Array.isArray(object.value))
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.Embedding.value: array expected");
                                message.value = [];
                                for (var i = 0; i < object.value.length; ++i)
                                    message.value[i] = Number(object.value[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an Embedding message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.Embedding} message Embedding
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Embedding.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.value = [];
                            if (message.value && message.value.length) {
                                object.value = [];
                                for (var j = 0; j < message.value.length; ++j)
                                    object.value[j] = options.json && !isFinite(message.value[j]) ? String(message.value[j]) : message.value[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Embedding to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.Embedding
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Embedding.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Embedding
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.Embedding
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Embedding.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Embedding";
                        };
    
                        return Embedding;
                    })();
    
                    v1alpha.CountTextTokensRequest = (function() {
    
                        /**
                         * Properties of a CountTextTokensRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICountTextTokensRequest
                         * @property {string|null} [model] CountTextTokensRequest model
                         * @property {google.ai.generativelanguage.v1alpha.ITextPrompt|null} [prompt] CountTextTokensRequest prompt
                         */
    
                        /**
                         * Constructs a new CountTextTokensRequest.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CountTextTokensRequest.
                         * @implements ICountTextTokensRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest=} [properties] Properties to set
                         */
                        function CountTextTokensRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTextTokensRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @instance
                         */
                        CountTextTokensRequest.prototype.model = "";
    
                        /**
                         * CountTextTokensRequest prompt.
                         * @member {google.ai.generativelanguage.v1alpha.ITextPrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @instance
                         */
                        CountTextTokensRequest.prototype.prompt = null;
    
                        /**
                         * Creates a new CountTextTokensRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensRequest} CountTextTokensRequest instance
                         */
                        CountTextTokensRequest.create = function create(properties) {
                            return new CountTextTokensRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CountTextTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest} message CountTextTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1alpha.TextPrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTextTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest} message CountTextTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTextTokensRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensRequest} CountTextTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CountTextTokensRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTextTokensRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensRequest} CountTextTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTextTokensRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTextTokensRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1alpha.TextPrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CountTextTokensRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensRequest} CountTextTokensRequest
                         */
                        CountTextTokensRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountTextTokensRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CountTextTokensRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1alpha.CountTextTokensRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.fromObject(object.prompt);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTextTokensRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CountTextTokensRequest} message CountTextTokensRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTextTokensRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.toObject(message.prompt, options);
                            return object;
                        };
    
                        /**
                         * Converts this CountTextTokensRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTextTokensRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTextTokensRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTextTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountTextTokensRequest";
                        };
    
                        return CountTextTokensRequest;
                    })();
    
                    v1alpha.CountTextTokensResponse = (function() {
    
                        /**
                         * Properties of a CountTextTokensResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @interface ICountTextTokensResponse
                         * @property {number|null} [tokenCount] CountTextTokensResponse tokenCount
                         */
    
                        /**
                         * Constructs a new CountTextTokensResponse.
                         * @memberof google.ai.generativelanguage.v1alpha
                         * @classdesc Represents a CountTextTokensResponse.
                         * @implements ICountTextTokensResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensResponse=} [properties] Properties to set
                         */
                        function CountTextTokensResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTextTokensResponse tokenCount.
                         * @member {number} tokenCount
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse
                         * @instance
                         */
                        CountTextTokensResponse.prototype.tokenCount = 0;
    
                        /**
                         * Creates a new CountTextTokensResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} CountTextTokensResponse instance
                         */
                        CountTextTokensResponse.create = function create(properties) {
                            return new CountTextTokensResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CountTextTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensResponse} message CountTextTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tokenCount);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTextTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensResponse} message CountTextTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTextTokensResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} CountTextTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CountTextTokensResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tokenCount = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTextTokensResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} CountTextTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTextTokensResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTextTokensResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                if (!$util.isInteger(message.tokenCount))
                                    return "tokenCount: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a CountTextTokensResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} CountTextTokensResponse
                         */
                        CountTextTokensResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountTextTokensResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1alpha.CountTextTokensResponse();
                            if (object.tokenCount != null)
                                message.tokenCount = object.tokenCount | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTextTokensResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} message CountTextTokensResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTextTokensResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.tokenCount = 0;
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                object.tokenCount = message.tokenCount;
                            return object;
                        };
    
                        /**
                         * Converts this CountTextTokensResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTextTokensResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTextTokensResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTextTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountTextTokensResponse";
                        };
    
                        return CountTextTokensResponse;
                    })();
    
                    return v1alpha;
                })();
    
                generativelanguage.v1beta = (function() {
    
                    /**
                     * Namespace v1beta.
                     * @memberof google.ai.generativelanguage
                     * @namespace
                     */
                    var v1beta = {};
    
                    v1beta.CacheService = (function() {
    
                        /**
                         * Constructs a new CacheService service.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CacheService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function CacheService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (CacheService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CacheService;
    
                        /**
                         * Creates new CacheService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {CacheService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        CacheService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|listCachedContents}.
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @typedef ListCachedContentsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} [response] ListCachedContentsResponse
                         */
    
                        /**
                         * Calls ListCachedContents.
                         * @function listCachedContents
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest} request ListCachedContentsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.CacheService.ListCachedContentsCallback} callback Node-style callback called with the error, if any, and ListCachedContentsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(CacheService.prototype.listCachedContents = function listCachedContents(request, callback) {
                            return this.rpcCall(listCachedContents, $root.google.ai.generativelanguage.v1beta.ListCachedContentsRequest, $root.google.ai.generativelanguage.v1beta.ListCachedContentsResponse, request, callback);
                        }, "name", { value: "ListCachedContents" });
    
                        /**
                         * Calls ListCachedContents.
                         * @function listCachedContents
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest} request ListCachedContentsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.ListCachedContentsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|createCachedContent}.
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @typedef CreateCachedContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.CachedContent} [response] CachedContent
                         */
    
                        /**
                         * Calls CreateCachedContent.
                         * @function createCachedContent
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest} request CreateCachedContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.CacheService.CreateCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(CacheService.prototype.createCachedContent = function createCachedContent(request, callback) {
                            return this.rpcCall(createCachedContent, $root.google.ai.generativelanguage.v1beta.CreateCachedContentRequest, $root.google.ai.generativelanguage.v1beta.CachedContent, request, callback);
                        }, "name", { value: "CreateCachedContent" });
    
                        /**
                         * Calls CreateCachedContent.
                         * @function createCachedContent
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest} request CreateCachedContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.CachedContent>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|getCachedContent}.
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @typedef GetCachedContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.CachedContent} [response] CachedContent
                         */
    
                        /**
                         * Calls GetCachedContent.
                         * @function getCachedContent
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest} request GetCachedContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.CacheService.GetCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(CacheService.prototype.getCachedContent = function getCachedContent(request, callback) {
                            return this.rpcCall(getCachedContent, $root.google.ai.generativelanguage.v1beta.GetCachedContentRequest, $root.google.ai.generativelanguage.v1beta.CachedContent, request, callback);
                        }, "name", { value: "GetCachedContent" });
    
                        /**
                         * Calls GetCachedContent.
                         * @function getCachedContent
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest} request GetCachedContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.CachedContent>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|updateCachedContent}.
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @typedef UpdateCachedContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.CachedContent} [response] CachedContent
                         */
    
                        /**
                         * Calls UpdateCachedContent.
                         * @function updateCachedContent
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest} request UpdateCachedContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.CacheService.UpdateCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(CacheService.prototype.updateCachedContent = function updateCachedContent(request, callback) {
                            return this.rpcCall(updateCachedContent, $root.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest, $root.google.ai.generativelanguage.v1beta.CachedContent, request, callback);
                        }, "name", { value: "UpdateCachedContent" });
    
                        /**
                         * Calls UpdateCachedContent.
                         * @function updateCachedContent
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest} request UpdateCachedContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.CachedContent>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|deleteCachedContent}.
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @typedef DeleteCachedContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteCachedContent.
                         * @function deleteCachedContent
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest} request DeleteCachedContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.CacheService.DeleteCachedContentCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(CacheService.prototype.deleteCachedContent = function deleteCachedContent(request, callback) {
                            return this.rpcCall(deleteCachedContent, $root.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteCachedContent" });
    
                        /**
                         * Calls DeleteCachedContent.
                         * @function deleteCachedContent
                         * @memberof google.ai.generativelanguage.v1beta.CacheService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest} request DeleteCachedContentRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        return CacheService;
                    })();
    
                    v1beta.ListCachedContentsRequest = (function() {
    
                        /**
                         * Properties of a ListCachedContentsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListCachedContentsRequest
                         * @property {number|null} [pageSize] ListCachedContentsRequest pageSize
                         * @property {string|null} [pageToken] ListCachedContentsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListCachedContentsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListCachedContentsRequest.
                         * @implements IListCachedContentsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest=} [properties] Properties to set
                         */
                        function ListCachedContentsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListCachedContentsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @instance
                         */
                        ListCachedContentsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListCachedContentsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @instance
                         */
                        ListCachedContentsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListCachedContentsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest instance
                         */
                        ListCachedContentsRequest.create = function create(properties) {
                            return new ListCachedContentsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListCachedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCachedContentsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListCachedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCachedContentsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListCachedContentsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCachedContentsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListCachedContentsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListCachedContentsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCachedContentsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListCachedContentsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListCachedContentsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListCachedContentsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest
                         */
                        ListCachedContentsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListCachedContentsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListCachedContentsRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListCachedContentsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} message ListCachedContentsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListCachedContentsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListCachedContentsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListCachedContentsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListCachedContentsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListCachedContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListCachedContentsRequest";
                        };
    
                        return ListCachedContentsRequest;
                    })();
    
                    v1beta.ListCachedContentsResponse = (function() {
    
                        /**
                         * Properties of a ListCachedContentsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListCachedContentsResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.ICachedContent>|null} [cachedContents] ListCachedContentsResponse cachedContents
                         * @property {string|null} [nextPageToken] ListCachedContentsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListCachedContentsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListCachedContentsResponse.
                         * @implements IListCachedContentsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse=} [properties] Properties to set
                         */
                        function ListCachedContentsResponse(properties) {
                            this.cachedContents = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListCachedContentsResponse cachedContents.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ICachedContent>} cachedContents
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @instance
                         */
                        ListCachedContentsResponse.prototype.cachedContents = $util.emptyArray;
    
                        /**
                         * ListCachedContentsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @instance
                         */
                        ListCachedContentsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListCachedContentsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse instance
                         */
                        ListCachedContentsResponse.create = function create(properties) {
                            return new ListCachedContentsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListCachedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse} message ListCachedContentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCachedContentsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.cachedContents != null && message.cachedContents.length)
                                for (var i = 0; i < message.cachedContents.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.CachedContent.encode(message.cachedContents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListCachedContentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse} message ListCachedContentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCachedContentsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListCachedContentsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCachedContentsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListCachedContentsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.cachedContents && message.cachedContents.length))
                                            message.cachedContents = [];
                                        message.cachedContents.push($root.google.ai.generativelanguage.v1beta.CachedContent.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListCachedContentsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCachedContentsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListCachedContentsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListCachedContentsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.cachedContents != null && message.hasOwnProperty("cachedContents")) {
                                if (!Array.isArray(message.cachedContents))
                                    return "cachedContents: array expected";
                                for (var i = 0; i < message.cachedContents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.CachedContent.verify(message.cachedContents[i]);
                                    if (error)
                                        return "cachedContents." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListCachedContentsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse
                         */
                        ListCachedContentsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListCachedContentsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListCachedContentsResponse();
                            if (object.cachedContents) {
                                if (!Array.isArray(object.cachedContents))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.ListCachedContentsResponse.cachedContents: array expected");
                                message.cachedContents = [];
                                for (var i = 0; i < object.cachedContents.length; ++i) {
                                    if (typeof object.cachedContents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.ListCachedContentsResponse.cachedContents: object expected");
                                    message.cachedContents[i] = $root.google.ai.generativelanguage.v1beta.CachedContent.fromObject(object.cachedContents[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListCachedContentsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} message ListCachedContentsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListCachedContentsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.cachedContents = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.cachedContents && message.cachedContents.length) {
                                object.cachedContents = [];
                                for (var j = 0; j < message.cachedContents.length; ++j)
                                    object.cachedContents[j] = $root.google.ai.generativelanguage.v1beta.CachedContent.toObject(message.cachedContents[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListCachedContentsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListCachedContentsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListCachedContentsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListCachedContentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListCachedContentsResponse";
                        };
    
                        return ListCachedContentsResponse;
                    })();
    
                    v1beta.CreateCachedContentRequest = (function() {
    
                        /**
                         * Properties of a CreateCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICreateCachedContentRequest
                         * @property {google.ai.generativelanguage.v1beta.ICachedContent|null} [cachedContent] CreateCachedContentRequest cachedContent
                         */
    
                        /**
                         * Constructs a new CreateCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CreateCachedContentRequest.
                         * @implements ICreateCachedContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest=} [properties] Properties to set
                         */
                        function CreateCachedContentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateCachedContentRequest cachedContent.
                         * @member {google.ai.generativelanguage.v1beta.ICachedContent|null|undefined} cachedContent
                         * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest
                         * @instance
                         */
                        CreateCachedContentRequest.prototype.cachedContent = null;
    
                        /**
                         * Creates a new CreateCachedContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} CreateCachedContentRequest instance
                         */
                        CreateCachedContentRequest.create = function create(properties) {
                            return new CreateCachedContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateCachedContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest} message CreateCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateCachedContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.cachedContent != null && Object.hasOwnProperty.call(message, "cachedContent"))
                                $root.google.ai.generativelanguage.v1beta.CachedContent.encode(message.cachedContent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateCachedContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest} message CreateCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateCachedContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} CreateCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateCachedContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CreateCachedContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateCachedContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} CreateCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateCachedContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateCachedContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateCachedContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) {
                                var error = $root.google.ai.generativelanguage.v1beta.CachedContent.verify(message.cachedContent);
                                if (error)
                                    return "cachedContent." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateCachedContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} CreateCachedContentRequest
                         */
                        CreateCachedContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateCachedContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CreateCachedContentRequest();
                            if (object.cachedContent != null) {
                                if (typeof object.cachedContent !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CreateCachedContentRequest.cachedContent: object expected");
                                message.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.fromObject(object.cachedContent);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateCachedContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} message CreateCachedContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateCachedContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.cachedContent = null;
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent"))
                                object.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.toObject(message.cachedContent, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateCachedContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateCachedContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateCachedContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateCachedContentRequest";
                        };
    
                        return CreateCachedContentRequest;
                    })();
    
                    v1beta.GetCachedContentRequest = (function() {
    
                        /**
                         * Properties of a GetCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGetCachedContentRequest
                         * @property {string|null} [name] GetCachedContentRequest name
                         */
    
                        /**
                         * Constructs a new GetCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GetCachedContentRequest.
                         * @implements IGetCachedContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest=} [properties] Properties to set
                         */
                        function GetCachedContentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetCachedContentRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest
                         * @instance
                         */
                        GetCachedContentRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetCachedContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GetCachedContentRequest} GetCachedContentRequest instance
                         */
                        GetCachedContentRequest.create = function create(properties) {
                            return new GetCachedContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetCachedContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest} message GetCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetCachedContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetCachedContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest} message GetCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetCachedContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GetCachedContentRequest} GetCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetCachedContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GetCachedContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetCachedContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GetCachedContentRequest} GetCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetCachedContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetCachedContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetCachedContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetCachedContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GetCachedContentRequest} GetCachedContentRequest
                         */
                        GetCachedContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GetCachedContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GetCachedContentRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetCachedContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GetCachedContentRequest} message GetCachedContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetCachedContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetCachedContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetCachedContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetCachedContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetCachedContentRequest";
                        };
    
                        return GetCachedContentRequest;
                    })();
    
                    v1beta.UpdateCachedContentRequest = (function() {
    
                        /**
                         * Properties of an UpdateCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IUpdateCachedContentRequest
                         * @property {google.ai.generativelanguage.v1beta.ICachedContent|null} [cachedContent] UpdateCachedContentRequest cachedContent
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCachedContentRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdateCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an UpdateCachedContentRequest.
                         * @implements IUpdateCachedContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest=} [properties] Properties to set
                         */
                        function UpdateCachedContentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdateCachedContentRequest cachedContent.
                         * @member {google.ai.generativelanguage.v1beta.ICachedContent|null|undefined} cachedContent
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @instance
                         */
                        UpdateCachedContentRequest.prototype.cachedContent = null;
    
                        /**
                         * UpdateCachedContentRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @instance
                         */
                        UpdateCachedContentRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdateCachedContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} UpdateCachedContentRequest instance
                         */
                        UpdateCachedContentRequest.create = function create(properties) {
                            return new UpdateCachedContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest} message UpdateCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateCachedContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.cachedContent != null && Object.hasOwnProperty.call(message, "cachedContent"))
                                $root.google.ai.generativelanguage.v1beta.CachedContent.encode(message.cachedContent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest} message UpdateCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdateCachedContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} UpdateCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateCachedContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdateCachedContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} UpdateCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateCachedContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdateCachedContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdateCachedContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) {
                                var error = $root.google.ai.generativelanguage.v1beta.CachedContent.verify(message.cachedContent);
                                if (error)
                                    return "cachedContent." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdateCachedContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} UpdateCachedContentRequest
                         */
                        UpdateCachedContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest();
                            if (object.cachedContent != null) {
                                if (typeof object.cachedContent !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.cachedContent: object expected");
                                message.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.fromObject(object.cachedContent);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdateCachedContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} message UpdateCachedContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdateCachedContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.cachedContent = null;
                                object.updateMask = null;
                            }
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent"))
                                object.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.toObject(message.cachedContent, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdateCachedContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdateCachedContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdateCachedContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdateCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.UpdateCachedContentRequest";
                        };
    
                        return UpdateCachedContentRequest;
                    })();
    
                    v1beta.DeleteCachedContentRequest = (function() {
    
                        /**
                         * Properties of a DeleteCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IDeleteCachedContentRequest
                         * @property {string|null} [name] DeleteCachedContentRequest name
                         */
    
                        /**
                         * Constructs a new DeleteCachedContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a DeleteCachedContentRequest.
                         * @implements IDeleteCachedContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest=} [properties] Properties to set
                         */
                        function DeleteCachedContentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteCachedContentRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest
                         * @instance
                         */
                        DeleteCachedContentRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeleteCachedContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} DeleteCachedContentRequest instance
                         */
                        DeleteCachedContentRequest.create = function create(properties) {
                            return new DeleteCachedContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteCachedContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest} message DeleteCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteCachedContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteCachedContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest} message DeleteCachedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteCachedContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} DeleteCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteCachedContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteCachedContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} DeleteCachedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteCachedContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteCachedContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteCachedContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteCachedContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} DeleteCachedContentRequest
                         */
                        DeleteCachedContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteCachedContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} message DeleteCachedContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteCachedContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteCachedContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteCachedContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteCachedContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DeleteCachedContentRequest";
                        };
    
                        return DeleteCachedContentRequest;
                    })();
    
                    v1beta.CachedContent = (function() {
    
                        /**
                         * Properties of a CachedContent.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICachedContent
                         * @property {google.protobuf.ITimestamp|null} [expireTime] CachedContent expireTime
                         * @property {google.protobuf.IDuration|null} [ttl] CachedContent ttl
                         * @property {string|null} [name] CachedContent name
                         * @property {string|null} [displayName] CachedContent displayName
                         * @property {string|null} [model] CachedContent model
                         * @property {google.ai.generativelanguage.v1beta.IContent|null} [systemInstruction] CachedContent systemInstruction
                         * @property {Array.<google.ai.generativelanguage.v1beta.IContent>|null} [contents] CachedContent contents
                         * @property {Array.<google.ai.generativelanguage.v1beta.ITool>|null} [tools] CachedContent tools
                         * @property {google.ai.generativelanguage.v1beta.IToolConfig|null} [toolConfig] CachedContent toolConfig
                         * @property {google.protobuf.ITimestamp|null} [createTime] CachedContent createTime
                         * @property {google.protobuf.ITimestamp|null} [updateTime] CachedContent updateTime
                         * @property {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata|null} [usageMetadata] CachedContent usageMetadata
                         */
    
                        /**
                         * Constructs a new CachedContent.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CachedContent.
                         * @implements ICachedContent
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICachedContent=} [properties] Properties to set
                         */
                        function CachedContent(properties) {
                            this.contents = [];
                            this.tools = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CachedContent expireTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} expireTime
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.expireTime = null;
    
                        /**
                         * CachedContent ttl.
                         * @member {google.protobuf.IDuration|null|undefined} ttl
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.ttl = null;
    
                        /**
                         * CachedContent name.
                         * @member {string|null|undefined} name
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.name = null;
    
                        /**
                         * CachedContent displayName.
                         * @member {string|null|undefined} displayName
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.displayName = null;
    
                        /**
                         * CachedContent model.
                         * @member {string|null|undefined} model
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.model = null;
    
                        /**
                         * CachedContent systemInstruction.
                         * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} systemInstruction
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.systemInstruction = null;
    
                        /**
                         * CachedContent contents.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IContent>} contents
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.contents = $util.emptyArray;
    
                        /**
                         * CachedContent tools.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ITool>} tools
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.tools = $util.emptyArray;
    
                        /**
                         * CachedContent toolConfig.
                         * @member {google.ai.generativelanguage.v1beta.IToolConfig|null|undefined} toolConfig
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.toolConfig = null;
    
                        /**
                         * CachedContent createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.createTime = null;
    
                        /**
                         * CachedContent updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.updateTime = null;
    
                        /**
                         * CachedContent usageMetadata.
                         * @member {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata|null|undefined} usageMetadata
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        CachedContent.prototype.usageMetadata = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CachedContent expiration.
                         * @member {"expireTime"|"ttl"|undefined} expiration
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "expiration", {
                            get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CachedContent _name.
                         * @member {"name"|undefined} _name
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "_name", {
                            get: $util.oneOfGetter($oneOfFields = ["name"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CachedContent _displayName.
                         * @member {"displayName"|undefined} _displayName
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "_displayName", {
                            get: $util.oneOfGetter($oneOfFields = ["displayName"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CachedContent _model.
                         * @member {"model"|undefined} _model
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "_model", {
                            get: $util.oneOfGetter($oneOfFields = ["model"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CachedContent _systemInstruction.
                         * @member {"systemInstruction"|undefined} _systemInstruction
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "_systemInstruction", {
                            get: $util.oneOfGetter($oneOfFields = ["systemInstruction"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CachedContent _toolConfig.
                         * @member {"toolConfig"|undefined} _toolConfig
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         */
                        Object.defineProperty(CachedContent.prototype, "_toolConfig", {
                            get: $util.oneOfGetter($oneOfFields = ["toolConfig"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CachedContent instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICachedContent=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent instance
                         */
                        CachedContent.create = function create(properties) {
                            return new CachedContent(properties);
                        };
    
                        /**
                         * Encodes the specified CachedContent message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICachedContent} message CachedContent message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CachedContent.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.model);
                            if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction"))
                                $root.google.ai.generativelanguage.v1beta.Content.encode(message.systemInstruction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.contents != null && message.contents.length)
                                for (var i = 0; i < message.contents.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Content.encode(message.contents[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.tools != null && message.tools.length)
                                for (var i = 0; i < message.tools.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.toolConfig != null && Object.hasOwnProperty.call(message, "toolConfig"))
                                $root.google.ai.generativelanguage.v1beta.ToolConfig.encode(message.toolConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime"))
                                $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                            if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl"))
                                $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 11, wireType 2 =*/90).string(message.displayName);
                            if (message.usageMetadata != null && Object.hasOwnProperty.call(message, "usageMetadata"))
                                $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CachedContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICachedContent} message CachedContent message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CachedContent.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CachedContent message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CachedContent.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CachedContent();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 9: {
                                        message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 10: {
                                        message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 11: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        if (!(message.contents && message.contents.length))
                                            message.contents = [];
                                        message.contents.push($root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 5: {
                                        if (!(message.tools && message.tools.length))
                                            message.tools = [];
                                        message.tools.push($root.google.ai.generativelanguage.v1beta.Tool.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 6: {
                                        message.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 7: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 8: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 12: {
                                        message.usageMetadata = $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CachedContent message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CachedContent.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CachedContent message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CachedContent.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.expireTime != null && message.hasOwnProperty("expireTime")) {
                                properties.expiration = 1;
                                {
                                    var error = $root.google.protobuf.Timestamp.verify(message.expireTime);
                                    if (error)
                                        return "expireTime." + error;
                                }
                            }
                            if (message.ttl != null && message.hasOwnProperty("ttl")) {
                                if (properties.expiration === 1)
                                    return "expiration: multiple values";
                                properties.expiration = 1;
                                {
                                    var error = $root.google.protobuf.Duration.verify(message.ttl);
                                    if (error)
                                        return "ttl." + error;
                                }
                            }
                            if (message.name != null && message.hasOwnProperty("name")) {
                                properties._name = 1;
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            }
                            if (message.displayName != null && message.hasOwnProperty("displayName")) {
                                properties._displayName = 1;
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            }
                            if (message.model != null && message.hasOwnProperty("model")) {
                                properties._model = 1;
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            }
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) {
                                properties._systemInstruction = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.systemInstruction);
                                    if (error)
                                        return "systemInstruction." + error;
                                }
                            }
                            if (message.contents != null && message.hasOwnProperty("contents")) {
                                if (!Array.isArray(message.contents))
                                    return "contents: array expected";
                                for (var i = 0; i < message.contents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.contents[i]);
                                    if (error)
                                        return "contents." + error;
                                }
                            }
                            if (message.tools != null && message.hasOwnProperty("tools")) {
                                if (!Array.isArray(message.tools))
                                    return "tools: array expected";
                                for (var i = 0; i < message.tools.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Tool.verify(message.tools[i]);
                                    if (error)
                                        return "tools." + error;
                                }
                            }
                            if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) {
                                properties._toolConfig = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.ToolConfig.verify(message.toolConfig);
                                    if (error)
                                        return "toolConfig." + error;
                                }
                            }
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.verify(message.usageMetadata);
                                if (error)
                                    return "usageMetadata." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CachedContent message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent
                         */
                        CachedContent.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CachedContent)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CachedContent();
                            if (object.expireTime != null) {
                                if (typeof object.expireTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.expireTime: object expected");
                                message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime);
                            }
                            if (object.ttl != null) {
                                if (typeof object.ttl !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.ttl: object expected");
                                message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl);
                            }
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.systemInstruction != null) {
                                if (typeof object.systemInstruction !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.systemInstruction: object expected");
                                message.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.systemInstruction);
                            }
                            if (object.contents) {
                                if (!Array.isArray(object.contents))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.contents: array expected");
                                message.contents = [];
                                for (var i = 0; i < object.contents.length; ++i) {
                                    if (typeof object.contents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.contents: object expected");
                                    message.contents[i] = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.contents[i]);
                                }
                            }
                            if (object.tools) {
                                if (!Array.isArray(object.tools))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.tools: array expected");
                                message.tools = [];
                                for (var i = 0; i < object.tools.length; ++i) {
                                    if (typeof object.tools[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.tools: object expected");
                                    message.tools[i] = $root.google.ai.generativelanguage.v1beta.Tool.fromObject(object.tools[i]);
                                }
                            }
                            if (object.toolConfig != null) {
                                if (typeof object.toolConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.toolConfig: object expected");
                                message.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.fromObject(object.toolConfig);
                            }
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            if (object.usageMetadata != null) {
                                if (typeof object.usageMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.usageMetadata: object expected");
                                message.usageMetadata = $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.fromObject(object.usageMetadata);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CachedContent message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CachedContent} message CachedContent
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CachedContent.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.contents = [];
                                object.tools = [];
                            }
                            if (options.defaults) {
                                object.createTime = null;
                                object.updateTime = null;
                                object.usageMetadata = null;
                            }
                            if (message.name != null && message.hasOwnProperty("name")) {
                                object.name = message.name;
                                if (options.oneofs)
                                    object._name = "name";
                            }
                            if (message.model != null && message.hasOwnProperty("model")) {
                                object.model = message.model;
                                if (options.oneofs)
                                    object._model = "model";
                            }
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) {
                                object.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.systemInstruction, options);
                                if (options.oneofs)
                                    object._systemInstruction = "systemInstruction";
                            }
                            if (message.contents && message.contents.length) {
                                object.contents = [];
                                for (var j = 0; j < message.contents.length; ++j)
                                    object.contents[j] = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.contents[j], options);
                            }
                            if (message.tools && message.tools.length) {
                                object.tools = [];
                                for (var j = 0; j < message.tools.length; ++j)
                                    object.tools[j] = $root.google.ai.generativelanguage.v1beta.Tool.toObject(message.tools[j], options);
                            }
                            if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) {
                                object.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.toObject(message.toolConfig, options);
                                if (options.oneofs)
                                    object._toolConfig = "toolConfig";
                            }
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            if (message.expireTime != null && message.hasOwnProperty("expireTime")) {
                                object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options);
                                if (options.oneofs)
                                    object.expiration = "expireTime";
                            }
                            if (message.ttl != null && message.hasOwnProperty("ttl")) {
                                object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options);
                                if (options.oneofs)
                                    object.expiration = "ttl";
                            }
                            if (message.displayName != null && message.hasOwnProperty("displayName")) {
                                object.displayName = message.displayName;
                                if (options.oneofs)
                                    object._displayName = "displayName";
                            }
                            if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata"))
                                object.usageMetadata = $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.toObject(message.usageMetadata, options);
                            return object;
                        };
    
                        /**
                         * Converts this CachedContent to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CachedContent.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CachedContent
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CachedContent
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CachedContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CachedContent";
                        };
    
                        CachedContent.UsageMetadata = (function() {
    
                            /**
                             * Properties of a UsageMetadata.
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent
                             * @interface IUsageMetadata
                             * @property {number|null} [totalTokenCount] UsageMetadata totalTokenCount
                             */
    
                            /**
                             * Constructs a new UsageMetadata.
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent
                             * @classdesc Represents a UsageMetadata.
                             * @implements IUsageMetadata
                             * @constructor
                             * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata=} [properties] Properties to set
                             */
                            function UsageMetadata(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * UsageMetadata totalTokenCount.
                             * @member {number} totalTokenCount
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.totalTokenCount = 0;
    
                            /**
                             * Creates a new UsageMetadata instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} UsageMetadata instance
                             */
                            UsageMetadata.create = function create(properties) {
                                return new UsageMetadata(properties);
                            };
    
                            /**
                             * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata} message UsageMetadata message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            UsageMetadata.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.totalTokenCount != null && Object.hasOwnProperty.call(message, "totalTokenCount"))
                                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalTokenCount);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata} message UsageMetadata message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            UsageMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a UsageMetadata message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} UsageMetadata
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            UsageMetadata.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.totalTokenCount = reader.int32();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a UsageMetadata message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} UsageMetadata
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            UsageMetadata.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a UsageMetadata message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            UsageMetadata.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount"))
                                    if (!$util.isInteger(message.totalTokenCount))
                                        return "totalTokenCount: integer expected";
                                return null;
                            };
    
                            /**
                             * Creates a UsageMetadata message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} UsageMetadata
                             */
                            UsageMetadata.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata();
                                if (object.totalTokenCount != null)
                                    message.totalTokenCount = object.totalTokenCount | 0;
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a UsageMetadata message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} message UsageMetadata
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            UsageMetadata.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.defaults)
                                    object.totalTokenCount = 0;
                                if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount"))
                                    object.totalTokenCount = message.totalTokenCount;
                                return object;
                            };
    
                            /**
                             * Converts this UsageMetadata to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            UsageMetadata.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for UsageMetadata
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            UsageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata";
                            };
    
                            return UsageMetadata;
                        })();
    
                        return CachedContent;
                    })();
    
                    /**
                     * Type enum.
                     * @name google.ai.generativelanguage.v1beta.Type
                     * @enum {number}
                     * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value
                     * @property {number} STRING=1 STRING value
                     * @property {number} NUMBER=2 NUMBER value
                     * @property {number} INTEGER=3 INTEGER value
                     * @property {number} BOOLEAN=4 BOOLEAN value
                     * @property {number} ARRAY=5 ARRAY value
                     * @property {number} OBJECT=6 OBJECT value
                     */
                    v1beta.Type = (function() {
                        var valuesById = {}, values = Object.create(valuesById);
                        values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0;
                        values[valuesById[1] = "STRING"] = 1;
                        values[valuesById[2] = "NUMBER"] = 2;
                        values[valuesById[3] = "INTEGER"] = 3;
                        values[valuesById[4] = "BOOLEAN"] = 4;
                        values[valuesById[5] = "ARRAY"] = 5;
                        values[valuesById[6] = "OBJECT"] = 6;
                        return values;
                    })();
    
                    v1beta.Content = (function() {
    
                        /**
                         * Properties of a Content.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IContent
                         * @property {Array.<google.ai.generativelanguage.v1beta.IPart>|null} [parts] Content parts
                         * @property {string|null} [role] Content role
                         */
    
                        /**
                         * Constructs a new Content.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Content.
                         * @implements IContent
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IContent=} [properties] Properties to set
                         */
                        function Content(properties) {
                            this.parts = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Content parts.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IPart>} parts
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @instance
                         */
                        Content.prototype.parts = $util.emptyArray;
    
                        /**
                         * Content role.
                         * @member {string} role
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @instance
                         */
                        Content.prototype.role = "";
    
                        /**
                         * Creates a new Content instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IContent=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Content} Content instance
                         */
                        Content.create = function create(properties) {
                            return new Content(properties);
                        };
    
                        /**
                         * Encodes the specified Content message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Content.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IContent} message Content message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Content.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parts != null && message.parts.length)
                                for (var i = 0; i < message.parts.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Part.encode(message.parts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.role != null && Object.hasOwnProperty.call(message, "role"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.role);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Content message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Content.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IContent} message Content message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Content.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Content message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Content} Content
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Content.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Content();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.parts && message.parts.length))
                                            message.parts = [];
                                        message.parts.push($root.google.ai.generativelanguage.v1beta.Part.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.role = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Content message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Content} Content
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Content.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Content message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Content.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parts != null && message.hasOwnProperty("parts")) {
                                if (!Array.isArray(message.parts))
                                    return "parts: array expected";
                                for (var i = 0; i < message.parts.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Part.verify(message.parts[i]);
                                    if (error)
                                        return "parts." + error;
                                }
                            }
                            if (message.role != null && message.hasOwnProperty("role"))
                                if (!$util.isString(message.role))
                                    return "role: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a Content message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Content} Content
                         */
                        Content.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Content)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Content();
                            if (object.parts) {
                                if (!Array.isArray(object.parts))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Content.parts: array expected");
                                message.parts = [];
                                for (var i = 0; i < object.parts.length; ++i) {
                                    if (typeof object.parts[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.Content.parts: object expected");
                                    message.parts[i] = $root.google.ai.generativelanguage.v1beta.Part.fromObject(object.parts[i]);
                                }
                            }
                            if (object.role != null)
                                message.role = String(object.role);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Content message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Content} message Content
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Content.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.parts = [];
                            if (options.defaults)
                                object.role = "";
                            if (message.parts && message.parts.length) {
                                object.parts = [];
                                for (var j = 0; j < message.parts.length; ++j)
                                    object.parts[j] = $root.google.ai.generativelanguage.v1beta.Part.toObject(message.parts[j], options);
                            }
                            if (message.role != null && message.hasOwnProperty("role"))
                                object.role = message.role;
                            return object;
                        };
    
                        /**
                         * Converts this Content to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Content.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Content
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Content
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Content.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Content";
                        };
    
                        return Content;
                    })();
    
                    v1beta.Part = (function() {
    
                        /**
                         * Properties of a Part.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IPart
                         * @property {string|null} [text] Part text
                         * @property {google.ai.generativelanguage.v1beta.IBlob|null} [inlineData] Part inlineData
                         * @property {google.ai.generativelanguage.v1beta.IFunctionCall|null} [functionCall] Part functionCall
                         * @property {google.ai.generativelanguage.v1beta.IFunctionResponse|null} [functionResponse] Part functionResponse
                         * @property {google.ai.generativelanguage.v1beta.IFileData|null} [fileData] Part fileData
                         * @property {google.ai.generativelanguage.v1beta.IExecutableCode|null} [executableCode] Part executableCode
                         * @property {google.ai.generativelanguage.v1beta.ICodeExecutionResult|null} [codeExecutionResult] Part codeExecutionResult
                         */
    
                        /**
                         * Constructs a new Part.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Part.
                         * @implements IPart
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IPart=} [properties] Properties to set
                         */
                        function Part(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Part text.
                         * @member {string|null|undefined} text
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @instance
                         */
                        Part.prototype.text = null;
    
                        /**
                         * Part inlineData.
                         * @member {google.ai.generativelanguage.v1beta.IBlob|null|undefined} inlineData
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @instance
                         */
                        Part.prototype.inlineData = null;
    
                        /**
                         * Part functionCall.
                         * @member {google.ai.generativelanguage.v1beta.IFunctionCall|null|undefined} functionCall
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @instance
                         */
                        Part.prototype.functionCall = null;
    
                        /**
                         * Part functionResponse.
                         * @member {google.ai.generativelanguage.v1beta.IFunctionResponse|null|undefined} functionResponse
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @instance
                         */
                        Part.prototype.functionResponse = null;
    
                        /**
                         * Part fileData.
                         * @member {google.ai.generativelanguage.v1beta.IFileData|null|undefined} fileData
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @instance
                         */
                        Part.prototype.fileData = null;
    
                        /**
                         * Part executableCode.
                         * @member {google.ai.generativelanguage.v1beta.IExecutableCode|null|undefined} executableCode
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @instance
                         */
                        Part.prototype.executableCode = null;
    
                        /**
                         * Part codeExecutionResult.
                         * @member {google.ai.generativelanguage.v1beta.ICodeExecutionResult|null|undefined} codeExecutionResult
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @instance
                         */
                        Part.prototype.codeExecutionResult = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Part data.
                         * @member {"text"|"inlineData"|"functionCall"|"functionResponse"|"fileData"|"executableCode"|"codeExecutionResult"|undefined} data
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @instance
                         */
                        Object.defineProperty(Part.prototype, "data", {
                            get: $util.oneOfGetter($oneOfFields = ["text", "inlineData", "functionCall", "functionResponse", "fileData", "executableCode", "codeExecutionResult"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Part instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPart=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Part} Part instance
                         */
                        Part.create = function create(properties) {
                            return new Part(properties);
                        };
    
                        /**
                         * Encodes the specified Part message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Part.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPart} message Part message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Part.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.text);
                            if (message.inlineData != null && Object.hasOwnProperty.call(message, "inlineData"))
                                $root.google.ai.generativelanguage.v1beta.Blob.encode(message.inlineData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.functionCall != null && Object.hasOwnProperty.call(message, "functionCall"))
                                $root.google.ai.generativelanguage.v1beta.FunctionCall.encode(message.functionCall, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.functionResponse != null && Object.hasOwnProperty.call(message, "functionResponse"))
                                $root.google.ai.generativelanguage.v1beta.FunctionResponse.encode(message.functionResponse, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.fileData != null && Object.hasOwnProperty.call(message, "fileData"))
                                $root.google.ai.generativelanguage.v1beta.FileData.encode(message.fileData, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.executableCode != null && Object.hasOwnProperty.call(message, "executableCode"))
                                $root.google.ai.generativelanguage.v1beta.ExecutableCode.encode(message.executableCode, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                            if (message.codeExecutionResult != null && Object.hasOwnProperty.call(message, "codeExecutionResult"))
                                $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.encode(message.codeExecutionResult, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Part message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Part.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPart} message Part message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Part.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Part message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Part} Part
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Part.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Part();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.text = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.inlineData = $root.google.ai.generativelanguage.v1beta.Blob.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.functionCall = $root.google.ai.generativelanguage.v1beta.FunctionCall.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        message.functionResponse = $root.google.ai.generativelanguage.v1beta.FunctionResponse.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 6: {
                                        message.fileData = $root.google.ai.generativelanguage.v1beta.FileData.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 9: {
                                        message.executableCode = $root.google.ai.generativelanguage.v1beta.ExecutableCode.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 10: {
                                        message.codeExecutionResult = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Part message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Part} Part
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Part.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Part message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Part.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.text != null && message.hasOwnProperty("text")) {
                                properties.data = 1;
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            }
                            if (message.inlineData != null && message.hasOwnProperty("inlineData")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.Blob.verify(message.inlineData);
                                    if (error)
                                        return "inlineData." + error;
                                }
                            }
                            if (message.functionCall != null && message.hasOwnProperty("functionCall")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.FunctionCall.verify(message.functionCall);
                                    if (error)
                                        return "functionCall." + error;
                                }
                            }
                            if (message.functionResponse != null && message.hasOwnProperty("functionResponse")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.FunctionResponse.verify(message.functionResponse);
                                    if (error)
                                        return "functionResponse." + error;
                                }
                            }
                            if (message.fileData != null && message.hasOwnProperty("fileData")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.FileData.verify(message.fileData);
                                    if (error)
                                        return "fileData." + error;
                                }
                            }
                            if (message.executableCode != null && message.hasOwnProperty("executableCode")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.ExecutableCode.verify(message.executableCode);
                                    if (error)
                                        return "executableCode." + error;
                                }
                            }
                            if (message.codeExecutionResult != null && message.hasOwnProperty("codeExecutionResult")) {
                                if (properties.data === 1)
                                    return "data: multiple values";
                                properties.data = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.verify(message.codeExecutionResult);
                                    if (error)
                                        return "codeExecutionResult." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Part message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Part} Part
                         */
                        Part.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Part)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Part();
                            if (object.text != null)
                                message.text = String(object.text);
                            if (object.inlineData != null) {
                                if (typeof object.inlineData !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Part.inlineData: object expected");
                                message.inlineData = $root.google.ai.generativelanguage.v1beta.Blob.fromObject(object.inlineData);
                            }
                            if (object.functionCall != null) {
                                if (typeof object.functionCall !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Part.functionCall: object expected");
                                message.functionCall = $root.google.ai.generativelanguage.v1beta.FunctionCall.fromObject(object.functionCall);
                            }
                            if (object.functionResponse != null) {
                                if (typeof object.functionResponse !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Part.functionResponse: object expected");
                                message.functionResponse = $root.google.ai.generativelanguage.v1beta.FunctionResponse.fromObject(object.functionResponse);
                            }
                            if (object.fileData != null) {
                                if (typeof object.fileData !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Part.fileData: object expected");
                                message.fileData = $root.google.ai.generativelanguage.v1beta.FileData.fromObject(object.fileData);
                            }
                            if (object.executableCode != null) {
                                if (typeof object.executableCode !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Part.executableCode: object expected");
                                message.executableCode = $root.google.ai.generativelanguage.v1beta.ExecutableCode.fromObject(object.executableCode);
                            }
                            if (object.codeExecutionResult != null) {
                                if (typeof object.codeExecutionResult !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Part.codeExecutionResult: object expected");
                                message.codeExecutionResult = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.fromObject(object.codeExecutionResult);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Part message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Part} message Part
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Part.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.text != null && message.hasOwnProperty("text")) {
                                object.text = message.text;
                                if (options.oneofs)
                                    object.data = "text";
                            }
                            if (message.inlineData != null && message.hasOwnProperty("inlineData")) {
                                object.inlineData = $root.google.ai.generativelanguage.v1beta.Blob.toObject(message.inlineData, options);
                                if (options.oneofs)
                                    object.data = "inlineData";
                            }
                            if (message.functionCall != null && message.hasOwnProperty("functionCall")) {
                                object.functionCall = $root.google.ai.generativelanguage.v1beta.FunctionCall.toObject(message.functionCall, options);
                                if (options.oneofs)
                                    object.data = "functionCall";
                            }
                            if (message.functionResponse != null && message.hasOwnProperty("functionResponse")) {
                                object.functionResponse = $root.google.ai.generativelanguage.v1beta.FunctionResponse.toObject(message.functionResponse, options);
                                if (options.oneofs)
                                    object.data = "functionResponse";
                            }
                            if (message.fileData != null && message.hasOwnProperty("fileData")) {
                                object.fileData = $root.google.ai.generativelanguage.v1beta.FileData.toObject(message.fileData, options);
                                if (options.oneofs)
                                    object.data = "fileData";
                            }
                            if (message.executableCode != null && message.hasOwnProperty("executableCode")) {
                                object.executableCode = $root.google.ai.generativelanguage.v1beta.ExecutableCode.toObject(message.executableCode, options);
                                if (options.oneofs)
                                    object.data = "executableCode";
                            }
                            if (message.codeExecutionResult != null && message.hasOwnProperty("codeExecutionResult")) {
                                object.codeExecutionResult = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.toObject(message.codeExecutionResult, options);
                                if (options.oneofs)
                                    object.data = "codeExecutionResult";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Part to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Part.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Part
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Part
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Part.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Part";
                        };
    
                        return Part;
                    })();
    
                    v1beta.Blob = (function() {
    
                        /**
                         * Properties of a Blob.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IBlob
                         * @property {string|null} [mimeType] Blob mimeType
                         * @property {Uint8Array|null} [data] Blob data
                         */
    
                        /**
                         * Constructs a new Blob.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Blob.
                         * @implements IBlob
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IBlob=} [properties] Properties to set
                         */
                        function Blob(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Blob mimeType.
                         * @member {string} mimeType
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @instance
                         */
                        Blob.prototype.mimeType = "";
    
                        /**
                         * Blob data.
                         * @member {Uint8Array} data
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @instance
                         */
                        Blob.prototype.data = $util.newBuffer([]);
    
                        /**
                         * Creates a new Blob instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBlob=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Blob} Blob instance
                         */
                        Blob.create = function create(properties) {
                            return new Blob(properties);
                        };
    
                        /**
                         * Encodes the specified Blob message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Blob.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBlob} message Blob message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Blob.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType);
                            if (message.data != null && Object.hasOwnProperty.call(message, "data"))
                                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Blob.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBlob} message Blob message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Blob.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Blob message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Blob} Blob
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Blob.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Blob();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.mimeType = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.data = reader.bytes();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Blob message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Blob} Blob
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Blob.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Blob message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Blob.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                if (!$util.isString(message.mimeType))
                                    return "mimeType: string expected";
                            if (message.data != null && message.hasOwnProperty("data"))
                                if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data)))
                                    return "data: buffer expected";
                            return null;
                        };
    
                        /**
                         * Creates a Blob message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Blob} Blob
                         */
                        Blob.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Blob)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Blob();
                            if (object.mimeType != null)
                                message.mimeType = String(object.mimeType);
                            if (object.data != null)
                                if (typeof object.data === "string")
                                    $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0);
                                else if (object.data.length >= 0)
                                    message.data = object.data;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Blob message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Blob} message Blob
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Blob.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.mimeType = "";
                                if (options.bytes === String)
                                    object.data = "";
                                else {
                                    object.data = [];
                                    if (options.bytes !== Array)
                                        object.data = $util.newBuffer(object.data);
                                }
                            }
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                object.mimeType = message.mimeType;
                            if (message.data != null && message.hasOwnProperty("data"))
                                object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data;
                            return object;
                        };
    
                        /**
                         * Converts this Blob to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Blob.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Blob
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Blob
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Blob.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Blob";
                        };
    
                        return Blob;
                    })();
    
                    v1beta.FileData = (function() {
    
                        /**
                         * Properties of a FileData.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IFileData
                         * @property {string|null} [mimeType] FileData mimeType
                         * @property {string|null} [fileUri] FileData fileUri
                         */
    
                        /**
                         * Constructs a new FileData.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a FileData.
                         * @implements IFileData
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IFileData=} [properties] Properties to set
                         */
                        function FileData(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * FileData mimeType.
                         * @member {string} mimeType
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @instance
                         */
                        FileData.prototype.mimeType = "";
    
                        /**
                         * FileData fileUri.
                         * @member {string} fileUri
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @instance
                         */
                        FileData.prototype.fileUri = "";
    
                        /**
                         * Creates a new FileData instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFileData=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.FileData} FileData instance
                         */
                        FileData.create = function create(properties) {
                            return new FileData(properties);
                        };
    
                        /**
                         * Encodes the specified FileData message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FileData.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFileData} message FileData message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FileData.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType);
                            if (message.fileUri != null && Object.hasOwnProperty.call(message, "fileUri"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.fileUri);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified FileData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FileData.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFileData} message FileData message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FileData.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a FileData message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.FileData} FileData
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FileData.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.FileData();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.mimeType = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.fileUri = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a FileData message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.FileData} FileData
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FileData.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a FileData message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        FileData.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                if (!$util.isString(message.mimeType))
                                    return "mimeType: string expected";
                            if (message.fileUri != null && message.hasOwnProperty("fileUri"))
                                if (!$util.isString(message.fileUri))
                                    return "fileUri: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a FileData message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.FileData} FileData
                         */
                        FileData.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.FileData)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.FileData();
                            if (object.mimeType != null)
                                message.mimeType = String(object.mimeType);
                            if (object.fileUri != null)
                                message.fileUri = String(object.fileUri);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a FileData message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.FileData} message FileData
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        FileData.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.mimeType = "";
                                object.fileUri = "";
                            }
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                object.mimeType = message.mimeType;
                            if (message.fileUri != null && message.hasOwnProperty("fileUri"))
                                object.fileUri = message.fileUri;
                            return object;
                        };
    
                        /**
                         * Converts this FileData to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        FileData.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for FileData
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.FileData
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        FileData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FileData";
                        };
    
                        return FileData;
                    })();
    
                    v1beta.ExecutableCode = (function() {
    
                        /**
                         * Properties of an ExecutableCode.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IExecutableCode
                         * @property {google.ai.generativelanguage.v1beta.ExecutableCode.Language|null} [language] ExecutableCode language
                         * @property {string|null} [code] ExecutableCode code
                         */
    
                        /**
                         * Constructs a new ExecutableCode.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an ExecutableCode.
                         * @implements IExecutableCode
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IExecutableCode=} [properties] Properties to set
                         */
                        function ExecutableCode(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ExecutableCode language.
                         * @member {google.ai.generativelanguage.v1beta.ExecutableCode.Language} language
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @instance
                         */
                        ExecutableCode.prototype.language = 0;
    
                        /**
                         * ExecutableCode code.
                         * @member {string} code
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @instance
                         */
                        ExecutableCode.prototype.code = "";
    
                        /**
                         * Creates a new ExecutableCode instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IExecutableCode=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ExecutableCode} ExecutableCode instance
                         */
                        ExecutableCode.create = function create(properties) {
                            return new ExecutableCode(properties);
                        };
    
                        /**
                         * Encodes the specified ExecutableCode message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ExecutableCode.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IExecutableCode} message ExecutableCode message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ExecutableCode.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.language != null && Object.hasOwnProperty.call(message, "language"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.language);
                            if (message.code != null && Object.hasOwnProperty.call(message, "code"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.code);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ExecutableCode message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ExecutableCode.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IExecutableCode} message ExecutableCode message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ExecutableCode.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an ExecutableCode message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ExecutableCode} ExecutableCode
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ExecutableCode.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ExecutableCode();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.language = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.code = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an ExecutableCode message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ExecutableCode} ExecutableCode
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ExecutableCode.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an ExecutableCode message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ExecutableCode.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.language != null && message.hasOwnProperty("language"))
                                switch (message.language) {
                                default:
                                    return "language: enum value expected";
                                case 0:
                                case 1:
                                    break;
                                }
                            if (message.code != null && message.hasOwnProperty("code"))
                                if (!$util.isString(message.code))
                                    return "code: string expected";
                            return null;
                        };
    
                        /**
                         * Creates an ExecutableCode message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ExecutableCode} ExecutableCode
                         */
                        ExecutableCode.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ExecutableCode)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ExecutableCode();
                            switch (object.language) {
                            default:
                                if (typeof object.language === "number") {
                                    message.language = object.language;
                                    break;
                                }
                                break;
                            case "LANGUAGE_UNSPECIFIED":
                            case 0:
                                message.language = 0;
                                break;
                            case "PYTHON":
                            case 1:
                                message.language = 1;
                                break;
                            }
                            if (object.code != null)
                                message.code = String(object.code);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an ExecutableCode message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ExecutableCode} message ExecutableCode
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ExecutableCode.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.language = options.enums === String ? "LANGUAGE_UNSPECIFIED" : 0;
                                object.code = "";
                            }
                            if (message.language != null && message.hasOwnProperty("language"))
                                object.language = options.enums === String ? $root.google.ai.generativelanguage.v1beta.ExecutableCode.Language[message.language] === undefined ? message.language : $root.google.ai.generativelanguage.v1beta.ExecutableCode.Language[message.language] : message.language;
                            if (message.code != null && message.hasOwnProperty("code"))
                                object.code = message.code;
                            return object;
                        };
    
                        /**
                         * Converts this ExecutableCode to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ExecutableCode.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ExecutableCode
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ExecutableCode
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ExecutableCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ExecutableCode";
                        };
    
                        /**
                         * Language enum.
                         * @name google.ai.generativelanguage.v1beta.ExecutableCode.Language
                         * @enum {number}
                         * @property {number} LANGUAGE_UNSPECIFIED=0 LANGUAGE_UNSPECIFIED value
                         * @property {number} PYTHON=1 PYTHON value
                         */
                        ExecutableCode.Language = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "LANGUAGE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "PYTHON"] = 1;
                            return values;
                        })();
    
                        return ExecutableCode;
                    })();
    
                    v1beta.CodeExecutionResult = (function() {
    
                        /**
                         * Properties of a CodeExecutionResult.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICodeExecutionResult
                         * @property {google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome|null} [outcome] CodeExecutionResult outcome
                         * @property {string|null} [output] CodeExecutionResult output
                         */
    
                        /**
                         * Constructs a new CodeExecutionResult.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CodeExecutionResult.
                         * @implements ICodeExecutionResult
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult=} [properties] Properties to set
                         */
                        function CodeExecutionResult(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CodeExecutionResult outcome.
                         * @member {google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome} outcome
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @instance
                         */
                        CodeExecutionResult.prototype.outcome = 0;
    
                        /**
                         * CodeExecutionResult output.
                         * @member {string} output
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @instance
                         */
                        CodeExecutionResult.prototype.output = "";
    
                        /**
                         * Creates a new CodeExecutionResult instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CodeExecutionResult} CodeExecutionResult instance
                         */
                        CodeExecutionResult.create = function create(properties) {
                            return new CodeExecutionResult(properties);
                        };
    
                        /**
                         * Encodes the specified CodeExecutionResult message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecutionResult.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CodeExecutionResult.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.outcome);
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.output);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CodeExecutionResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecutionResult.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CodeExecutionResult.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CodeExecutionResult message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CodeExecutionResult} CodeExecutionResult
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CodeExecutionResult.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CodeExecutionResult();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.outcome = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.output = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CodeExecutionResult message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CodeExecutionResult} CodeExecutionResult
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CodeExecutionResult.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CodeExecutionResult message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CodeExecutionResult.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.outcome != null && message.hasOwnProperty("outcome"))
                                switch (message.outcome) {
                                default:
                                    return "outcome: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            if (message.output != null && message.hasOwnProperty("output"))
                                if (!$util.isString(message.output))
                                    return "output: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a CodeExecutionResult message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CodeExecutionResult} CodeExecutionResult
                         */
                        CodeExecutionResult.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CodeExecutionResult)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CodeExecutionResult();
                            switch (object.outcome) {
                            default:
                                if (typeof object.outcome === "number") {
                                    message.outcome = object.outcome;
                                    break;
                                }
                                break;
                            case "OUTCOME_UNSPECIFIED":
                            case 0:
                                message.outcome = 0;
                                break;
                            case "OUTCOME_OK":
                            case 1:
                                message.outcome = 1;
                                break;
                            case "OUTCOME_FAILED":
                            case 2:
                                message.outcome = 2;
                                break;
                            case "OUTCOME_DEADLINE_EXCEEDED":
                            case 3:
                                message.outcome = 3;
                                break;
                            }
                            if (object.output != null)
                                message.output = String(object.output);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CodeExecutionResult message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CodeExecutionResult} message CodeExecutionResult
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CodeExecutionResult.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0;
                                object.output = "";
                            }
                            if (message.outcome != null && message.hasOwnProperty("outcome"))
                                object.outcome = options.enums === String ? $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome[message.outcome] : message.outcome;
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = message.output;
                            return object;
                        };
    
                        /**
                         * Converts this CodeExecutionResult to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CodeExecutionResult.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CodeExecutionResult
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CodeExecutionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CodeExecutionResult";
                        };
    
                        /**
                         * Outcome enum.
                         * @name google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome
                         * @enum {number}
                         * @property {number} OUTCOME_UNSPECIFIED=0 OUTCOME_UNSPECIFIED value
                         * @property {number} OUTCOME_OK=1 OUTCOME_OK value
                         * @property {number} OUTCOME_FAILED=2 OUTCOME_FAILED value
                         * @property {number} OUTCOME_DEADLINE_EXCEEDED=3 OUTCOME_DEADLINE_EXCEEDED value
                         */
                        CodeExecutionResult.Outcome = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "OUTCOME_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "OUTCOME_OK"] = 1;
                            values[valuesById[2] = "OUTCOME_FAILED"] = 2;
                            values[valuesById[3] = "OUTCOME_DEADLINE_EXCEEDED"] = 3;
                            return values;
                        })();
    
                        return CodeExecutionResult;
                    })();
    
                    v1beta.Tool = (function() {
    
                        /**
                         * Properties of a Tool.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ITool
                         * @property {Array.<google.ai.generativelanguage.v1beta.IFunctionDeclaration>|null} [functionDeclarations] Tool functionDeclarations
                         * @property {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval|null} [googleSearchRetrieval] Tool googleSearchRetrieval
                         * @property {google.ai.generativelanguage.v1beta.ICodeExecution|null} [codeExecution] Tool codeExecution
                         * @property {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch|null} [googleSearch] Tool googleSearch
                         */
    
                        /**
                         * Constructs a new Tool.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Tool.
                         * @implements ITool
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ITool=} [properties] Properties to set
                         */
                        function Tool(properties) {
                            this.functionDeclarations = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Tool functionDeclarations.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IFunctionDeclaration>} functionDeclarations
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @instance
                         */
                        Tool.prototype.functionDeclarations = $util.emptyArray;
    
                        /**
                         * Tool googleSearchRetrieval.
                         * @member {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval|null|undefined} googleSearchRetrieval
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @instance
                         */
                        Tool.prototype.googleSearchRetrieval = null;
    
                        /**
                         * Tool codeExecution.
                         * @member {google.ai.generativelanguage.v1beta.ICodeExecution|null|undefined} codeExecution
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @instance
                         */
                        Tool.prototype.codeExecution = null;
    
                        /**
                         * Tool googleSearch.
                         * @member {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch|null|undefined} googleSearch
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @instance
                         */
                        Tool.prototype.googleSearch = null;
    
                        /**
                         * Creates a new Tool instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITool=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Tool} Tool instance
                         */
                        Tool.create = function create(properties) {
                            return new Tool(properties);
                        };
    
                        /**
                         * Encodes the specified Tool message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITool} message Tool message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Tool.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.functionDeclarations != null && message.functionDeclarations.length)
                                for (var i = 0; i < message.functionDeclarations.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.encode(message.functionDeclarations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.googleSearchRetrieval != null && Object.hasOwnProperty.call(message, "googleSearchRetrieval"))
                                $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.encode(message.googleSearchRetrieval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.codeExecution != null && Object.hasOwnProperty.call(message, "codeExecution"))
                                $root.google.ai.generativelanguage.v1beta.CodeExecution.encode(message.codeExecution, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.googleSearch != null && Object.hasOwnProperty.call(message, "googleSearch"))
                                $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.encode(message.googleSearch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITool} message Tool message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Tool.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Tool message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Tool} Tool
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Tool.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Tool();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.functionDeclarations && message.functionDeclarations.length))
                                            message.functionDeclarations = [];
                                        message.functionDeclarations.push($root.google.ai.generativelanguage.v1beta.FunctionDeclaration.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.googleSearchRetrieval = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.codeExecution = $root.google.ai.generativelanguage.v1beta.CodeExecution.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.googleSearch = $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Tool message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Tool} Tool
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Tool.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Tool message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Tool.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.functionDeclarations != null && message.hasOwnProperty("functionDeclarations")) {
                                if (!Array.isArray(message.functionDeclarations))
                                    return "functionDeclarations: array expected";
                                for (var i = 0; i < message.functionDeclarations.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.verify(message.functionDeclarations[i]);
                                    if (error)
                                        return "functionDeclarations." + error;
                                }
                            }
                            if (message.googleSearchRetrieval != null && message.hasOwnProperty("googleSearchRetrieval")) {
                                var error = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify(message.googleSearchRetrieval);
                                if (error)
                                    return "googleSearchRetrieval." + error;
                            }
                            if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) {
                                var error = $root.google.ai.generativelanguage.v1beta.CodeExecution.verify(message.codeExecution);
                                if (error)
                                    return "codeExecution." + error;
                            }
                            if (message.googleSearch != null && message.hasOwnProperty("googleSearch")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.verify(message.googleSearch);
                                if (error)
                                    return "googleSearch." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Tool message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Tool} Tool
                         */
                        Tool.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Tool)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Tool();
                            if (object.functionDeclarations) {
                                if (!Array.isArray(object.functionDeclarations))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Tool.functionDeclarations: array expected");
                                message.functionDeclarations = [];
                                for (var i = 0; i < object.functionDeclarations.length; ++i) {
                                    if (typeof object.functionDeclarations[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.Tool.functionDeclarations: object expected");
                                    message.functionDeclarations[i] = $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.fromObject(object.functionDeclarations[i]);
                                }
                            }
                            if (object.googleSearchRetrieval != null) {
                                if (typeof object.googleSearchRetrieval !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Tool.googleSearchRetrieval: object expected");
                                message.googleSearchRetrieval = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.fromObject(object.googleSearchRetrieval);
                            }
                            if (object.codeExecution != null) {
                                if (typeof object.codeExecution !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Tool.codeExecution: object expected");
                                message.codeExecution = $root.google.ai.generativelanguage.v1beta.CodeExecution.fromObject(object.codeExecution);
                            }
                            if (object.googleSearch != null) {
                                if (typeof object.googleSearch !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Tool.googleSearch: object expected");
                                message.googleSearch = $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.fromObject(object.googleSearch);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Tool message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Tool} message Tool
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Tool.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.functionDeclarations = [];
                            if (options.defaults) {
                                object.googleSearchRetrieval = null;
                                object.codeExecution = null;
                                object.googleSearch = null;
                            }
                            if (message.functionDeclarations && message.functionDeclarations.length) {
                                object.functionDeclarations = [];
                                for (var j = 0; j < message.functionDeclarations.length; ++j)
                                    object.functionDeclarations[j] = $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.toObject(message.functionDeclarations[j], options);
                            }
                            if (message.googleSearchRetrieval != null && message.hasOwnProperty("googleSearchRetrieval"))
                                object.googleSearchRetrieval = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.toObject(message.googleSearchRetrieval, options);
                            if (message.codeExecution != null && message.hasOwnProperty("codeExecution"))
                                object.codeExecution = $root.google.ai.generativelanguage.v1beta.CodeExecution.toObject(message.codeExecution, options);
                            if (message.googleSearch != null && message.hasOwnProperty("googleSearch"))
                                object.googleSearch = $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.toObject(message.googleSearch, options);
                            return object;
                        };
    
                        /**
                         * Converts this Tool to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Tool.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Tool
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Tool
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Tool.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Tool";
                        };
    
                        Tool.GoogleSearch = (function() {
    
                            /**
                             * Properties of a GoogleSearch.
                             * @memberof google.ai.generativelanguage.v1beta.Tool
                             * @interface IGoogleSearch
                             */
    
                            /**
                             * Constructs a new GoogleSearch.
                             * @memberof google.ai.generativelanguage.v1beta.Tool
                             * @classdesc Represents a GoogleSearch.
                             * @implements IGoogleSearch
                             * @constructor
                             * @param {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch=} [properties] Properties to set
                             */
                            function GoogleSearch(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * Creates a new GoogleSearch instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1beta.Tool.GoogleSearch} GoogleSearch instance
                             */
                            GoogleSearch.create = function create(properties) {
                                return new GoogleSearch(properties);
                            };
    
                            /**
                             * Encodes the specified GoogleSearch message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.GoogleSearch.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch} message GoogleSearch message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            GoogleSearch.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                return writer;
                            };
    
                            /**
                             * Encodes the specified GoogleSearch message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.GoogleSearch.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch} message GoogleSearch message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            GoogleSearch.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a GoogleSearch message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1beta.Tool.GoogleSearch} GoogleSearch
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            GoogleSearch.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a GoogleSearch message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1beta.Tool.GoogleSearch} GoogleSearch
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            GoogleSearch.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a GoogleSearch message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            GoogleSearch.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                return null;
                            };
    
                            /**
                             * Creates a GoogleSearch message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1beta.Tool.GoogleSearch} GoogleSearch
                             */
                            GoogleSearch.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch)
                                    return object;
                                return new $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch();
                            };
    
                            /**
                             * Creates a plain object from a GoogleSearch message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.Tool.GoogleSearch} message GoogleSearch
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            GoogleSearch.toObject = function toObject() {
                                return {};
                            };
    
                            /**
                             * Converts this GoogleSearch to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            GoogleSearch.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for GoogleSearch
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            GoogleSearch.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Tool.GoogleSearch";
                            };
    
                            return GoogleSearch;
                        })();
    
                        return Tool;
                    })();
    
                    v1beta.GoogleSearchRetrieval = (function() {
    
                        /**
                         * Properties of a GoogleSearchRetrieval.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGoogleSearchRetrieval
                         * @property {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig|null} [dynamicRetrievalConfig] GoogleSearchRetrieval dynamicRetrievalConfig
                         */
    
                        /**
                         * Constructs a new GoogleSearchRetrieval.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GoogleSearchRetrieval.
                         * @implements IGoogleSearchRetrieval
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval=} [properties] Properties to set
                         */
                        function GoogleSearchRetrieval(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GoogleSearchRetrieval dynamicRetrievalConfig.
                         * @member {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig|null|undefined} dynamicRetrievalConfig
                         * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval
                         * @instance
                         */
                        GoogleSearchRetrieval.prototype.dynamicRetrievalConfig = null;
    
                        /**
                         * Creates a new GoogleSearchRetrieval instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} GoogleSearchRetrieval instance
                         */
                        GoogleSearchRetrieval.create = function create(properties) {
                            return new GoogleSearchRetrieval(properties);
                        };
    
                        /**
                         * Encodes the specified GoogleSearchRetrieval message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval} message GoogleSearchRetrieval message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GoogleSearchRetrieval.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.dynamicRetrievalConfig != null && Object.hasOwnProperty.call(message, "dynamicRetrievalConfig"))
                                $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.encode(message.dynamicRetrievalConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GoogleSearchRetrieval message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval} message GoogleSearchRetrieval message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GoogleSearchRetrieval.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GoogleSearchRetrieval message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} GoogleSearchRetrieval
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GoogleSearchRetrieval.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GoogleSearchRetrieval message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} GoogleSearchRetrieval
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GoogleSearchRetrieval.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GoogleSearchRetrieval message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GoogleSearchRetrieval.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.dynamicRetrievalConfig != null && message.hasOwnProperty("dynamicRetrievalConfig")) {
                                var error = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.verify(message.dynamicRetrievalConfig);
                                if (error)
                                    return "dynamicRetrievalConfig." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GoogleSearchRetrieval message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} GoogleSearchRetrieval
                         */
                        GoogleSearchRetrieval.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval();
                            if (object.dynamicRetrievalConfig != null) {
                                if (typeof object.dynamicRetrievalConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.dynamicRetrievalConfig: object expected");
                                message.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.fromObject(object.dynamicRetrievalConfig);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GoogleSearchRetrieval message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} message GoogleSearchRetrieval
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GoogleSearchRetrieval.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.dynamicRetrievalConfig = null;
                            if (message.dynamicRetrievalConfig != null && message.hasOwnProperty("dynamicRetrievalConfig"))
                                object.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.toObject(message.dynamicRetrievalConfig, options);
                            return object;
                        };
    
                        /**
                         * Converts this GoogleSearchRetrieval to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GoogleSearchRetrieval.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GoogleSearchRetrieval
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GoogleSearchRetrieval.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GoogleSearchRetrieval";
                        };
    
                        return GoogleSearchRetrieval;
                    })();
    
                    v1beta.DynamicRetrievalConfig = (function() {
    
                        /**
                         * Properties of a DynamicRetrievalConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IDynamicRetrievalConfig
                         * @property {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode|null} [mode] DynamicRetrievalConfig mode
                         * @property {number|null} [dynamicThreshold] DynamicRetrievalConfig dynamicThreshold
                         */
    
                        /**
                         * Constructs a new DynamicRetrievalConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a DynamicRetrievalConfig.
                         * @implements IDynamicRetrievalConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig=} [properties] Properties to set
                         */
                        function DynamicRetrievalConfig(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DynamicRetrievalConfig mode.
                         * @member {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode} mode
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @instance
                         */
                        DynamicRetrievalConfig.prototype.mode = 0;
    
                        /**
                         * DynamicRetrievalConfig dynamicThreshold.
                         * @member {number|null|undefined} dynamicThreshold
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @instance
                         */
                        DynamicRetrievalConfig.prototype.dynamicThreshold = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * DynamicRetrievalConfig _dynamicThreshold.
                         * @member {"dynamicThreshold"|undefined} _dynamicThreshold
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @instance
                         */
                        Object.defineProperty(DynamicRetrievalConfig.prototype, "_dynamicThreshold", {
                            get: $util.oneOfGetter($oneOfFields = ["dynamicThreshold"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new DynamicRetrievalConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} DynamicRetrievalConfig instance
                         */
                        DynamicRetrievalConfig.create = function create(properties) {
                            return new DynamicRetrievalConfig(properties);
                        };
    
                        /**
                         * Encodes the specified DynamicRetrievalConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig} message DynamicRetrievalConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DynamicRetrievalConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.mode != null && Object.hasOwnProperty.call(message, "mode"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode);
                            if (message.dynamicThreshold != null && Object.hasOwnProperty.call(message, "dynamicThreshold"))
                                writer.uint32(/* id 2, wireType 5 =*/21).float(message.dynamicThreshold);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DynamicRetrievalConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig} message DynamicRetrievalConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DynamicRetrievalConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DynamicRetrievalConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} DynamicRetrievalConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DynamicRetrievalConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.mode = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.dynamicThreshold = reader.float();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DynamicRetrievalConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} DynamicRetrievalConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DynamicRetrievalConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DynamicRetrievalConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DynamicRetrievalConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.mode != null && message.hasOwnProperty("mode"))
                                switch (message.mode) {
                                default:
                                    return "mode: enum value expected";
                                case 0:
                                case 1:
                                    break;
                                }
                            if (message.dynamicThreshold != null && message.hasOwnProperty("dynamicThreshold")) {
                                properties._dynamicThreshold = 1;
                                if (typeof message.dynamicThreshold !== "number")
                                    return "dynamicThreshold: number expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a DynamicRetrievalConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} DynamicRetrievalConfig
                         */
                        DynamicRetrievalConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig();
                            switch (object.mode) {
                            default:
                                if (typeof object.mode === "number") {
                                    message.mode = object.mode;
                                    break;
                                }
                                break;
                            case "MODE_UNSPECIFIED":
                            case 0:
                                message.mode = 0;
                                break;
                            case "MODE_DYNAMIC":
                            case 1:
                                message.mode = 1;
                                break;
                            }
                            if (object.dynamicThreshold != null)
                                message.dynamicThreshold = Number(object.dynamicThreshold);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DynamicRetrievalConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} message DynamicRetrievalConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DynamicRetrievalConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0;
                            if (message.mode != null && message.hasOwnProperty("mode"))
                                object.mode = options.enums === String ? $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode[message.mode] === undefined ? message.mode : $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode[message.mode] : message.mode;
                            if (message.dynamicThreshold != null && message.hasOwnProperty("dynamicThreshold")) {
                                object.dynamicThreshold = options.json && !isFinite(message.dynamicThreshold) ? String(message.dynamicThreshold) : message.dynamicThreshold;
                                if (options.oneofs)
                                    object._dynamicThreshold = "dynamicThreshold";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this DynamicRetrievalConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DynamicRetrievalConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DynamicRetrievalConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DynamicRetrievalConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DynamicRetrievalConfig";
                        };
    
                        /**
                         * Mode enum.
                         * @name google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode
                         * @enum {number}
                         * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value
                         * @property {number} MODE_DYNAMIC=1 MODE_DYNAMIC value
                         */
                        DynamicRetrievalConfig.Mode = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "MODE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "MODE_DYNAMIC"] = 1;
                            return values;
                        })();
    
                        return DynamicRetrievalConfig;
                    })();
    
                    v1beta.CodeExecution = (function() {
    
                        /**
                         * Properties of a CodeExecution.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICodeExecution
                         */
    
                        /**
                         * Constructs a new CodeExecution.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CodeExecution.
                         * @implements ICodeExecution
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICodeExecution=} [properties] Properties to set
                         */
                        function CodeExecution(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Creates a new CodeExecution instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecution
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICodeExecution=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CodeExecution} CodeExecution instance
                         */
                        CodeExecution.create = function create(properties) {
                            return new CodeExecution(properties);
                        };
    
                        /**
                         * Encodes the specified CodeExecution message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecution.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecution
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICodeExecution} message CodeExecution message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CodeExecution.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CodeExecution message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecution.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecution
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICodeExecution} message CodeExecution message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CodeExecution.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CodeExecution message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecution
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CodeExecution} CodeExecution
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CodeExecution.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CodeExecution();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CodeExecution message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecution
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CodeExecution} CodeExecution
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CodeExecution.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CodeExecution message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecution
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CodeExecution.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            return null;
                        };
    
                        /**
                         * Creates a CodeExecution message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecution
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CodeExecution} CodeExecution
                         */
                        CodeExecution.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CodeExecution)
                                return object;
                            return new $root.google.ai.generativelanguage.v1beta.CodeExecution();
                        };
    
                        /**
                         * Creates a plain object from a CodeExecution message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecution
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CodeExecution} message CodeExecution
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CodeExecution.toObject = function toObject() {
                            return {};
                        };
    
                        /**
                         * Converts this CodeExecution to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecution
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CodeExecution.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CodeExecution
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CodeExecution
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CodeExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CodeExecution";
                        };
    
                        return CodeExecution;
                    })();
    
                    v1beta.ToolConfig = (function() {
    
                        /**
                         * Properties of a ToolConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IToolConfig
                         * @property {google.ai.generativelanguage.v1beta.IFunctionCallingConfig|null} [functionCallingConfig] ToolConfig functionCallingConfig
                         */
    
                        /**
                         * Constructs a new ToolConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ToolConfig.
                         * @implements IToolConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IToolConfig=} [properties] Properties to set
                         */
                        function ToolConfig(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ToolConfig functionCallingConfig.
                         * @member {google.ai.generativelanguage.v1beta.IFunctionCallingConfig|null|undefined} functionCallingConfig
                         * @memberof google.ai.generativelanguage.v1beta.ToolConfig
                         * @instance
                         */
                        ToolConfig.prototype.functionCallingConfig = null;
    
                        /**
                         * Creates a new ToolConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ToolConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IToolConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ToolConfig} ToolConfig instance
                         */
                        ToolConfig.create = function create(properties) {
                            return new ToolConfig(properties);
                        };
    
                        /**
                         * Encodes the specified ToolConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ToolConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ToolConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IToolConfig} message ToolConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ToolConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.functionCallingConfig != null && Object.hasOwnProperty.call(message, "functionCallingConfig"))
                                $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.encode(message.functionCallingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ToolConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ToolConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ToolConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IToolConfig} message ToolConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ToolConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ToolConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ToolConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ToolConfig} ToolConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ToolConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ToolConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.functionCallingConfig = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ToolConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ToolConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ToolConfig} ToolConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ToolConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ToolConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ToolConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ToolConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.functionCallingConfig != null && message.hasOwnProperty("functionCallingConfig")) {
                                var error = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.verify(message.functionCallingConfig);
                                if (error)
                                    return "functionCallingConfig." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a ToolConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ToolConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ToolConfig} ToolConfig
                         */
                        ToolConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ToolConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ToolConfig();
                            if (object.functionCallingConfig != null) {
                                if (typeof object.functionCallingConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.ToolConfig.functionCallingConfig: object expected");
                                message.functionCallingConfig = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.fromObject(object.functionCallingConfig);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ToolConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ToolConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ToolConfig} message ToolConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ToolConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.functionCallingConfig = null;
                            if (message.functionCallingConfig != null && message.hasOwnProperty("functionCallingConfig"))
                                object.functionCallingConfig = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.toObject(message.functionCallingConfig, options);
                            return object;
                        };
    
                        /**
                         * Converts this ToolConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ToolConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ToolConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ToolConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ToolConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ToolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ToolConfig";
                        };
    
                        return ToolConfig;
                    })();
    
                    v1beta.FunctionCallingConfig = (function() {
    
                        /**
                         * Properties of a FunctionCallingConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IFunctionCallingConfig
                         * @property {google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode|null} [mode] FunctionCallingConfig mode
                         * @property {Array.<string>|null} [allowedFunctionNames] FunctionCallingConfig allowedFunctionNames
                         */
    
                        /**
                         * Constructs a new FunctionCallingConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a FunctionCallingConfig.
                         * @implements IFunctionCallingConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig=} [properties] Properties to set
                         */
                        function FunctionCallingConfig(properties) {
                            this.allowedFunctionNames = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * FunctionCallingConfig mode.
                         * @member {google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode} mode
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @instance
                         */
                        FunctionCallingConfig.prototype.mode = 0;
    
                        /**
                         * FunctionCallingConfig allowedFunctionNames.
                         * @member {Array.<string>} allowedFunctionNames
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @instance
                         */
                        FunctionCallingConfig.prototype.allowedFunctionNames = $util.emptyArray;
    
                        /**
                         * Creates a new FunctionCallingConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.FunctionCallingConfig} FunctionCallingConfig instance
                         */
                        FunctionCallingConfig.create = function create(properties) {
                            return new FunctionCallingConfig(properties);
                        };
    
                        /**
                         * Encodes the specified FunctionCallingConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCallingConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig} message FunctionCallingConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionCallingConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.mode != null && Object.hasOwnProperty.call(message, "mode"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode);
                            if (message.allowedFunctionNames != null && message.allowedFunctionNames.length)
                                for (var i = 0; i < message.allowedFunctionNames.length; ++i)
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedFunctionNames[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified FunctionCallingConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCallingConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig} message FunctionCallingConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionCallingConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a FunctionCallingConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.FunctionCallingConfig} FunctionCallingConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionCallingConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.mode = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.allowedFunctionNames && message.allowedFunctionNames.length))
                                            message.allowedFunctionNames = [];
                                        message.allowedFunctionNames.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a FunctionCallingConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.FunctionCallingConfig} FunctionCallingConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionCallingConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a FunctionCallingConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        FunctionCallingConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.mode != null && message.hasOwnProperty("mode"))
                                switch (message.mode) {
                                default:
                                    return "mode: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            if (message.allowedFunctionNames != null && message.hasOwnProperty("allowedFunctionNames")) {
                                if (!Array.isArray(message.allowedFunctionNames))
                                    return "allowedFunctionNames: array expected";
                                for (var i = 0; i < message.allowedFunctionNames.length; ++i)
                                    if (!$util.isString(message.allowedFunctionNames[i]))
                                        return "allowedFunctionNames: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a FunctionCallingConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.FunctionCallingConfig} FunctionCallingConfig
                         */
                        FunctionCallingConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig();
                            switch (object.mode) {
                            default:
                                if (typeof object.mode === "number") {
                                    message.mode = object.mode;
                                    break;
                                }
                                break;
                            case "MODE_UNSPECIFIED":
                            case 0:
                                message.mode = 0;
                                break;
                            case "AUTO":
                            case 1:
                                message.mode = 1;
                                break;
                            case "ANY":
                            case 2:
                                message.mode = 2;
                                break;
                            case "NONE":
                            case 3:
                                message.mode = 3;
                                break;
                            }
                            if (object.allowedFunctionNames) {
                                if (!Array.isArray(object.allowedFunctionNames))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.FunctionCallingConfig.allowedFunctionNames: array expected");
                                message.allowedFunctionNames = [];
                                for (var i = 0; i < object.allowedFunctionNames.length; ++i)
                                    message.allowedFunctionNames[i] = String(object.allowedFunctionNames[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a FunctionCallingConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.FunctionCallingConfig} message FunctionCallingConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        FunctionCallingConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.allowedFunctionNames = [];
                            if (options.defaults)
                                object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0;
                            if (message.mode != null && message.hasOwnProperty("mode"))
                                object.mode = options.enums === String ? $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode[message.mode] === undefined ? message.mode : $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode[message.mode] : message.mode;
                            if (message.allowedFunctionNames && message.allowedFunctionNames.length) {
                                object.allowedFunctionNames = [];
                                for (var j = 0; j < message.allowedFunctionNames.length; ++j)
                                    object.allowedFunctionNames[j] = message.allowedFunctionNames[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this FunctionCallingConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        FunctionCallingConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for FunctionCallingConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        FunctionCallingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionCallingConfig";
                        };
    
                        /**
                         * Mode enum.
                         * @name google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode
                         * @enum {number}
                         * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value
                         * @property {number} AUTO=1 AUTO value
                         * @property {number} ANY=2 ANY value
                         * @property {number} NONE=3 NONE value
                         */
                        FunctionCallingConfig.Mode = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "MODE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "AUTO"] = 1;
                            values[valuesById[2] = "ANY"] = 2;
                            values[valuesById[3] = "NONE"] = 3;
                            return values;
                        })();
    
                        return FunctionCallingConfig;
                    })();
    
                    v1beta.FunctionDeclaration = (function() {
    
                        /**
                         * Properties of a FunctionDeclaration.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IFunctionDeclaration
                         * @property {string|null} [name] FunctionDeclaration name
                         * @property {string|null} [description] FunctionDeclaration description
                         * @property {google.ai.generativelanguage.v1beta.ISchema|null} [parameters] FunctionDeclaration parameters
                         * @property {google.ai.generativelanguage.v1beta.ISchema|null} [response] FunctionDeclaration response
                         */
    
                        /**
                         * Constructs a new FunctionDeclaration.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a FunctionDeclaration.
                         * @implements IFunctionDeclaration
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration=} [properties] Properties to set
                         */
                        function FunctionDeclaration(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * FunctionDeclaration name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @instance
                         */
                        FunctionDeclaration.prototype.name = "";
    
                        /**
                         * FunctionDeclaration description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @instance
                         */
                        FunctionDeclaration.prototype.description = "";
    
                        /**
                         * FunctionDeclaration parameters.
                         * @member {google.ai.generativelanguage.v1beta.ISchema|null|undefined} parameters
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @instance
                         */
                        FunctionDeclaration.prototype.parameters = null;
    
                        /**
                         * FunctionDeclaration response.
                         * @member {google.ai.generativelanguage.v1beta.ISchema|null|undefined} response
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @instance
                         */
                        FunctionDeclaration.prototype.response = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * FunctionDeclaration _parameters.
                         * @member {"parameters"|undefined} _parameters
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @instance
                         */
                        Object.defineProperty(FunctionDeclaration.prototype, "_parameters", {
                            get: $util.oneOfGetter($oneOfFields = ["parameters"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * FunctionDeclaration _response.
                         * @member {"response"|undefined} _response
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @instance
                         */
                        Object.defineProperty(FunctionDeclaration.prototype, "_response", {
                            get: $util.oneOfGetter($oneOfFields = ["response"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new FunctionDeclaration instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.FunctionDeclaration} FunctionDeclaration instance
                         */
                        FunctionDeclaration.create = function create(properties) {
                            return new FunctionDeclaration(properties);
                        };
    
                        /**
                         * Encodes the specified FunctionDeclaration message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionDeclaration.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration} message FunctionDeclaration message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionDeclaration.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
                            if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters"))
                                $root.google.ai.generativelanguage.v1beta.Schema.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.response != null && Object.hasOwnProperty.call(message, "response"))
                                $root.google.ai.generativelanguage.v1beta.Schema.encode(message.response, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified FunctionDeclaration message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionDeclaration.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration} message FunctionDeclaration message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionDeclaration.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a FunctionDeclaration message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.FunctionDeclaration} FunctionDeclaration
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionDeclaration.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.FunctionDeclaration();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.parameters = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.response = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a FunctionDeclaration message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.FunctionDeclaration} FunctionDeclaration
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionDeclaration.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a FunctionDeclaration message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        FunctionDeclaration.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.parameters != null && message.hasOwnProperty("parameters")) {
                                properties._parameters = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.parameters);
                                    if (error)
                                        return "parameters." + error;
                                }
                            }
                            if (message.response != null && message.hasOwnProperty("response")) {
                                properties._response = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.response);
                                    if (error)
                                        return "response." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a FunctionDeclaration message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.FunctionDeclaration} FunctionDeclaration
                         */
                        FunctionDeclaration.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionDeclaration)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.FunctionDeclaration();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.parameters != null) {
                                if (typeof object.parameters !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.FunctionDeclaration.parameters: object expected");
                                message.parameters = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.parameters);
                            }
                            if (object.response != null) {
                                if (typeof object.response !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.FunctionDeclaration.response: object expected");
                                message.response = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.response);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a FunctionDeclaration message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.FunctionDeclaration} message FunctionDeclaration
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        FunctionDeclaration.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.description = "";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.parameters != null && message.hasOwnProperty("parameters")) {
                                object.parameters = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.parameters, options);
                                if (options.oneofs)
                                    object._parameters = "parameters";
                            }
                            if (message.response != null && message.hasOwnProperty("response")) {
                                object.response = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.response, options);
                                if (options.oneofs)
                                    object._response = "response";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this FunctionDeclaration to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        FunctionDeclaration.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for FunctionDeclaration
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        FunctionDeclaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionDeclaration";
                        };
    
                        return FunctionDeclaration;
                    })();
    
                    v1beta.FunctionCall = (function() {
    
                        /**
                         * Properties of a FunctionCall.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IFunctionCall
                         * @property {string|null} [id] FunctionCall id
                         * @property {string|null} [name] FunctionCall name
                         * @property {google.protobuf.IStruct|null} [args] FunctionCall args
                         */
    
                        /**
                         * Constructs a new FunctionCall.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a FunctionCall.
                         * @implements IFunctionCall
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IFunctionCall=} [properties] Properties to set
                         */
                        function FunctionCall(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * FunctionCall id.
                         * @member {string} id
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @instance
                         */
                        FunctionCall.prototype.id = "";
    
                        /**
                         * FunctionCall name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @instance
                         */
                        FunctionCall.prototype.name = "";
    
                        /**
                         * FunctionCall args.
                         * @member {google.protobuf.IStruct|null|undefined} args
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @instance
                         */
                        FunctionCall.prototype.args = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * FunctionCall _args.
                         * @member {"args"|undefined} _args
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @instance
                         */
                        Object.defineProperty(FunctionCall.prototype, "_args", {
                            get: $util.oneOfGetter($oneOfFields = ["args"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new FunctionCall instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionCall=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.FunctionCall} FunctionCall instance
                         */
                        FunctionCall.create = function create(properties) {
                            return new FunctionCall(properties);
                        };
    
                        /**
                         * Encodes the specified FunctionCall message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCall.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionCall} message FunctionCall message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionCall.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.args != null && Object.hasOwnProperty.call(message, "args"))
                                $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.id);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified FunctionCall message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCall.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionCall} message FunctionCall message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionCall.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a FunctionCall message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.FunctionCall} FunctionCall
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionCall.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.FunctionCall();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.id = reader.string();
                                        break;
                                    }
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a FunctionCall message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.FunctionCall} FunctionCall
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionCall.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a FunctionCall message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        FunctionCall.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.id != null && message.hasOwnProperty("id"))
                                if (!$util.isString(message.id))
                                    return "id: string expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.args != null && message.hasOwnProperty("args")) {
                                properties._args = 1;
                                {
                                    var error = $root.google.protobuf.Struct.verify(message.args);
                                    if (error)
                                        return "args." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a FunctionCall message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.FunctionCall} FunctionCall
                         */
                        FunctionCall.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionCall)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.FunctionCall();
                            if (object.id != null)
                                message.id = String(object.id);
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.args != null) {
                                if (typeof object.args !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.FunctionCall.args: object expected");
                                message.args = $root.google.protobuf.Struct.fromObject(object.args);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a FunctionCall message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.FunctionCall} message FunctionCall
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        FunctionCall.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.id = "";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.args != null && message.hasOwnProperty("args")) {
                                object.args = $root.google.protobuf.Struct.toObject(message.args, options);
                                if (options.oneofs)
                                    object._args = "args";
                            }
                            if (message.id != null && message.hasOwnProperty("id"))
                                object.id = message.id;
                            return object;
                        };
    
                        /**
                         * Converts this FunctionCall to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        FunctionCall.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for FunctionCall
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.FunctionCall
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        FunctionCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionCall";
                        };
    
                        return FunctionCall;
                    })();
    
                    v1beta.FunctionResponse = (function() {
    
                        /**
                         * Properties of a FunctionResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IFunctionResponse
                         * @property {string|null} [id] FunctionResponse id
                         * @property {string|null} [name] FunctionResponse name
                         * @property {google.protobuf.IStruct|null} [response] FunctionResponse response
                         */
    
                        /**
                         * Constructs a new FunctionResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a FunctionResponse.
                         * @implements IFunctionResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IFunctionResponse=} [properties] Properties to set
                         */
                        function FunctionResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * FunctionResponse id.
                         * @member {string} id
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @instance
                         */
                        FunctionResponse.prototype.id = "";
    
                        /**
                         * FunctionResponse name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @instance
                         */
                        FunctionResponse.prototype.name = "";
    
                        /**
                         * FunctionResponse response.
                         * @member {google.protobuf.IStruct|null|undefined} response
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @instance
                         */
                        FunctionResponse.prototype.response = null;
    
                        /**
                         * Creates a new FunctionResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.FunctionResponse} FunctionResponse instance
                         */
                        FunctionResponse.create = function create(properties) {
                            return new FunctionResponse(properties);
                        };
    
                        /**
                         * Encodes the specified FunctionResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionResponse} message FunctionResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.response != null && Object.hasOwnProperty.call(message, "response"))
                                $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.id);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified FunctionResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFunctionResponse} message FunctionResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        FunctionResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a FunctionResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.FunctionResponse} FunctionResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.FunctionResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.id = reader.string();
                                        break;
                                    }
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a FunctionResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.FunctionResponse} FunctionResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        FunctionResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a FunctionResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        FunctionResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.id != null && message.hasOwnProperty("id"))
                                if (!$util.isString(message.id))
                                    return "id: string expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.response != null && message.hasOwnProperty("response")) {
                                var error = $root.google.protobuf.Struct.verify(message.response);
                                if (error)
                                    return "response." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a FunctionResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.FunctionResponse} FunctionResponse
                         */
                        FunctionResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.FunctionResponse();
                            if (object.id != null)
                                message.id = String(object.id);
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.response != null) {
                                if (typeof object.response !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.FunctionResponse.response: object expected");
                                message.response = $root.google.protobuf.Struct.fromObject(object.response);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a FunctionResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.FunctionResponse} message FunctionResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        FunctionResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.response = null;
                                object.id = "";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.response != null && message.hasOwnProperty("response"))
                                object.response = $root.google.protobuf.Struct.toObject(message.response, options);
                            if (message.id != null && message.hasOwnProperty("id"))
                                object.id = message.id;
                            return object;
                        };
    
                        /**
                         * Converts this FunctionResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        FunctionResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for FunctionResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.FunctionResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        FunctionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionResponse";
                        };
    
                        return FunctionResponse;
                    })();
    
                    v1beta.Schema = (function() {
    
                        /**
                         * Properties of a Schema.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ISchema
                         * @property {google.ai.generativelanguage.v1beta.Type|null} [type] Schema type
                         * @property {string|null} [format] Schema format
                         * @property {string|null} [description] Schema description
                         * @property {boolean|null} [nullable] Schema nullable
                         * @property {Array.<string>|null} ["enum"] Schema enum
                         * @property {google.ai.generativelanguage.v1beta.ISchema|null} [items] Schema items
                         * @property {number|Long|null} [maxItems] Schema maxItems
                         * @property {number|Long|null} [minItems] Schema minItems
                         * @property {Object.<string,google.ai.generativelanguage.v1beta.ISchema>|null} [properties] Schema properties
                         * @property {Array.<string>|null} [required] Schema required
                         */
    
                        /**
                         * Constructs a new Schema.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Schema.
                         * @implements ISchema
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ISchema=} [properties] Properties to set
                         */
                        function Schema(properties) {
                            this["enum"] = [];
                            this.properties = {};
                            this.required = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Schema type.
                         * @member {google.ai.generativelanguage.v1beta.Type} type
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         */
                        Schema.prototype.type = 0;
    
                        /**
                         * Schema format.
                         * @member {string} format
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         */
                        Schema.prototype.format = "";
    
                        /**
                         * Schema description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         */
                        Schema.prototype.description = "";
    
                        /**
                         * Schema nullable.
                         * @member {boolean} nullable
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         */
                        Schema.prototype.nullable = false;
    
                        /**
                         * Schema enum.
                         * @member {Array.<string>} enum
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         */
                        Schema.prototype["enum"] = $util.emptyArray;
    
                        /**
                         * Schema items.
                         * @member {google.ai.generativelanguage.v1beta.ISchema|null|undefined} items
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         */
                        Schema.prototype.items = null;
    
                        /**
                         * Schema maxItems.
                         * @member {number|Long} maxItems
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         */
                        Schema.prototype.maxItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
    
                        /**
                         * Schema minItems.
                         * @member {number|Long} minItems
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         */
                        Schema.prototype.minItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
    
                        /**
                         * Schema properties.
                         * @member {Object.<string,google.ai.generativelanguage.v1beta.ISchema>} properties
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         */
                        Schema.prototype.properties = $util.emptyObject;
    
                        /**
                         * Schema required.
                         * @member {Array.<string>} required
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         */
                        Schema.prototype.required = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Schema _items.
                         * @member {"items"|undefined} _items
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         */
                        Object.defineProperty(Schema.prototype, "_items", {
                            get: $util.oneOfGetter($oneOfFields = ["items"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Schema instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISchema=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Schema} Schema instance
                         */
                        Schema.create = function create(properties) {
                            return new Schema(properties);
                        };
    
                        /**
                         * Encodes the specified Schema message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Schema.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISchema} message Schema message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Schema.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);
                            if (message.format != null && Object.hasOwnProperty.call(message, "format"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.format);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.description);
                            if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable"))
                                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.nullable);
                            if (message["enum"] != null && message["enum"].length)
                                for (var i = 0; i < message["enum"].length; ++i)
                                    writer.uint32(/* id 5, wireType 2 =*/42).string(message["enum"][i]);
                            if (message.items != null && Object.hasOwnProperty.call(message, "items"))
                                $root.google.ai.generativelanguage.v1beta.Schema.encode(message.items, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.properties != null && Object.hasOwnProperty.call(message, "properties"))
                                for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) {
                                    writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
                                    $root.google.ai.generativelanguage.v1beta.Schema.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                                }
                            if (message.required != null && message.required.length)
                                for (var i = 0; i < message.required.length; ++i)
                                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.required[i]);
                            if (message.maxItems != null && Object.hasOwnProperty.call(message, "maxItems"))
                                writer.uint32(/* id 21, wireType 0 =*/168).int64(message.maxItems);
                            if (message.minItems != null && Object.hasOwnProperty.call(message, "minItems"))
                                writer.uint32(/* id 22, wireType 0 =*/176).int64(message.minItems);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Schema.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISchema} message Schema message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Schema.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Schema message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Schema} Schema
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Schema.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Schema(), key, value;
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.type = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.format = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.nullable = reader.bool();
                                        break;
                                    }
                                case 5: {
                                        if (!(message["enum"] && message["enum"].length))
                                            message["enum"] = [];
                                        message["enum"].push(reader.string());
                                        break;
                                    }
                                case 6: {
                                        message.items = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 21: {
                                        message.maxItems = reader.int64();
                                        break;
                                    }
                                case 22: {
                                        message.minItems = reader.int64();
                                        break;
                                    }
                                case 7: {
                                        if (message.properties === $util.emptyObject)
                                            message.properties = {};
                                        var end2 = reader.uint32() + reader.pos;
                                        key = "";
                                        value = null;
                                        while (reader.pos < end2) {
                                            var tag2 = reader.uint32();
                                            switch (tag2 >>> 3) {
                                            case 1:
                                                key = reader.string();
                                                break;
                                            case 2:
                                                value = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32());
                                                break;
                                            default:
                                                reader.skipType(tag2 & 7);
                                                break;
                                            }
                                        }
                                        message.properties[key] = value;
                                        break;
                                    }
                                case 8: {
                                        if (!(message.required && message.required.length))
                                            message.required = [];
                                        message.required.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Schema message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Schema} Schema
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Schema.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Schema message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Schema.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.type != null && message.hasOwnProperty("type"))
                                switch (message.type) {
                                default:
                                    return "type: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                    break;
                                }
                            if (message.format != null && message.hasOwnProperty("format"))
                                if (!$util.isString(message.format))
                                    return "format: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.nullable != null && message.hasOwnProperty("nullable"))
                                if (typeof message.nullable !== "boolean")
                                    return "nullable: boolean expected";
                            if (message["enum"] != null && message.hasOwnProperty("enum")) {
                                if (!Array.isArray(message["enum"]))
                                    return "enum: array expected";
                                for (var i = 0; i < message["enum"].length; ++i)
                                    if (!$util.isString(message["enum"][i]))
                                        return "enum: string[] expected";
                            }
                            if (message.items != null && message.hasOwnProperty("items")) {
                                properties._items = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.items);
                                    if (error)
                                        return "items." + error;
                                }
                            }
                            if (message.maxItems != null && message.hasOwnProperty("maxItems"))
                                if (!$util.isInteger(message.maxItems) && !(message.maxItems && $util.isInteger(message.maxItems.low) && $util.isInteger(message.maxItems.high)))
                                    return "maxItems: integer|Long expected";
                            if (message.minItems != null && message.hasOwnProperty("minItems"))
                                if (!$util.isInteger(message.minItems) && !(message.minItems && $util.isInteger(message.minItems.low) && $util.isInteger(message.minItems.high)))
                                    return "minItems: integer|Long expected";
                            if (message.properties != null && message.hasOwnProperty("properties")) {
                                if (!$util.isObject(message.properties))
                                    return "properties: object expected";
                                var key = Object.keys(message.properties);
                                for (var i = 0; i < key.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.properties[key[i]]);
                                    if (error)
                                        return "properties." + error;
                                }
                            }
                            if (message.required != null && message.hasOwnProperty("required")) {
                                if (!Array.isArray(message.required))
                                    return "required: array expected";
                                for (var i = 0; i < message.required.length; ++i)
                                    if (!$util.isString(message.required[i]))
                                        return "required: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Schema message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Schema} Schema
                         */
                        Schema.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Schema)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Schema();
                            switch (object.type) {
                            default:
                                if (typeof object.type === "number") {
                                    message.type = object.type;
                                    break;
                                }
                                break;
                            case "TYPE_UNSPECIFIED":
                            case 0:
                                message.type = 0;
                                break;
                            case "STRING":
                            case 1:
                                message.type = 1;
                                break;
                            case "NUMBER":
                            case 2:
                                message.type = 2;
                                break;
                            case "INTEGER":
                            case 3:
                                message.type = 3;
                                break;
                            case "BOOLEAN":
                            case 4:
                                message.type = 4;
                                break;
                            case "ARRAY":
                            case 5:
                                message.type = 5;
                                break;
                            case "OBJECT":
                            case 6:
                                message.type = 6;
                                break;
                            }
                            if (object.format != null)
                                message.format = String(object.format);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.nullable != null)
                                message.nullable = Boolean(object.nullable);
                            if (object["enum"]) {
                                if (!Array.isArray(object["enum"]))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Schema.enum: array expected");
                                message["enum"] = [];
                                for (var i = 0; i < object["enum"].length; ++i)
                                    message["enum"][i] = String(object["enum"][i]);
                            }
                            if (object.items != null) {
                                if (typeof object.items !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Schema.items: object expected");
                                message.items = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.items);
                            }
                            if (object.maxItems != null)
                                if ($util.Long)
                                    (message.maxItems = $util.Long.fromValue(object.maxItems)).unsigned = false;
                                else if (typeof object.maxItems === "string")
                                    message.maxItems = parseInt(object.maxItems, 10);
                                else if (typeof object.maxItems === "number")
                                    message.maxItems = object.maxItems;
                                else if (typeof object.maxItems === "object")
                                    message.maxItems = new $util.LongBits(object.maxItems.low >>> 0, object.maxItems.high >>> 0).toNumber();
                            if (object.minItems != null)
                                if ($util.Long)
                                    (message.minItems = $util.Long.fromValue(object.minItems)).unsigned = false;
                                else if (typeof object.minItems === "string")
                                    message.minItems = parseInt(object.minItems, 10);
                                else if (typeof object.minItems === "number")
                                    message.minItems = object.minItems;
                                else if (typeof object.minItems === "object")
                                    message.minItems = new $util.LongBits(object.minItems.low >>> 0, object.minItems.high >>> 0).toNumber();
                            if (object.properties) {
                                if (typeof object.properties !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Schema.properties: object expected");
                                message.properties = {};
                                for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) {
                                    if (typeof object.properties[keys[i]] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.Schema.properties: object expected");
                                    message.properties[keys[i]] = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.properties[keys[i]]);
                                }
                            }
                            if (object.required) {
                                if (!Array.isArray(object.required))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Schema.required: array expected");
                                message.required = [];
                                for (var i = 0; i < object.required.length; ++i)
                                    message.required[i] = String(object.required[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Schema message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Schema} message Schema
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Schema.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object["enum"] = [];
                                object.required = [];
                            }
                            if (options.objects || options.defaults)
                                object.properties = {};
                            if (options.defaults) {
                                object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0;
                                object.format = "";
                                object.description = "";
                                object.nullable = false;
                                if ($util.Long) {
                                    var long = new $util.Long(0, 0, false);
                                    object.maxItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                                } else
                                    object.maxItems = options.longs === String ? "0" : 0;
                                if ($util.Long) {
                                    var long = new $util.Long(0, 0, false);
                                    object.minItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                                } else
                                    object.minItems = options.longs === String ? "0" : 0;
                            }
                            if (message.type != null && message.hasOwnProperty("type"))
                                object.type = options.enums === String ? $root.google.ai.generativelanguage.v1beta.Type[message.type] === undefined ? message.type : $root.google.ai.generativelanguage.v1beta.Type[message.type] : message.type;
                            if (message.format != null && message.hasOwnProperty("format"))
                                object.format = message.format;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.nullable != null && message.hasOwnProperty("nullable"))
                                object.nullable = message.nullable;
                            if (message["enum"] && message["enum"].length) {
                                object["enum"] = [];
                                for (var j = 0; j < message["enum"].length; ++j)
                                    object["enum"][j] = message["enum"][j];
                            }
                            if (message.items != null && message.hasOwnProperty("items")) {
                                object.items = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.items, options);
                                if (options.oneofs)
                                    object._items = "items";
                            }
                            var keys2;
                            if (message.properties && (keys2 = Object.keys(message.properties)).length) {
                                object.properties = {};
                                for (var j = 0; j < keys2.length; ++j)
                                    object.properties[keys2[j]] = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.properties[keys2[j]], options);
                            }
                            if (message.required && message.required.length) {
                                object.required = [];
                                for (var j = 0; j < message.required.length; ++j)
                                    object.required[j] = message.required[j];
                            }
                            if (message.maxItems != null && message.hasOwnProperty("maxItems"))
                                if (typeof message.maxItems === "number")
                                    object.maxItems = options.longs === String ? String(message.maxItems) : message.maxItems;
                                else
                                    object.maxItems = options.longs === String ? $util.Long.prototype.toString.call(message.maxItems) : options.longs === Number ? new $util.LongBits(message.maxItems.low >>> 0, message.maxItems.high >>> 0).toNumber() : message.maxItems;
                            if (message.minItems != null && message.hasOwnProperty("minItems"))
                                if (typeof message.minItems === "number")
                                    object.minItems = options.longs === String ? String(message.minItems) : message.minItems;
                                else
                                    object.minItems = options.longs === String ? $util.Long.prototype.toString.call(message.minItems) : options.longs === Number ? new $util.LongBits(message.minItems.low >>> 0, message.minItems.high >>> 0).toNumber() : message.minItems;
                            return object;
                        };
    
                        /**
                         * Converts this Schema to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Schema.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Schema
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Schema
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Schema";
                        };
    
                        return Schema;
                    })();
    
                    v1beta.GroundingPassage = (function() {
    
                        /**
                         * Properties of a GroundingPassage.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGroundingPassage
                         * @property {string|null} [id] GroundingPassage id
                         * @property {google.ai.generativelanguage.v1beta.IContent|null} [content] GroundingPassage content
                         */
    
                        /**
                         * Constructs a new GroundingPassage.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GroundingPassage.
                         * @implements IGroundingPassage
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGroundingPassage=} [properties] Properties to set
                         */
                        function GroundingPassage(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingPassage id.
                         * @member {string} id
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @instance
                         */
                        GroundingPassage.prototype.id = "";
    
                        /**
                         * GroundingPassage content.
                         * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} content
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @instance
                         */
                        GroundingPassage.prototype.content = null;
    
                        /**
                         * Creates a new GroundingPassage instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingPassage=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage instance
                         */
                        GroundingPassage.create = function create(properties) {
                            return new GroundingPassage(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingPassage message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassage.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingPassage} message GroundingPassage message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingPassage.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                $root.google.ai.generativelanguage.v1beta.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingPassage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassage.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingPassage} message GroundingPassage message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingPassage.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingPassage message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingPassage.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GroundingPassage();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.id = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.content = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingPassage message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingPassage.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingPassage message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingPassage.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.id != null && message.hasOwnProperty("id"))
                                if (!$util.isString(message.id))
                                    return "id: string expected";
                            if (message.content != null && message.hasOwnProperty("content")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.content);
                                if (error)
                                    return "content." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingPassage message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage
                         */
                        GroundingPassage.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingPassage)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GroundingPassage();
                            if (object.id != null)
                                message.id = String(object.id);
                            if (object.content != null) {
                                if (typeof object.content !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingPassage.content: object expected");
                                message.content = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.content);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingPassage message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GroundingPassage} message GroundingPassage
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingPassage.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.id = "";
                                object.content = null;
                            }
                            if (message.id != null && message.hasOwnProperty("id"))
                                object.id = message.id;
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.content, options);
                            return object;
                        };
    
                        /**
                         * Converts this GroundingPassage to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingPassage.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingPassage
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassage
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingPassage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingPassage";
                        };
    
                        return GroundingPassage;
                    })();
    
                    v1beta.GroundingPassages = (function() {
    
                        /**
                         * Properties of a GroundingPassages.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGroundingPassages
                         * @property {Array.<google.ai.generativelanguage.v1beta.IGroundingPassage>|null} [passages] GroundingPassages passages
                         */
    
                        /**
                         * Constructs a new GroundingPassages.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GroundingPassages.
                         * @implements IGroundingPassages
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGroundingPassages=} [properties] Properties to set
                         */
                        function GroundingPassages(properties) {
                            this.passages = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingPassages passages.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IGroundingPassage>} passages
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassages
                         * @instance
                         */
                        GroundingPassages.prototype.passages = $util.emptyArray;
    
                        /**
                         * Creates a new GroundingPassages instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassages
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingPassages=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages instance
                         */
                        GroundingPassages.create = function create(properties) {
                            return new GroundingPassages(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingPassages message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassages.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassages
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingPassages} message GroundingPassages message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingPassages.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.passages != null && message.passages.length)
                                for (var i = 0; i < message.passages.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.GroundingPassage.encode(message.passages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingPassages message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassages.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassages
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingPassages} message GroundingPassages message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingPassages.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingPassages message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassages
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingPassages.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GroundingPassages();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.passages && message.passages.length))
                                            message.passages = [];
                                        message.passages.push($root.google.ai.generativelanguage.v1beta.GroundingPassage.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingPassages message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassages
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingPassages.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingPassages message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassages
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingPassages.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.passages != null && message.hasOwnProperty("passages")) {
                                if (!Array.isArray(message.passages))
                                    return "passages: array expected";
                                for (var i = 0; i < message.passages.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.GroundingPassage.verify(message.passages[i]);
                                    if (error)
                                        return "passages." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingPassages message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassages
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages
                         */
                        GroundingPassages.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingPassages)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GroundingPassages();
                            if (object.passages) {
                                if (!Array.isArray(object.passages))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingPassages.passages: array expected");
                                message.passages = [];
                                for (var i = 0; i < object.passages.length; ++i) {
                                    if (typeof object.passages[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GroundingPassages.passages: object expected");
                                    message.passages[i] = $root.google.ai.generativelanguage.v1beta.GroundingPassage.fromObject(object.passages[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingPassages message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassages
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GroundingPassages} message GroundingPassages
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingPassages.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.passages = [];
                            if (message.passages && message.passages.length) {
                                object.passages = [];
                                for (var j = 0; j < message.passages.length; ++j)
                                    object.passages[j] = $root.google.ai.generativelanguage.v1beta.GroundingPassage.toObject(message.passages[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GroundingPassages to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassages
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingPassages.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingPassages
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GroundingPassages
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingPassages.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingPassages";
                        };
    
                        return GroundingPassages;
                    })();
    
                    v1beta.CitationMetadata = (function() {
    
                        /**
                         * Properties of a CitationMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICitationMetadata
                         * @property {Array.<google.ai.generativelanguage.v1beta.ICitationSource>|null} [citationSources] CitationMetadata citationSources
                         */
    
                        /**
                         * Constructs a new CitationMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CitationMetadata.
                         * @implements ICitationMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICitationMetadata=} [properties] Properties to set
                         */
                        function CitationMetadata(properties) {
                            this.citationSources = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CitationMetadata citationSources.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ICitationSource>} citationSources
                         * @memberof google.ai.generativelanguage.v1beta.CitationMetadata
                         * @instance
                         */
                        CitationMetadata.prototype.citationSources = $util.emptyArray;
    
                        /**
                         * Creates a new CitationMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICitationMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata instance
                         */
                        CitationMetadata.create = function create(properties) {
                            return new CitationMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICitationMetadata} message CitationMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.citationSources != null && message.citationSources.length)
                                for (var i = 0; i < message.citationSources.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.CitationSource.encode(message.citationSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICitationMetadata} message CitationMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CitationMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CitationMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CitationMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.citationSources && message.citationSources.length))
                                            message.citationSources = [];
                                        message.citationSources.push($root.google.ai.generativelanguage.v1beta.CitationSource.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CitationMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CitationMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CitationMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CitationMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CitationMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.citationSources != null && message.hasOwnProperty("citationSources")) {
                                if (!Array.isArray(message.citationSources))
                                    return "citationSources: array expected";
                                for (var i = 0; i < message.citationSources.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.CitationSource.verify(message.citationSources[i]);
                                    if (error)
                                        return "citationSources." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CitationMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CitationMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata
                         */
                        CitationMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CitationMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CitationMetadata();
                            if (object.citationSources) {
                                if (!Array.isArray(object.citationSources))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CitationMetadata.citationSources: array expected");
                                message.citationSources = [];
                                for (var i = 0; i < object.citationSources.length; ++i) {
                                    if (typeof object.citationSources[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.CitationMetadata.citationSources: object expected");
                                    message.citationSources[i] = $root.google.ai.generativelanguage.v1beta.CitationSource.fromObject(object.citationSources[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CitationMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CitationMetadata} message CitationMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CitationMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.citationSources = [];
                            if (message.citationSources && message.citationSources.length) {
                                object.citationSources = [];
                                for (var j = 0; j < message.citationSources.length; ++j)
                                    object.citationSources[j] = $root.google.ai.generativelanguage.v1beta.CitationSource.toObject(message.citationSources[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CitationMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CitationMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CitationMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CitationMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CitationMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CitationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CitationMetadata";
                        };
    
                        return CitationMetadata;
                    })();
    
                    v1beta.CitationSource = (function() {
    
                        /**
                         * Properties of a CitationSource.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICitationSource
                         * @property {number|null} [startIndex] CitationSource startIndex
                         * @property {number|null} [endIndex] CitationSource endIndex
                         * @property {string|null} [uri] CitationSource uri
                         * @property {string|null} [license] CitationSource license
                         */
    
                        /**
                         * Constructs a new CitationSource.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CitationSource.
                         * @implements ICitationSource
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICitationSource=} [properties] Properties to set
                         */
                        function CitationSource(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CitationSource startIndex.
                         * @member {number|null|undefined} startIndex
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.startIndex = null;
    
                        /**
                         * CitationSource endIndex.
                         * @member {number|null|undefined} endIndex
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.endIndex = null;
    
                        /**
                         * CitationSource uri.
                         * @member {string|null|undefined} uri
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.uri = null;
    
                        /**
                         * CitationSource license.
                         * @member {string|null|undefined} license
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.license = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CitationSource _startIndex.
                         * @member {"startIndex"|undefined} _startIndex
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_startIndex", {
                            get: $util.oneOfGetter($oneOfFields = ["startIndex"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _endIndex.
                         * @member {"endIndex"|undefined} _endIndex
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_endIndex", {
                            get: $util.oneOfGetter($oneOfFields = ["endIndex"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _uri.
                         * @member {"uri"|undefined} _uri
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_uri", {
                            get: $util.oneOfGetter($oneOfFields = ["uri"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _license.
                         * @member {"license"|undefined} _license
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_license", {
                            get: $util.oneOfGetter($oneOfFields = ["license"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CitationSource instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICitationSource=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource instance
                         */
                        CitationSource.create = function create(properties) {
                            return new CitationSource(properties);
                        };
    
                        /**
                         * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationSource.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICitationSource} message CitationSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationSource.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startIndex);
                            if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endIndex);
                            if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri);
                            if (message.license != null && Object.hasOwnProperty.call(message, "license"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.license);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationSource.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICitationSource} message CitationSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationSource.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CitationSource message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationSource.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CitationSource();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.startIndex = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.endIndex = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.uri = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.license = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CitationSource message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationSource.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CitationSource message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CitationSource.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.startIndex != null && message.hasOwnProperty("startIndex")) {
                                properties._startIndex = 1;
                                if (!$util.isInteger(message.startIndex))
                                    return "startIndex: integer expected";
                            }
                            if (message.endIndex != null && message.hasOwnProperty("endIndex")) {
                                properties._endIndex = 1;
                                if (!$util.isInteger(message.endIndex))
                                    return "endIndex: integer expected";
                            }
                            if (message.uri != null && message.hasOwnProperty("uri")) {
                                properties._uri = 1;
                                if (!$util.isString(message.uri))
                                    return "uri: string expected";
                            }
                            if (message.license != null && message.hasOwnProperty("license")) {
                                properties._license = 1;
                                if (!$util.isString(message.license))
                                    return "license: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CitationSource message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource
                         */
                        CitationSource.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CitationSource)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CitationSource();
                            if (object.startIndex != null)
                                message.startIndex = object.startIndex | 0;
                            if (object.endIndex != null)
                                message.endIndex = object.endIndex | 0;
                            if (object.uri != null)
                                message.uri = String(object.uri);
                            if (object.license != null)
                                message.license = String(object.license);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CitationSource message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CitationSource} message CitationSource
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CitationSource.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.startIndex != null && message.hasOwnProperty("startIndex")) {
                                object.startIndex = message.startIndex;
                                if (options.oneofs)
                                    object._startIndex = "startIndex";
                            }
                            if (message.endIndex != null && message.hasOwnProperty("endIndex")) {
                                object.endIndex = message.endIndex;
                                if (options.oneofs)
                                    object._endIndex = "endIndex";
                            }
                            if (message.uri != null && message.hasOwnProperty("uri")) {
                                object.uri = message.uri;
                                if (options.oneofs)
                                    object._uri = "uri";
                            }
                            if (message.license != null && message.hasOwnProperty("license")) {
                                object.license = message.license;
                                if (options.oneofs)
                                    object._license = "license";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CitationSource to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CitationSource.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CitationSource
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CitationSource
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CitationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CitationSource";
                        };
    
                        return CitationSource;
                    })();
    
                    v1beta.DiscussService = (function() {
    
                        /**
                         * Constructs a new DiscussService service.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a DiscussService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function DiscussService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (DiscussService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DiscussService;
    
                        /**
                         * Creates new DiscussService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.DiscussService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {DiscussService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        DiscussService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.DiscussService|generateMessage}.
                         * @memberof google.ai.generativelanguage.v1beta.DiscussService
                         * @typedef GenerateMessageCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.GenerateMessageResponse} [response] GenerateMessageResponse
                         */
    
                        /**
                         * Calls GenerateMessage.
                         * @function generateMessage
                         * @memberof google.ai.generativelanguage.v1beta.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} request GenerateMessageRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.DiscussService.GenerateMessageCallback} callback Node-style callback called with the error, if any, and GenerateMessageResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(DiscussService.prototype.generateMessage = function generateMessage(request, callback) {
                            return this.rpcCall(generateMessage, $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest, $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse, request, callback);
                        }, "name", { value: "GenerateMessage" });
    
                        /**
                         * Calls GenerateMessage.
                         * @function generateMessage
                         * @memberof google.ai.generativelanguage.v1beta.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} request GenerateMessageRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.GenerateMessageResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.DiscussService|countMessageTokens}.
                         * @memberof google.ai.generativelanguage.v1beta.DiscussService
                         * @typedef CountMessageTokensCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} [response] CountMessageTokensResponse
                         */
    
                        /**
                         * Calls CountMessageTokens.
                         * @function countMessageTokens
                         * @memberof google.ai.generativelanguage.v1beta.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.DiscussService.CountMessageTokensCallback} callback Node-style callback called with the error, if any, and CountMessageTokensResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(DiscussService.prototype.countMessageTokens = function countMessageTokens(request, callback) {
                            return this.rpcCall(countMessageTokens, $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest, $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse, request, callback);
                        }, "name", { value: "CountMessageTokens" });
    
                        /**
                         * Calls CountMessageTokens.
                         * @function countMessageTokens
                         * @memberof google.ai.generativelanguage.v1beta.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.CountMessageTokensResponse>} Promise
                         * @variation 2
                         */
    
                        return DiscussService;
                    })();
    
                    v1beta.GenerateMessageRequest = (function() {
    
                        /**
                         * Properties of a GenerateMessageRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGenerateMessageRequest
                         * @property {string|null} [model] GenerateMessageRequest model
                         * @property {google.ai.generativelanguage.v1beta.IMessagePrompt|null} [prompt] GenerateMessageRequest prompt
                         * @property {number|null} [temperature] GenerateMessageRequest temperature
                         * @property {number|null} [candidateCount] GenerateMessageRequest candidateCount
                         * @property {number|null} [topP] GenerateMessageRequest topP
                         * @property {number|null} [topK] GenerateMessageRequest topK
                         */
    
                        /**
                         * Constructs a new GenerateMessageRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GenerateMessageRequest.
                         * @implements IGenerateMessageRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest=} [properties] Properties to set
                         */
                        function GenerateMessageRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateMessageRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.model = "";
    
                        /**
                         * GenerateMessageRequest prompt.
                         * @member {google.ai.generativelanguage.v1beta.IMessagePrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.prompt = null;
    
                        /**
                         * GenerateMessageRequest temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.temperature = null;
    
                        /**
                         * GenerateMessageRequest candidateCount.
                         * @member {number|null|undefined} candidateCount
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.candidateCount = null;
    
                        /**
                         * GenerateMessageRequest topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.topP = null;
    
                        /**
                         * GenerateMessageRequest topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.topK = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateMessageRequest _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _candidateCount.
                         * @member {"candidateCount"|undefined} _candidateCount
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_candidateCount", {
                            get: $util.oneOfGetter($oneOfFields = ["candidateCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateMessageRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest instance
                         */
                        GenerateMessageRequest.create = function create(properties) {
                            return new GenerateMessageRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateMessageRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1beta.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature);
                            if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 5, wireType 5 =*/45).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.topK);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateMessageRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateMessageRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 4: {
                                        message.candidateCount = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 6: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateMessageRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateMessageRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateMessageRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1beta.MessagePrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                properties._candidateCount = 1;
                                if (!$util.isInteger(message.candidateCount))
                                    return "candidateCount: integer expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateMessageRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest
                         */
                        GenerateMessageRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.fromObject(object.prompt);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.candidateCount != null)
                                message.candidateCount = object.candidateCount | 0;
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateMessageRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GenerateMessageRequest} message GenerateMessageRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateMessageRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.toObject(message.prompt, options);
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                object.candidateCount = message.candidateCount;
                                if (options.oneofs)
                                    object._candidateCount = "candidateCount";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateMessageRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateMessageRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateMessageRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateMessageRequest";
                        };
    
                        return GenerateMessageRequest;
                    })();
    
                    v1beta.GenerateMessageResponse = (function() {
    
                        /**
                         * Properties of a GenerateMessageResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGenerateMessageResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IMessage>|null} [candidates] GenerateMessageResponse candidates
                         * @property {Array.<google.ai.generativelanguage.v1beta.IMessage>|null} [messages] GenerateMessageResponse messages
                         * @property {Array.<google.ai.generativelanguage.v1beta.IContentFilter>|null} [filters] GenerateMessageResponse filters
                         */
    
                        /**
                         * Constructs a new GenerateMessageResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GenerateMessageResponse.
                         * @implements IGenerateMessageResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse=} [properties] Properties to set
                         */
                        function GenerateMessageResponse(properties) {
                            this.candidates = [];
                            this.messages = [];
                            this.filters = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateMessageResponse candidates.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IMessage>} candidates
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.candidates = $util.emptyArray;
    
                        /**
                         * GenerateMessageResponse messages.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IMessage>} messages
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.messages = $util.emptyArray;
    
                        /**
                         * GenerateMessageResponse filters.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IContentFilter>} filters
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.filters = $util.emptyArray;
    
                        /**
                         * Creates a new GenerateMessageResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse instance
                         */
                        GenerateMessageResponse.create = function create(properties) {
                            return new GenerateMessageResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateMessageResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidates != null && message.candidates.length)
                                for (var i = 0; i < message.candidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Message.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.messages != null && message.messages.length)
                                for (var i = 0; i < message.messages.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.filters != null && message.filters.length)
                                for (var i = 0; i < message.filters.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateMessageResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateMessageResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.candidates && message.candidates.length))
                                            message.candidates = [];
                                        message.candidates.push($root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        if (!(message.messages && message.messages.length))
                                            message.messages = [];
                                        message.messages.push($root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.filters && message.filters.length))
                                            message.filters = [];
                                        message.filters.push($root.google.ai.generativelanguage.v1beta.ContentFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateMessageResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateMessageResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateMessageResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                if (!Array.isArray(message.candidates))
                                    return "candidates: array expected";
                                for (var i = 0; i < message.candidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.candidates[i]);
                                    if (error)
                                        return "candidates." + error;
                                }
                            }
                            if (message.messages != null && message.hasOwnProperty("messages")) {
                                if (!Array.isArray(message.messages))
                                    return "messages: array expected";
                                for (var i = 0; i < message.messages.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.messages[i]);
                                    if (error)
                                        return "messages." + error;
                                }
                            }
                            if (message.filters != null && message.hasOwnProperty("filters")) {
                                if (!Array.isArray(message.filters))
                                    return "filters: array expected";
                                for (var i = 0; i < message.filters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.ContentFilter.verify(message.filters[i]);
                                    if (error)
                                        return "filters." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateMessageResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse
                         */
                        GenerateMessageResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse();
                            if (object.candidates) {
                                if (!Array.isArray(object.candidates))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.candidates: array expected");
                                message.candidates = [];
                                for (var i = 0; i < object.candidates.length; ++i) {
                                    if (typeof object.candidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.candidates: object expected");
                                    message.candidates[i] = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.candidates[i]);
                                }
                            }
                            if (object.messages) {
                                if (!Array.isArray(object.messages))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.messages: array expected");
                                message.messages = [];
                                for (var i = 0; i < object.messages.length; ++i) {
                                    if (typeof object.messages[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.messages: object expected");
                                    message.messages[i] = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.messages[i]);
                                }
                            }
                            if (object.filters) {
                                if (!Array.isArray(object.filters))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.filters: array expected");
                                message.filters = [];
                                for (var i = 0; i < object.filters.length; ++i) {
                                    if (typeof object.filters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.filters: object expected");
                                    message.filters[i] = $root.google.ai.generativelanguage.v1beta.ContentFilter.fromObject(object.filters[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateMessageResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GenerateMessageResponse} message GenerateMessageResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateMessageResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.candidates = [];
                                object.messages = [];
                                object.filters = [];
                            }
                            if (message.candidates && message.candidates.length) {
                                object.candidates = [];
                                for (var j = 0; j < message.candidates.length; ++j)
                                    object.candidates[j] = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.candidates[j], options);
                            }
                            if (message.messages && message.messages.length) {
                                object.messages = [];
                                for (var j = 0; j < message.messages.length; ++j)
                                    object.messages[j] = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.messages[j], options);
                            }
                            if (message.filters && message.filters.length) {
                                object.filters = [];
                                for (var j = 0; j < message.filters.length; ++j)
                                    object.filters[j] = $root.google.ai.generativelanguage.v1beta.ContentFilter.toObject(message.filters[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateMessageResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateMessageResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateMessageResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateMessageResponse";
                        };
    
                        return GenerateMessageResponse;
                    })();
    
                    v1beta.Message = (function() {
    
                        /**
                         * Properties of a Message.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IMessage
                         * @property {string|null} [author] Message author
                         * @property {string|null} [content] Message content
                         * @property {google.ai.generativelanguage.v1beta.ICitationMetadata|null} [citationMetadata] Message citationMetadata
                         */
    
                        /**
                         * Constructs a new Message.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Message.
                         * @implements IMessage
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IMessage=} [properties] Properties to set
                         */
                        function Message(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Message author.
                         * @member {string} author
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @instance
                         */
                        Message.prototype.author = "";
    
                        /**
                         * Message content.
                         * @member {string} content
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @instance
                         */
                        Message.prototype.content = "";
    
                        /**
                         * Message citationMetadata.
                         * @member {google.ai.generativelanguage.v1beta.ICitationMetadata|null|undefined} citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @instance
                         */
                        Message.prototype.citationMetadata = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Message _citationMetadata.
                         * @member {"citationMetadata"|undefined} _citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @instance
                         */
                        Object.defineProperty(Message.prototype, "_citationMetadata", {
                            get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Message instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IMessage=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Message} Message instance
                         */
                        Message.create = function create(properties) {
                            return new Message(properties);
                        };
    
                        /**
                         * Encodes the specified Message message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Message.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IMessage} message Message message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Message.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.author != null && Object.hasOwnProperty.call(message, "author"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.author);
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.content);
                            if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata"))
                                $root.google.ai.generativelanguage.v1beta.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Message message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Message.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IMessage} message Message message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Message.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Message message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Message} Message
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Message.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Message();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.author = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.content = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Message message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Message} Message
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Message.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Message message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Message.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.author != null && message.hasOwnProperty("author"))
                                if (!$util.isString(message.author))
                                    return "author: string expected";
                            if (message.content != null && message.hasOwnProperty("content"))
                                if (!$util.isString(message.content))
                                    return "content: string expected";
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                properties._citationMetadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.CitationMetadata.verify(message.citationMetadata);
                                    if (error)
                                        return "citationMetadata." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Message message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Message} Message
                         */
                        Message.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Message)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Message();
                            if (object.author != null)
                                message.author = String(object.author);
                            if (object.content != null)
                                message.content = String(object.content);
                            if (object.citationMetadata != null) {
                                if (typeof object.citationMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Message.citationMetadata: object expected");
                                message.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.fromObject(object.citationMetadata);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Message message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Message} message Message
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Message.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.author = "";
                                object.content = "";
                            }
                            if (message.author != null && message.hasOwnProperty("author"))
                                object.author = message.author;
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = message.content;
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                object.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.toObject(message.citationMetadata, options);
                                if (options.oneofs)
                                    object._citationMetadata = "citationMetadata";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Message to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Message.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Message
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Message
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Message";
                        };
    
                        return Message;
                    })();
    
                    v1beta.MessagePrompt = (function() {
    
                        /**
                         * Properties of a MessagePrompt.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IMessagePrompt
                         * @property {string|null} [context] MessagePrompt context
                         * @property {Array.<google.ai.generativelanguage.v1beta.IExample>|null} [examples] MessagePrompt examples
                         * @property {Array.<google.ai.generativelanguage.v1beta.IMessage>|null} [messages] MessagePrompt messages
                         */
    
                        /**
                         * Constructs a new MessagePrompt.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a MessagePrompt.
                         * @implements IMessagePrompt
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IMessagePrompt=} [properties] Properties to set
                         */
                        function MessagePrompt(properties) {
                            this.examples = [];
                            this.messages = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * MessagePrompt context.
                         * @member {string} context
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.context = "";
    
                        /**
                         * MessagePrompt examples.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IExample>} examples
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.examples = $util.emptyArray;
    
                        /**
                         * MessagePrompt messages.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IMessage>} messages
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.messages = $util.emptyArray;
    
                        /**
                         * Creates a new MessagePrompt instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IMessagePrompt=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt instance
                         */
                        MessagePrompt.create = function create(properties) {
                            return new MessagePrompt(properties);
                        };
    
                        /**
                         * Encodes the specified MessagePrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta.MessagePrompt.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IMessagePrompt} message MessagePrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MessagePrompt.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.context != null && Object.hasOwnProperty.call(message, "context"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.context);
                            if (message.examples != null && message.examples.length)
                                for (var i = 0; i < message.examples.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Example.encode(message.examples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.messages != null && message.messages.length)
                                for (var i = 0; i < message.messages.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified MessagePrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.MessagePrompt.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IMessagePrompt} message MessagePrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MessagePrompt.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a MessagePrompt message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MessagePrompt.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.MessagePrompt();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.context = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.examples && message.examples.length))
                                            message.examples = [];
                                        message.examples.push($root.google.ai.generativelanguage.v1beta.Example.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.messages && message.messages.length))
                                            message.messages = [];
                                        message.messages.push($root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a MessagePrompt message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MessagePrompt.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a MessagePrompt message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        MessagePrompt.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.context != null && message.hasOwnProperty("context"))
                                if (!$util.isString(message.context))
                                    return "context: string expected";
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                if (!Array.isArray(message.examples))
                                    return "examples: array expected";
                                for (var i = 0; i < message.examples.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Example.verify(message.examples[i]);
                                    if (error)
                                        return "examples." + error;
                                }
                            }
                            if (message.messages != null && message.hasOwnProperty("messages")) {
                                if (!Array.isArray(message.messages))
                                    return "messages: array expected";
                                for (var i = 0; i < message.messages.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.messages[i]);
                                    if (error)
                                        return "messages." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a MessagePrompt message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt
                         */
                        MessagePrompt.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.MessagePrompt)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.MessagePrompt();
                            if (object.context != null)
                                message.context = String(object.context);
                            if (object.examples) {
                                if (!Array.isArray(object.examples))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.examples: array expected");
                                message.examples = [];
                                for (var i = 0; i < object.examples.length; ++i) {
                                    if (typeof object.examples[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.examples: object expected");
                                    message.examples[i] = $root.google.ai.generativelanguage.v1beta.Example.fromObject(object.examples[i]);
                                }
                            }
                            if (object.messages) {
                                if (!Array.isArray(object.messages))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.messages: array expected");
                                message.messages = [];
                                for (var i = 0; i < object.messages.length; ++i) {
                                    if (typeof object.messages[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.messages: object expected");
                                    message.messages[i] = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.messages[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a MessagePrompt message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.MessagePrompt} message MessagePrompt
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        MessagePrompt.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.examples = [];
                                object.messages = [];
                            }
                            if (options.defaults)
                                object.context = "";
                            if (message.context != null && message.hasOwnProperty("context"))
                                object.context = message.context;
                            if (message.examples && message.examples.length) {
                                object.examples = [];
                                for (var j = 0; j < message.examples.length; ++j)
                                    object.examples[j] = $root.google.ai.generativelanguage.v1beta.Example.toObject(message.examples[j], options);
                            }
                            if (message.messages && message.messages.length) {
                                object.messages = [];
                                for (var j = 0; j < message.messages.length; ++j)
                                    object.messages[j] = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.messages[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this MessagePrompt to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        MessagePrompt.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for MessagePrompt
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.MessagePrompt
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        MessagePrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.MessagePrompt";
                        };
    
                        return MessagePrompt;
                    })();
    
                    v1beta.Example = (function() {
    
                        /**
                         * Properties of an Example.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IExample
                         * @property {google.ai.generativelanguage.v1beta.IMessage|null} [input] Example input
                         * @property {google.ai.generativelanguage.v1beta.IMessage|null} [output] Example output
                         */
    
                        /**
                         * Constructs a new Example.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an Example.
                         * @implements IExample
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IExample=} [properties] Properties to set
                         */
                        function Example(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Example input.
                         * @member {google.ai.generativelanguage.v1beta.IMessage|null|undefined} input
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @instance
                         */
                        Example.prototype.input = null;
    
                        /**
                         * Example output.
                         * @member {google.ai.generativelanguage.v1beta.IMessage|null|undefined} output
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @instance
                         */
                        Example.prototype.output = null;
    
                        /**
                         * Creates a new Example instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IExample=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Example} Example instance
                         */
                        Example.create = function create(properties) {
                            return new Example(properties);
                        };
    
                        /**
                         * Encodes the specified Example message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Example.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IExample} message Example message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Example.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.input != null && Object.hasOwnProperty.call(message, "input"))
                                $root.google.ai.generativelanguage.v1beta.Message.encode(message.input, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                $root.google.ai.generativelanguage.v1beta.Message.encode(message.output, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Example message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Example.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IExample} message Example message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Example.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an Example message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Example} Example
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Example.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Example();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.input = $root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.output = $root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an Example message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Example} Example
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Example.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an Example message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Example.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.input != null && message.hasOwnProperty("input")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.input);
                                if (error)
                                    return "input." + error;
                            }
                            if (message.output != null && message.hasOwnProperty("output")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.output);
                                if (error)
                                    return "output." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an Example message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Example} Example
                         */
                        Example.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Example)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Example();
                            if (object.input != null) {
                                if (typeof object.input !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Example.input: object expected");
                                message.input = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.input);
                            }
                            if (object.output != null) {
                                if (typeof object.output !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Example.output: object expected");
                                message.output = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.output);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an Example message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Example} message Example
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Example.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.input = null;
                                object.output = null;
                            }
                            if (message.input != null && message.hasOwnProperty("input"))
                                object.input = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.input, options);
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.output, options);
                            return object;
                        };
    
                        /**
                         * Converts this Example to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Example.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Example
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Example
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Example";
                        };
    
                        return Example;
                    })();
    
                    v1beta.CountMessageTokensRequest = (function() {
    
                        /**
                         * Properties of a CountMessageTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICountMessageTokensRequest
                         * @property {string|null} [model] CountMessageTokensRequest model
                         * @property {google.ai.generativelanguage.v1beta.IMessagePrompt|null} [prompt] CountMessageTokensRequest prompt
                         */
    
                        /**
                         * Constructs a new CountMessageTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CountMessageTokensRequest.
                         * @implements ICountMessageTokensRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest=} [properties] Properties to set
                         */
                        function CountMessageTokensRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountMessageTokensRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @instance
                         */
                        CountMessageTokensRequest.prototype.model = "";
    
                        /**
                         * CountMessageTokensRequest prompt.
                         * @member {google.ai.generativelanguage.v1beta.IMessagePrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @instance
                         */
                        CountMessageTokensRequest.prototype.prompt = null;
    
                        /**
                         * Creates a new CountMessageTokensRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest instance
                         */
                        CountMessageTokensRequest.create = function create(properties) {
                            return new CountMessageTokensRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1beta.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountMessageTokensRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountMessageTokensRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountMessageTokensRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountMessageTokensRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1beta.MessagePrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CountMessageTokensRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest
                         */
                        CountMessageTokensRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CountMessageTokensRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.fromObject(object.prompt);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountMessageTokensRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} message CountMessageTokensRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountMessageTokensRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.toObject(message.prompt, options);
                            return object;
                        };
    
                        /**
                         * Converts this CountMessageTokensRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountMessageTokensRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountMessageTokensRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountMessageTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CountMessageTokensRequest";
                        };
    
                        return CountMessageTokensRequest;
                    })();
    
                    v1beta.CountMessageTokensResponse = (function() {
    
                        /**
                         * Properties of a CountMessageTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICountMessageTokensResponse
                         * @property {number|null} [tokenCount] CountMessageTokensResponse tokenCount
                         */
    
                        /**
                         * Constructs a new CountMessageTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CountMessageTokensResponse.
                         * @implements ICountMessageTokensResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse=} [properties] Properties to set
                         */
                        function CountMessageTokensResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountMessageTokensResponse tokenCount.
                         * @member {number} tokenCount
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse
                         * @instance
                         */
                        CountMessageTokensResponse.prototype.tokenCount = 0;
    
                        /**
                         * Creates a new CountMessageTokensResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse instance
                         */
                        CountMessageTokensResponse.create = function create(properties) {
                            return new CountMessageTokensResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tokenCount);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountMessageTokensResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tokenCount = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountMessageTokensResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountMessageTokensResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountMessageTokensResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                if (!$util.isInteger(message.tokenCount))
                                    return "tokenCount: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a CountMessageTokensResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse
                         */
                        CountMessageTokensResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse();
                            if (object.tokenCount != null)
                                message.tokenCount = object.tokenCount | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountMessageTokensResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} message CountMessageTokensResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountMessageTokensResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.tokenCount = 0;
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                object.tokenCount = message.tokenCount;
                            return object;
                        };
    
                        /**
                         * Converts this CountMessageTokensResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountMessageTokensResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountMessageTokensResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountMessageTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CountMessageTokensResponse";
                        };
    
                        return CountMessageTokensResponse;
                    })();
    
                    /**
                     * HarmCategory enum.
                     * @name google.ai.generativelanguage.v1beta.HarmCategory
                     * @enum {number}
                     * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value
                     * @property {number} HARM_CATEGORY_DEROGATORY=1 HARM_CATEGORY_DEROGATORY value
                     * @property {number} HARM_CATEGORY_TOXICITY=2 HARM_CATEGORY_TOXICITY value
                     * @property {number} HARM_CATEGORY_VIOLENCE=3 HARM_CATEGORY_VIOLENCE value
                     * @property {number} HARM_CATEGORY_SEXUAL=4 HARM_CATEGORY_SEXUAL value
                     * @property {number} HARM_CATEGORY_MEDICAL=5 HARM_CATEGORY_MEDICAL value
                     * @property {number} HARM_CATEGORY_DANGEROUS=6 HARM_CATEGORY_DANGEROUS value
                     * @property {number} HARM_CATEGORY_HARASSMENT=7 HARM_CATEGORY_HARASSMENT value
                     * @property {number} HARM_CATEGORY_HATE_SPEECH=8 HARM_CATEGORY_HATE_SPEECH value
                     * @property {number} HARM_CATEGORY_SEXUALLY_EXPLICIT=9 HARM_CATEGORY_SEXUALLY_EXPLICIT value
                     * @property {number} HARM_CATEGORY_DANGEROUS_CONTENT=10 HARM_CATEGORY_DANGEROUS_CONTENT value
                     * @property {number} HARM_CATEGORY_CIVIC_INTEGRITY=11 HARM_CATEGORY_CIVIC_INTEGRITY value
                     */
                    v1beta.HarmCategory = (function() {
                        var valuesById = {}, values = Object.create(valuesById);
                        values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0;
                        values[valuesById[1] = "HARM_CATEGORY_DEROGATORY"] = 1;
                        values[valuesById[2] = "HARM_CATEGORY_TOXICITY"] = 2;
                        values[valuesById[3] = "HARM_CATEGORY_VIOLENCE"] = 3;
                        values[valuesById[4] = "HARM_CATEGORY_SEXUAL"] = 4;
                        values[valuesById[5] = "HARM_CATEGORY_MEDICAL"] = 5;
                        values[valuesById[6] = "HARM_CATEGORY_DANGEROUS"] = 6;
                        values[valuesById[7] = "HARM_CATEGORY_HARASSMENT"] = 7;
                        values[valuesById[8] = "HARM_CATEGORY_HATE_SPEECH"] = 8;
                        values[valuesById[9] = "HARM_CATEGORY_SEXUALLY_EXPLICIT"] = 9;
                        values[valuesById[10] = "HARM_CATEGORY_DANGEROUS_CONTENT"] = 10;
                        values[valuesById[11] = "HARM_CATEGORY_CIVIC_INTEGRITY"] = 11;
                        return values;
                    })();
    
                    v1beta.ContentFilter = (function() {
    
                        /**
                         * Properties of a ContentFilter.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IContentFilter
                         * @property {google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason|null} [reason] ContentFilter reason
                         * @property {string|null} [message] ContentFilter message
                         */
    
                        /**
                         * Constructs a new ContentFilter.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ContentFilter.
                         * @implements IContentFilter
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IContentFilter=} [properties] Properties to set
                         */
                        function ContentFilter(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ContentFilter reason.
                         * @member {google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason} reason
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @instance
                         */
                        ContentFilter.prototype.reason = 0;
    
                        /**
                         * ContentFilter message.
                         * @member {string|null|undefined} message
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @instance
                         */
                        ContentFilter.prototype.message = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * ContentFilter _message.
                         * @member {"message"|undefined} _message
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @instance
                         */
                        Object.defineProperty(ContentFilter.prototype, "_message", {
                            get: $util.oneOfGetter($oneOfFields = ["message"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new ContentFilter instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IContentFilter=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter instance
                         */
                        ContentFilter.create = function create(properties) {
                            return new ContentFilter(properties);
                        };
    
                        /**
                         * Encodes the specified ContentFilter message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ContentFilter.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IContentFilter} message ContentFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentFilter.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.reason != null && Object.hasOwnProperty.call(message, "reason"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.reason);
                            if (message.message != null && Object.hasOwnProperty.call(message, "message"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.message);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ContentFilter.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IContentFilter} message ContentFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentFilter.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ContentFilter message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentFilter.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ContentFilter();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.reason = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.message = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ContentFilter message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentFilter.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ContentFilter message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ContentFilter.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.reason != null && message.hasOwnProperty("reason"))
                                switch (message.reason) {
                                default:
                                    return "reason: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                    break;
                                }
                            if (message.message != null && message.hasOwnProperty("message")) {
                                properties._message = 1;
                                if (!$util.isString(message.message))
                                    return "message: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter
                         */
                        ContentFilter.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ContentFilter)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ContentFilter();
                            switch (object.reason) {
                            default:
                                if (typeof object.reason === "number") {
                                    message.reason = object.reason;
                                    break;
                                }
                                break;
                            case "BLOCKED_REASON_UNSPECIFIED":
                            case 0:
                                message.reason = 0;
                                break;
                            case "SAFETY":
                            case 1:
                                message.reason = 1;
                                break;
                            case "OTHER":
                            case 2:
                                message.reason = 2;
                                break;
                            }
                            if (object.message != null)
                                message.message = String(object.message);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ContentFilter message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ContentFilter} message ContentFilter
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ContentFilter.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.reason = options.enums === String ? "BLOCKED_REASON_UNSPECIFIED" : 0;
                            if (message.reason != null && message.hasOwnProperty("reason"))
                                object.reason = options.enums === String ? $root.google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason[message.reason] === undefined ? message.reason : $root.google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason[message.reason] : message.reason;
                            if (message.message != null && message.hasOwnProperty("message")) {
                                object.message = message.message;
                                if (options.oneofs)
                                    object._message = "message";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this ContentFilter to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ContentFilter.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ContentFilter
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ContentFilter
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ContentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ContentFilter";
                        };
    
                        /**
                         * BlockedReason enum.
                         * @name google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason
                         * @enum {number}
                         * @property {number} BLOCKED_REASON_UNSPECIFIED=0 BLOCKED_REASON_UNSPECIFIED value
                         * @property {number} SAFETY=1 SAFETY value
                         * @property {number} OTHER=2 OTHER value
                         */
                        ContentFilter.BlockedReason = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "BLOCKED_REASON_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "SAFETY"] = 1;
                            values[valuesById[2] = "OTHER"] = 2;
                            return values;
                        })();
    
                        return ContentFilter;
                    })();
    
                    v1beta.SafetyFeedback = (function() {
    
                        /**
                         * Properties of a SafetyFeedback.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ISafetyFeedback
                         * @property {google.ai.generativelanguage.v1beta.ISafetyRating|null} [rating] SafetyFeedback rating
                         * @property {google.ai.generativelanguage.v1beta.ISafetySetting|null} [setting] SafetyFeedback setting
                         */
    
                        /**
                         * Constructs a new SafetyFeedback.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a SafetyFeedback.
                         * @implements ISafetyFeedback
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback=} [properties] Properties to set
                         */
                        function SafetyFeedback(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetyFeedback rating.
                         * @member {google.ai.generativelanguage.v1beta.ISafetyRating|null|undefined} rating
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @instance
                         */
                        SafetyFeedback.prototype.rating = null;
    
                        /**
                         * SafetyFeedback setting.
                         * @member {google.ai.generativelanguage.v1beta.ISafetySetting|null|undefined} setting
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @instance
                         */
                        SafetyFeedback.prototype.setting = null;
    
                        /**
                         * Creates a new SafetyFeedback instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback instance
                         */
                        SafetyFeedback.create = function create(properties) {
                            return new SafetyFeedback(properties);
                        };
    
                        /**
                         * Encodes the specified SafetyFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyFeedback.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback} message SafetyFeedback message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyFeedback.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.rating != null && Object.hasOwnProperty.call(message, "rating"))
                                $root.google.ai.generativelanguage.v1beta.SafetyRating.encode(message.rating, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.setting != null && Object.hasOwnProperty.call(message, "setting"))
                                $root.google.ai.generativelanguage.v1beta.SafetySetting.encode(message.setting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetyFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyFeedback.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback} message SafetyFeedback message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyFeedback.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetyFeedback message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyFeedback.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SafetyFeedback();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.rating = $root.google.ai.generativelanguage.v1beta.SafetyRating.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.setting = $root.google.ai.generativelanguage.v1beta.SafetySetting.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetyFeedback message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyFeedback.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetyFeedback message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetyFeedback.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.rating != null && message.hasOwnProperty("rating")) {
                                var error = $root.google.ai.generativelanguage.v1beta.SafetyRating.verify(message.rating);
                                if (error)
                                    return "rating." + error;
                            }
                            if (message.setting != null && message.hasOwnProperty("setting")) {
                                var error = $root.google.ai.generativelanguage.v1beta.SafetySetting.verify(message.setting);
                                if (error)
                                    return "setting." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a SafetyFeedback message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback
                         */
                        SafetyFeedback.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.SafetyFeedback)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.SafetyFeedback();
                            if (object.rating != null) {
                                if (typeof object.rating !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.SafetyFeedback.rating: object expected");
                                message.rating = $root.google.ai.generativelanguage.v1beta.SafetyRating.fromObject(object.rating);
                            }
                            if (object.setting != null) {
                                if (typeof object.setting !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.SafetyFeedback.setting: object expected");
                                message.setting = $root.google.ai.generativelanguage.v1beta.SafetySetting.fromObject(object.setting);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetyFeedback message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.SafetyFeedback} message SafetyFeedback
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetyFeedback.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.rating = null;
                                object.setting = null;
                            }
                            if (message.rating != null && message.hasOwnProperty("rating"))
                                object.rating = $root.google.ai.generativelanguage.v1beta.SafetyRating.toObject(message.rating, options);
                            if (message.setting != null && message.hasOwnProperty("setting"))
                                object.setting = $root.google.ai.generativelanguage.v1beta.SafetySetting.toObject(message.setting, options);
                            return object;
                        };
    
                        /**
                         * Converts this SafetyFeedback to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetyFeedback.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetyFeedback
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetyFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SafetyFeedback";
                        };
    
                        return SafetyFeedback;
                    })();
    
                    v1beta.SafetyRating = (function() {
    
                        /**
                         * Properties of a SafetyRating.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ISafetyRating
                         * @property {google.ai.generativelanguage.v1beta.HarmCategory|null} [category] SafetyRating category
                         * @property {google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability|null} [probability] SafetyRating probability
                         * @property {boolean|null} [blocked] SafetyRating blocked
                         */
    
                        /**
                         * Constructs a new SafetyRating.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a SafetyRating.
                         * @implements ISafetyRating
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ISafetyRating=} [properties] Properties to set
                         */
                        function SafetyRating(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetyRating category.
                         * @member {google.ai.generativelanguage.v1beta.HarmCategory} category
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.category = 0;
    
                        /**
                         * SafetyRating probability.
                         * @member {google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability} probability
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.probability = 0;
    
                        /**
                         * SafetyRating blocked.
                         * @member {boolean} blocked
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.blocked = false;
    
                        /**
                         * Creates a new SafetyRating instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISafetyRating=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating instance
                         */
                        SafetyRating.create = function create(properties) {
                            return new SafetyRating(properties);
                        };
    
                        /**
                         * Encodes the specified SafetyRating message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyRating.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISafetyRating} message SafetyRating message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyRating.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.category != null && Object.hasOwnProperty.call(message, "category"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category);
                            if (message.probability != null && Object.hasOwnProperty.call(message, "probability"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.probability);
                            if (message.blocked != null && Object.hasOwnProperty.call(message, "blocked"))
                                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blocked);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetyRating message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyRating.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISafetyRating} message SafetyRating message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyRating.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetyRating message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyRating.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SafetyRating();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.category = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.probability = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.blocked = reader.bool();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetyRating message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyRating.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetyRating message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetyRating.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.category != null && message.hasOwnProperty("category"))
                                switch (message.category) {
                                default:
                                    return "category: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                case 8:
                                case 9:
                                case 10:
                                case 11:
                                    break;
                                }
                            if (message.probability != null && message.hasOwnProperty("probability"))
                                switch (message.probability) {
                                default:
                                    return "probability: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                    break;
                                }
                            if (message.blocked != null && message.hasOwnProperty("blocked"))
                                if (typeof message.blocked !== "boolean")
                                    return "blocked: boolean expected";
                            return null;
                        };
    
                        /**
                         * Creates a SafetyRating message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating
                         */
                        SafetyRating.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.SafetyRating)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.SafetyRating();
                            switch (object.category) {
                            default:
                                if (typeof object.category === "number") {
                                    message.category = object.category;
                                    break;
                                }
                                break;
                            case "HARM_CATEGORY_UNSPECIFIED":
                            case 0:
                                message.category = 0;
                                break;
                            case "HARM_CATEGORY_DEROGATORY":
                            case 1:
                                message.category = 1;
                                break;
                            case "HARM_CATEGORY_TOXICITY":
                            case 2:
                                message.category = 2;
                                break;
                            case "HARM_CATEGORY_VIOLENCE":
                            case 3:
                                message.category = 3;
                                break;
                            case "HARM_CATEGORY_SEXUAL":
                            case 4:
                                message.category = 4;
                                break;
                            case "HARM_CATEGORY_MEDICAL":
                            case 5:
                                message.category = 5;
                                break;
                            case "HARM_CATEGORY_DANGEROUS":
                            case 6:
                                message.category = 6;
                                break;
                            case "HARM_CATEGORY_HARASSMENT":
                            case 7:
                                message.category = 7;
                                break;
                            case "HARM_CATEGORY_HATE_SPEECH":
                            case 8:
                                message.category = 8;
                                break;
                            case "HARM_CATEGORY_SEXUALLY_EXPLICIT":
                            case 9:
                                message.category = 9;
                                break;
                            case "HARM_CATEGORY_DANGEROUS_CONTENT":
                            case 10:
                                message.category = 10;
                                break;
                            case "HARM_CATEGORY_CIVIC_INTEGRITY":
                            case 11:
                                message.category = 11;
                                break;
                            }
                            switch (object.probability) {
                            default:
                                if (typeof object.probability === "number") {
                                    message.probability = object.probability;
                                    break;
                                }
                                break;
                            case "HARM_PROBABILITY_UNSPECIFIED":
                            case 0:
                                message.probability = 0;
                                break;
                            case "NEGLIGIBLE":
                            case 1:
                                message.probability = 1;
                                break;
                            case "LOW":
                            case 2:
                                message.probability = 2;
                                break;
                            case "MEDIUM":
                            case 3:
                                message.probability = 3;
                                break;
                            case "HIGH":
                            case 4:
                                message.probability = 4;
                                break;
                            }
                            if (object.blocked != null)
                                message.blocked = Boolean(object.blocked);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetyRating message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.SafetyRating} message SafetyRating
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetyRating.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0;
                                object.probability = options.enums === String ? "HARM_PROBABILITY_UNSPECIFIED" : 0;
                                object.blocked = false;
                            }
                            if (message.category != null && message.hasOwnProperty("category"))
                                object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] : message.category;
                            if (message.probability != null && message.hasOwnProperty("probability"))
                                object.probability = options.enums === String ? $root.google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability[message.probability] === undefined ? message.probability : $root.google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability[message.probability] : message.probability;
                            if (message.blocked != null && message.hasOwnProperty("blocked"))
                                object.blocked = message.blocked;
                            return object;
                        };
    
                        /**
                         * Converts this SafetyRating to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetyRating.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetyRating
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.SafetyRating
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetyRating.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SafetyRating";
                        };
    
                        /**
                         * HarmProbability enum.
                         * @name google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability
                         * @enum {number}
                         * @property {number} HARM_PROBABILITY_UNSPECIFIED=0 HARM_PROBABILITY_UNSPECIFIED value
                         * @property {number} NEGLIGIBLE=1 NEGLIGIBLE value
                         * @property {number} LOW=2 LOW value
                         * @property {number} MEDIUM=3 MEDIUM value
                         * @property {number} HIGH=4 HIGH value
                         */
                        SafetyRating.HarmProbability = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "HARM_PROBABILITY_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "NEGLIGIBLE"] = 1;
                            values[valuesById[2] = "LOW"] = 2;
                            values[valuesById[3] = "MEDIUM"] = 3;
                            values[valuesById[4] = "HIGH"] = 4;
                            return values;
                        })();
    
                        return SafetyRating;
                    })();
    
                    v1beta.SafetySetting = (function() {
    
                        /**
                         * Properties of a SafetySetting.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ISafetySetting
                         * @property {google.ai.generativelanguage.v1beta.HarmCategory|null} [category] SafetySetting category
                         * @property {google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold|null} [threshold] SafetySetting threshold
                         */
    
                        /**
                         * Constructs a new SafetySetting.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a SafetySetting.
                         * @implements ISafetySetting
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ISafetySetting=} [properties] Properties to set
                         */
                        function SafetySetting(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetySetting category.
                         * @member {google.ai.generativelanguage.v1beta.HarmCategory} category
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @instance
                         */
                        SafetySetting.prototype.category = 0;
    
                        /**
                         * SafetySetting threshold.
                         * @member {google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold} threshold
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @instance
                         */
                        SafetySetting.prototype.threshold = 0;
    
                        /**
                         * Creates a new SafetySetting instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISafetySetting=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting instance
                         */
                        SafetySetting.create = function create(properties) {
                            return new SafetySetting(properties);
                        };
    
                        /**
                         * Encodes the specified SafetySetting message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetySetting.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISafetySetting} message SafetySetting message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetySetting.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.category != null && Object.hasOwnProperty.call(message, "category"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category);
                            if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.threshold);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetySetting.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISafetySetting} message SafetySetting message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetySetting.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetySetting message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetySetting.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SafetySetting();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.category = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.threshold = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetySetting message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetySetting.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetySetting message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetySetting.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.category != null && message.hasOwnProperty("category"))
                                switch (message.category) {
                                default:
                                    return "category: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                case 8:
                                case 9:
                                case 10:
                                case 11:
                                    break;
                                }
                            if (message.threshold != null && message.hasOwnProperty("threshold"))
                                switch (message.threshold) {
                                default:
                                    return "threshold: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                    break;
                                }
                            return null;
                        };
    
                        /**
                         * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting
                         */
                        SafetySetting.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.SafetySetting)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.SafetySetting();
                            switch (object.category) {
                            default:
                                if (typeof object.category === "number") {
                                    message.category = object.category;
                                    break;
                                }
                                break;
                            case "HARM_CATEGORY_UNSPECIFIED":
                            case 0:
                                message.category = 0;
                                break;
                            case "HARM_CATEGORY_DEROGATORY":
                            case 1:
                                message.category = 1;
                                break;
                            case "HARM_CATEGORY_TOXICITY":
                            case 2:
                                message.category = 2;
                                break;
                            case "HARM_CATEGORY_VIOLENCE":
                            case 3:
                                message.category = 3;
                                break;
                            case "HARM_CATEGORY_SEXUAL":
                            case 4:
                                message.category = 4;
                                break;
                            case "HARM_CATEGORY_MEDICAL":
                            case 5:
                                message.category = 5;
                                break;
                            case "HARM_CATEGORY_DANGEROUS":
                            case 6:
                                message.category = 6;
                                break;
                            case "HARM_CATEGORY_HARASSMENT":
                            case 7:
                                message.category = 7;
                                break;
                            case "HARM_CATEGORY_HATE_SPEECH":
                            case 8:
                                message.category = 8;
                                break;
                            case "HARM_CATEGORY_SEXUALLY_EXPLICIT":
                            case 9:
                                message.category = 9;
                                break;
                            case "HARM_CATEGORY_DANGEROUS_CONTENT":
                            case 10:
                                message.category = 10;
                                break;
                            case "HARM_CATEGORY_CIVIC_INTEGRITY":
                            case 11:
                                message.category = 11;
                                break;
                            }
                            switch (object.threshold) {
                            default:
                                if (typeof object.threshold === "number") {
                                    message.threshold = object.threshold;
                                    break;
                                }
                                break;
                            case "HARM_BLOCK_THRESHOLD_UNSPECIFIED":
                            case 0:
                                message.threshold = 0;
                                break;
                            case "BLOCK_LOW_AND_ABOVE":
                            case 1:
                                message.threshold = 1;
                                break;
                            case "BLOCK_MEDIUM_AND_ABOVE":
                            case 2:
                                message.threshold = 2;
                                break;
                            case "BLOCK_ONLY_HIGH":
                            case 3:
                                message.threshold = 3;
                                break;
                            case "BLOCK_NONE":
                            case 4:
                                message.threshold = 4;
                                break;
                            case "OFF":
                            case 5:
                                message.threshold = 5;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetySetting message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.SafetySetting} message SafetySetting
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetySetting.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0;
                                object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0;
                            }
                            if (message.category != null && message.hasOwnProperty("category"))
                                object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] : message.category;
                            if (message.threshold != null && message.hasOwnProperty("threshold"))
                                object.threshold = options.enums === String ? $root.google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold[message.threshold] : message.threshold;
                            return object;
                        };
    
                        /**
                         * Converts this SafetySetting to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetySetting.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetySetting
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.SafetySetting
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SafetySetting";
                        };
    
                        /**
                         * HarmBlockThreshold enum.
                         * @name google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold
                         * @enum {number}
                         * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value
                         * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value
                         * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value
                         * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value
                         * @property {number} BLOCK_NONE=4 BLOCK_NONE value
                         * @property {number} OFF=5 OFF value
                         */
                        SafetySetting.HarmBlockThreshold = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1;
                            values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2;
                            values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3;
                            values[valuesById[4] = "BLOCK_NONE"] = 4;
                            values[valuesById[5] = "OFF"] = 5;
                            return values;
                        })();
    
                        return SafetySetting;
                    })();
    
                    v1beta.File = (function() {
    
                        /**
                         * Properties of a File.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IFile
                         * @property {google.ai.generativelanguage.v1beta.IVideoMetadata|null} [videoMetadata] File videoMetadata
                         * @property {string|null} [name] File name
                         * @property {string|null} [displayName] File displayName
                         * @property {string|null} [mimeType] File mimeType
                         * @property {number|Long|null} [sizeBytes] File sizeBytes
                         * @property {google.protobuf.ITimestamp|null} [createTime] File createTime
                         * @property {google.protobuf.ITimestamp|null} [updateTime] File updateTime
                         * @property {google.protobuf.ITimestamp|null} [expirationTime] File expirationTime
                         * @property {Uint8Array|null} [sha256Hash] File sha256Hash
                         * @property {string|null} [uri] File uri
                         * @property {google.ai.generativelanguage.v1beta.File.State|null} [state] File state
                         * @property {google.rpc.IStatus|null} [error] File error
                         */
    
                        /**
                         * Constructs a new File.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a File.
                         * @implements IFile
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IFile=} [properties] Properties to set
                         */
                        function File(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * File videoMetadata.
                         * @member {google.ai.generativelanguage.v1beta.IVideoMetadata|null|undefined} videoMetadata
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.videoMetadata = null;
    
                        /**
                         * File name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.name = "";
    
                        /**
                         * File displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.displayName = "";
    
                        /**
                         * File mimeType.
                         * @member {string} mimeType
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.mimeType = "";
    
                        /**
                         * File sizeBytes.
                         * @member {number|Long} sizeBytes
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
    
                        /**
                         * File createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.createTime = null;
    
                        /**
                         * File updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.updateTime = null;
    
                        /**
                         * File expirationTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} expirationTime
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.expirationTime = null;
    
                        /**
                         * File sha256Hash.
                         * @member {Uint8Array} sha256Hash
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.sha256Hash = $util.newBuffer([]);
    
                        /**
                         * File uri.
                         * @member {string} uri
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.uri = "";
    
                        /**
                         * File state.
                         * @member {google.ai.generativelanguage.v1beta.File.State} state
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.state = 0;
    
                        /**
                         * File error.
                         * @member {google.rpc.IStatus|null|undefined} error
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        File.prototype.error = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * File metadata.
                         * @member {"videoMetadata"|undefined} metadata
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         */
                        Object.defineProperty(File.prototype, "metadata", {
                            get: $util.oneOfGetter($oneOfFields = ["videoMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new File instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFile=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.File} File instance
                         */
                        File.create = function create(properties) {
                            return new File(properties);
                        };
    
                        /**
                         * Encodes the specified File message. Does not implicitly {@link google.ai.generativelanguage.v1beta.File.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFile} message File message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        File.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName);
                            if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType);
                            if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.sizeBytes);
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime"))
                                $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                            if (message.sha256Hash != null && Object.hasOwnProperty.call(message, "sha256Hash"))
                                writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.sha256Hash);
                            if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
                                writer.uint32(/* id 9, wireType 2 =*/74).string(message.uri);
                            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                                writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state);
                            if (message.error != null && Object.hasOwnProperty.call(message, "error"))
                                $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
                            if (message.videoMetadata != null && Object.hasOwnProperty.call(message, "videoMetadata"))
                                $root.google.ai.generativelanguage.v1beta.VideoMetadata.encode(message.videoMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified File message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.File.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IFile} message File message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        File.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a File message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.File} File
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        File.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.File();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 12: {
                                        message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.mimeType = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.sizeBytes = reader.int64();
                                        break;
                                    }
                                case 5: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 6: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 7: {
                                        message.expirationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 8: {
                                        message.sha256Hash = reader.bytes();
                                        break;
                                    }
                                case 9: {
                                        message.uri = reader.string();
                                        break;
                                    }
                                case 10: {
                                        message.state = reader.int32();
                                        break;
                                    }
                                case 11: {
                                        message.error = $root.google.rpc.Status.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a File message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.File} File
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        File.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a File message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        File.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) {
                                properties.metadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.VideoMetadata.verify(message.videoMetadata);
                                    if (error)
                                        return "videoMetadata." + error;
                                }
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                if (!$util.isString(message.mimeType))
                                    return "mimeType: string expected";
                            if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes"))
                                if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high)))
                                    return "sizeBytes: integer|Long expected";
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.expirationTime);
                                if (error)
                                    return "expirationTime." + error;
                            }
                            if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash"))
                                if (!(message.sha256Hash && typeof message.sha256Hash.length === "number" || $util.isString(message.sha256Hash)))
                                    return "sha256Hash: buffer expected";
                            if (message.uri != null && message.hasOwnProperty("uri"))
                                if (!$util.isString(message.uri))
                                    return "uri: string expected";
                            if (message.state != null && message.hasOwnProperty("state"))
                                switch (message.state) {
                                default:
                                    return "state: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 10:
                                    break;
                                }
                            if (message.error != null && message.hasOwnProperty("error")) {
                                var error = $root.google.rpc.Status.verify(message.error);
                                if (error)
                                    return "error." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a File message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.File} File
                         */
                        File.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.File)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.File();
                            if (object.videoMetadata != null) {
                                if (typeof object.videoMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.File.videoMetadata: object expected");
                                message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.fromObject(object.videoMetadata);
                            }
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.mimeType != null)
                                message.mimeType = String(object.mimeType);
                            if (object.sizeBytes != null)
                                if ($util.Long)
                                    (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false;
                                else if (typeof object.sizeBytes === "string")
                                    message.sizeBytes = parseInt(object.sizeBytes, 10);
                                else if (typeof object.sizeBytes === "number")
                                    message.sizeBytes = object.sizeBytes;
                                else if (typeof object.sizeBytes === "object")
                                    message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber();
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.File.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.File.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            if (object.expirationTime != null) {
                                if (typeof object.expirationTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.File.expirationTime: object expected");
                                message.expirationTime = $root.google.protobuf.Timestamp.fromObject(object.expirationTime);
                            }
                            if (object.sha256Hash != null)
                                if (typeof object.sha256Hash === "string")
                                    $util.base64.decode(object.sha256Hash, message.sha256Hash = $util.newBuffer($util.base64.length(object.sha256Hash)), 0);
                                else if (object.sha256Hash.length >= 0)
                                    message.sha256Hash = object.sha256Hash;
                            if (object.uri != null)
                                message.uri = String(object.uri);
                            switch (object.state) {
                            default:
                                if (typeof object.state === "number") {
                                    message.state = object.state;
                                    break;
                                }
                                break;
                            case "STATE_UNSPECIFIED":
                            case 0:
                                message.state = 0;
                                break;
                            case "PROCESSING":
                            case 1:
                                message.state = 1;
                                break;
                            case "ACTIVE":
                            case 2:
                                message.state = 2;
                                break;
                            case "FAILED":
                            case 10:
                                message.state = 10;
                                break;
                            }
                            if (object.error != null) {
                                if (typeof object.error !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.File.error: object expected");
                                message.error = $root.google.rpc.Status.fromObject(object.error);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a File message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.File} message File
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        File.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.displayName = "";
                                object.mimeType = "";
                                if ($util.Long) {
                                    var long = new $util.Long(0, 0, false);
                                    object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                                } else
                                    object.sizeBytes = options.longs === String ? "0" : 0;
                                object.createTime = null;
                                object.updateTime = null;
                                object.expirationTime = null;
                                if (options.bytes === String)
                                    object.sha256Hash = "";
                                else {
                                    object.sha256Hash = [];
                                    if (options.bytes !== Array)
                                        object.sha256Hash = $util.newBuffer(object.sha256Hash);
                                }
                                object.uri = "";
                                object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
                                object.error = null;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.mimeType != null && message.hasOwnProperty("mimeType"))
                                object.mimeType = message.mimeType;
                            if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes"))
                                if (typeof message.sizeBytes === "number")
                                    object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes;
                                else
                                    object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes;
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            if (message.expirationTime != null && message.hasOwnProperty("expirationTime"))
                                object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options);
                            if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash"))
                                object.sha256Hash = options.bytes === String ? $util.base64.encode(message.sha256Hash, 0, message.sha256Hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.sha256Hash) : message.sha256Hash;
                            if (message.uri != null && message.hasOwnProperty("uri"))
                                object.uri = message.uri;
                            if (message.state != null && message.hasOwnProperty("state"))
                                object.state = options.enums === String ? $root.google.ai.generativelanguage.v1beta.File.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1beta.File.State[message.state] : message.state;
                            if (message.error != null && message.hasOwnProperty("error"))
                                object.error = $root.google.rpc.Status.toObject(message.error, options);
                            if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) {
                                object.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.toObject(message.videoMetadata, options);
                                if (options.oneofs)
                                    object.metadata = "videoMetadata";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this File to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        File.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for File
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.File
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        File.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.File";
                        };
    
                        /**
                         * State enum.
                         * @name google.ai.generativelanguage.v1beta.File.State
                         * @enum {number}
                         * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value
                         * @property {number} PROCESSING=1 PROCESSING value
                         * @property {number} ACTIVE=2 ACTIVE value
                         * @property {number} FAILED=10 FAILED value
                         */
                        File.State = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "STATE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "PROCESSING"] = 1;
                            values[valuesById[2] = "ACTIVE"] = 2;
                            values[valuesById[10] = "FAILED"] = 10;
                            return values;
                        })();
    
                        return File;
                    })();
    
                    v1beta.VideoMetadata = (function() {
    
                        /**
                         * Properties of a VideoMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IVideoMetadata
                         * @property {google.protobuf.IDuration|null} [videoDuration] VideoMetadata videoDuration
                         */
    
                        /**
                         * Constructs a new VideoMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a VideoMetadata.
                         * @implements IVideoMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IVideoMetadata=} [properties] Properties to set
                         */
                        function VideoMetadata(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * VideoMetadata videoDuration.
                         * @member {google.protobuf.IDuration|null|undefined} videoDuration
                         * @memberof google.ai.generativelanguage.v1beta.VideoMetadata
                         * @instance
                         */
                        VideoMetadata.prototype.videoDuration = null;
    
                        /**
                         * Creates a new VideoMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.VideoMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IVideoMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata instance
                         */
                        VideoMetadata.create = function create(properties) {
                            return new VideoMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.VideoMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IVideoMetadata} message VideoMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        VideoMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.videoDuration != null && Object.hasOwnProperty.call(message, "videoDuration"))
                                $root.google.protobuf.Duration.encode(message.videoDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.VideoMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IVideoMetadata} message VideoMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        VideoMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a VideoMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.VideoMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        VideoMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.VideoMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.videoDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a VideoMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.VideoMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        VideoMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a VideoMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.VideoMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        VideoMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.videoDuration != null && message.hasOwnProperty("videoDuration")) {
                                var error = $root.google.protobuf.Duration.verify(message.videoDuration);
                                if (error)
                                    return "videoDuration." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.VideoMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata
                         */
                        VideoMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.VideoMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.VideoMetadata();
                            if (object.videoDuration != null) {
                                if (typeof object.videoDuration !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.VideoMetadata.videoDuration: object expected");
                                message.videoDuration = $root.google.protobuf.Duration.fromObject(object.videoDuration);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.VideoMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.VideoMetadata} message VideoMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        VideoMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.videoDuration = null;
                            if (message.videoDuration != null && message.hasOwnProperty("videoDuration"))
                                object.videoDuration = $root.google.protobuf.Duration.toObject(message.videoDuration, options);
                            return object;
                        };
    
                        /**
                         * Converts this VideoMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.VideoMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        VideoMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for VideoMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.VideoMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        VideoMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.VideoMetadata";
                        };
    
                        return VideoMetadata;
                    })();
    
                    v1beta.FileService = (function() {
    
                        /**
                         * Constructs a new FileService service.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a FileService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function FileService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (FileService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = FileService;
    
                        /**
                         * Creates new FileService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {FileService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        FileService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|createFile}.
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @typedef CreateFileCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.CreateFileResponse} [response] CreateFileResponse
                         */
    
                        /**
                         * Calls CreateFile.
                         * @function createFile
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} request CreateFileRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.FileService.CreateFileCallback} callback Node-style callback called with the error, if any, and CreateFileResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(FileService.prototype.createFile = function createFile(request, callback) {
                            return this.rpcCall(createFile, $root.google.ai.generativelanguage.v1beta.CreateFileRequest, $root.google.ai.generativelanguage.v1beta.CreateFileResponse, request, callback);
                        }, "name", { value: "CreateFile" });
    
                        /**
                         * Calls CreateFile.
                         * @function createFile
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} request CreateFileRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.CreateFileResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|listFiles}.
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @typedef ListFilesCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.ListFilesResponse} [response] ListFilesResponse
                         */
    
                        /**
                         * Calls ListFiles.
                         * @function listFiles
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} request ListFilesRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.FileService.ListFilesCallback} callback Node-style callback called with the error, if any, and ListFilesResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(FileService.prototype.listFiles = function listFiles(request, callback) {
                            return this.rpcCall(listFiles, $root.google.ai.generativelanguage.v1beta.ListFilesRequest, $root.google.ai.generativelanguage.v1beta.ListFilesResponse, request, callback);
                        }, "name", { value: "ListFiles" });
    
                        /**
                         * Calls ListFiles.
                         * @function listFiles
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} request ListFilesRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.ListFilesResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|getFile}.
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @typedef GetFileCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.File} [response] File
                         */
    
                        /**
                         * Calls GetFile.
                         * @function getFile
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} request GetFileRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.FileService.GetFileCallback} callback Node-style callback called with the error, if any, and File
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(FileService.prototype.getFile = function getFile(request, callback) {
                            return this.rpcCall(getFile, $root.google.ai.generativelanguage.v1beta.GetFileRequest, $root.google.ai.generativelanguage.v1beta.File, request, callback);
                        }, "name", { value: "GetFile" });
    
                        /**
                         * Calls GetFile.
                         * @function getFile
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} request GetFileRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.File>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|deleteFile}.
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @typedef DeleteFileCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteFile.
                         * @function deleteFile
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} request DeleteFileRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.FileService.DeleteFileCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(FileService.prototype.deleteFile = function deleteFile(request, callback) {
                            return this.rpcCall(deleteFile, $root.google.ai.generativelanguage.v1beta.DeleteFileRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteFile" });
    
                        /**
                         * Calls DeleteFile.
                         * @function deleteFile
                         * @memberof google.ai.generativelanguage.v1beta.FileService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} request DeleteFileRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        return FileService;
                    })();
    
                    v1beta.CreateFileRequest = (function() {
    
                        /**
                         * Properties of a CreateFileRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICreateFileRequest
                         * @property {google.ai.generativelanguage.v1beta.IFile|null} [file] CreateFileRequest file
                         */
    
                        /**
                         * Constructs a new CreateFileRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CreateFileRequest.
                         * @implements ICreateFileRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest=} [properties] Properties to set
                         */
                        function CreateFileRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateFileRequest file.
                         * @member {google.ai.generativelanguage.v1beta.IFile|null|undefined} file
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest
                         * @instance
                         */
                        CreateFileRequest.prototype.file = null;
    
                        /**
                         * Creates a new CreateFileRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CreateFileRequest} CreateFileRequest instance
                         */
                        CreateFileRequest.create = function create(properties) {
                            return new CreateFileRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} message CreateFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateFileRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.file != null && Object.hasOwnProperty.call(message, "file"))
                                $root.google.ai.generativelanguage.v1beta.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} message CreateFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateFileRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateFileRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CreateFileRequest} CreateFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateFileRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CreateFileRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.file = $root.google.ai.generativelanguage.v1beta.File.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateFileRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CreateFileRequest} CreateFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateFileRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateFileRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateFileRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.file != null && message.hasOwnProperty("file")) {
                                var error = $root.google.ai.generativelanguage.v1beta.File.verify(message.file);
                                if (error)
                                    return "file." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateFileRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CreateFileRequest} CreateFileRequest
                         */
                        CreateFileRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateFileRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CreateFileRequest();
                            if (object.file != null) {
                                if (typeof object.file !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CreateFileRequest.file: object expected");
                                message.file = $root.google.ai.generativelanguage.v1beta.File.fromObject(object.file);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateFileRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CreateFileRequest} message CreateFileRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateFileRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.file = null;
                            if (message.file != null && message.hasOwnProperty("file"))
                                object.file = $root.google.ai.generativelanguage.v1beta.File.toObject(message.file, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateFileRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateFileRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateFileRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateFileRequest";
                        };
    
                        return CreateFileRequest;
                    })();
    
                    v1beta.CreateFileResponse = (function() {
    
                        /**
                         * Properties of a CreateFileResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICreateFileResponse
                         * @property {google.ai.generativelanguage.v1beta.IFile|null} [file] CreateFileResponse file
                         */
    
                        /**
                         * Constructs a new CreateFileResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CreateFileResponse.
                         * @implements ICreateFileResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse=} [properties] Properties to set
                         */
                        function CreateFileResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateFileResponse file.
                         * @member {google.ai.generativelanguage.v1beta.IFile|null|undefined} file
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse
                         * @instance
                         */
                        CreateFileResponse.prototype.file = null;
    
                        /**
                         * Creates a new CreateFileResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CreateFileResponse} CreateFileResponse instance
                         */
                        CreateFileResponse.create = function create(properties) {
                            return new CreateFileResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CreateFileResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse} message CreateFileResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateFileResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.file != null && Object.hasOwnProperty.call(message, "file"))
                                $root.google.ai.generativelanguage.v1beta.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateFileResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse} message CreateFileResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateFileResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateFileResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CreateFileResponse} CreateFileResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateFileResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CreateFileResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.file = $root.google.ai.generativelanguage.v1beta.File.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateFileResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CreateFileResponse} CreateFileResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateFileResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateFileResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateFileResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.file != null && message.hasOwnProperty("file")) {
                                var error = $root.google.ai.generativelanguage.v1beta.File.verify(message.file);
                                if (error)
                                    return "file." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateFileResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CreateFileResponse} CreateFileResponse
                         */
                        CreateFileResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateFileResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CreateFileResponse();
                            if (object.file != null) {
                                if (typeof object.file !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CreateFileResponse.file: object expected");
                                message.file = $root.google.ai.generativelanguage.v1beta.File.fromObject(object.file);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateFileResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CreateFileResponse} message CreateFileResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateFileResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.file = null;
                            if (message.file != null && message.hasOwnProperty("file"))
                                object.file = $root.google.ai.generativelanguage.v1beta.File.toObject(message.file, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateFileResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateFileResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateFileResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateFileResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateFileResponse";
                        };
    
                        return CreateFileResponse;
                    })();
    
                    v1beta.ListFilesRequest = (function() {
    
                        /**
                         * Properties of a ListFilesRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListFilesRequest
                         * @property {number|null} [pageSize] ListFilesRequest pageSize
                         * @property {string|null} [pageToken] ListFilesRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListFilesRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListFilesRequest.
                         * @implements IListFilesRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListFilesRequest=} [properties] Properties to set
                         */
                        function ListFilesRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListFilesRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @instance
                         */
                        ListFilesRequest.prototype.pageSize = 0;
    
                        /**
                         * ListFilesRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @instance
                         */
                        ListFilesRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListFilesRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListFilesRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListFilesRequest} ListFilesRequest instance
                         */
                        ListFilesRequest.create = function create(properties) {
                            return new ListFilesRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListFilesRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} message ListFilesRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListFilesRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListFilesRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} message ListFilesRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListFilesRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListFilesRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListFilesRequest} ListFilesRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListFilesRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListFilesRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListFilesRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListFilesRequest} ListFilesRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListFilesRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListFilesRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListFilesRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListFilesRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListFilesRequest} ListFilesRequest
                         */
                        ListFilesRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListFilesRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListFilesRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListFilesRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListFilesRequest} message ListFilesRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListFilesRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListFilesRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListFilesRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListFilesRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListFilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListFilesRequest";
                        };
    
                        return ListFilesRequest;
                    })();
    
                    v1beta.ListFilesResponse = (function() {
    
                        /**
                         * Properties of a ListFilesResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListFilesResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IFile>|null} [files] ListFilesResponse files
                         * @property {string|null} [nextPageToken] ListFilesResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListFilesResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListFilesResponse.
                         * @implements IListFilesResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListFilesResponse=} [properties] Properties to set
                         */
                        function ListFilesResponse(properties) {
                            this.files = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListFilesResponse files.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IFile>} files
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @instance
                         */
                        ListFilesResponse.prototype.files = $util.emptyArray;
    
                        /**
                         * ListFilesResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @instance
                         */
                        ListFilesResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListFilesResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListFilesResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListFilesResponse} ListFilesResponse instance
                         */
                        ListFilesResponse.create = function create(properties) {
                            return new ListFilesResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListFilesResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListFilesResponse} message ListFilesResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListFilesResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.files != null && message.files.length)
                                for (var i = 0; i < message.files.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.File.encode(message.files[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListFilesResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListFilesResponse} message ListFilesResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListFilesResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListFilesResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListFilesResponse} ListFilesResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListFilesResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListFilesResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.files && message.files.length))
                                            message.files = [];
                                        message.files.push($root.google.ai.generativelanguage.v1beta.File.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListFilesResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListFilesResponse} ListFilesResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListFilesResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListFilesResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListFilesResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.files != null && message.hasOwnProperty("files")) {
                                if (!Array.isArray(message.files))
                                    return "files: array expected";
                                for (var i = 0; i < message.files.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.File.verify(message.files[i]);
                                    if (error)
                                        return "files." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListFilesResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListFilesResponse} ListFilesResponse
                         */
                        ListFilesResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListFilesResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListFilesResponse();
                            if (object.files) {
                                if (!Array.isArray(object.files))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.ListFilesResponse.files: array expected");
                                message.files = [];
                                for (var i = 0; i < object.files.length; ++i) {
                                    if (typeof object.files[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.ListFilesResponse.files: object expected");
                                    message.files[i] = $root.google.ai.generativelanguage.v1beta.File.fromObject(object.files[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListFilesResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListFilesResponse} message ListFilesResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListFilesResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.files = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.files && message.files.length) {
                                object.files = [];
                                for (var j = 0; j < message.files.length; ++j)
                                    object.files[j] = $root.google.ai.generativelanguage.v1beta.File.toObject(message.files[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListFilesResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListFilesResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListFilesResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListFilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListFilesResponse";
                        };
    
                        return ListFilesResponse;
                    })();
    
                    v1beta.GetFileRequest = (function() {
    
                        /**
                         * Properties of a GetFileRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGetFileRequest
                         * @property {string|null} [name] GetFileRequest name
                         */
    
                        /**
                         * Constructs a new GetFileRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GetFileRequest.
                         * @implements IGetFileRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGetFileRequest=} [properties] Properties to set
                         */
                        function GetFileRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetFileRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.GetFileRequest
                         * @instance
                         */
                        GetFileRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetFileRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GetFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetFileRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GetFileRequest} GetFileRequest instance
                         */
                        GetFileRequest.create = function create(properties) {
                            return new GetFileRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetFileRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GetFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} message GetFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetFileRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetFileRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} message GetFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetFileRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetFileRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GetFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GetFileRequest} GetFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetFileRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GetFileRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetFileRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GetFileRequest} GetFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetFileRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetFileRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GetFileRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetFileRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetFileRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GetFileRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GetFileRequest} GetFileRequest
                         */
                        GetFileRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GetFileRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GetFileRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetFileRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GetFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GetFileRequest} message GetFileRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetFileRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetFileRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GetFileRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetFileRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetFileRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GetFileRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetFileRequest";
                        };
    
                        return GetFileRequest;
                    })();
    
                    v1beta.DeleteFileRequest = (function() {
    
                        /**
                         * Properties of a DeleteFileRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IDeleteFileRequest
                         * @property {string|null} [name] DeleteFileRequest name
                         */
    
                        /**
                         * Constructs a new DeleteFileRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a DeleteFileRequest.
                         * @implements IDeleteFileRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest=} [properties] Properties to set
                         */
                        function DeleteFileRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteFileRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest
                         * @instance
                         */
                        DeleteFileRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeleteFileRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.DeleteFileRequest} DeleteFileRequest instance
                         */
                        DeleteFileRequest.create = function create(properties) {
                            return new DeleteFileRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteFileRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteFileRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteFileRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteFileRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteFileRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.DeleteFileRequest} DeleteFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteFileRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.DeleteFileRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteFileRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.DeleteFileRequest} DeleteFileRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteFileRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteFileRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteFileRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteFileRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.DeleteFileRequest} DeleteFileRequest
                         */
                        DeleteFileRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.DeleteFileRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.DeleteFileRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteFileRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.DeleteFileRequest} message DeleteFileRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteFileRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteFileRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteFileRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteFileRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DeleteFileRequest";
                        };
    
                        return DeleteFileRequest;
                    })();
    
                    v1beta.GenerativeService = (function() {
    
                        /**
                         * Constructs a new GenerativeService service.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GenerativeService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function GenerativeService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (GenerativeService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GenerativeService;
    
                        /**
                         * Creates new GenerativeService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {GenerativeService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        GenerativeService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|generateContent}.
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @typedef GenerateContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse} [response] GenerateContentResponse
                         */
    
                        /**
                         * Calls GenerateContent.
                         * @function generateContent
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.GenerativeService.GenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.generateContent = function generateContent(request, callback) {
                            return this.rpcCall(generateContent, $root.google.ai.generativelanguage.v1beta.GenerateContentRequest, $root.google.ai.generativelanguage.v1beta.GenerateContentResponse, request, callback);
                        }, "name", { value: "GenerateContent" });
    
                        /**
                         * Calls GenerateContent.
                         * @function generateContent
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.GenerateContentResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|generateAnswer}.
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @typedef GenerateAnswerCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.GenerateAnswerResponse} [response] GenerateAnswerResponse
                         */
    
                        /**
                         * Calls GenerateAnswer.
                         * @function generateAnswer
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerRequest} request GenerateAnswerRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.GenerativeService.GenerateAnswerCallback} callback Node-style callback called with the error, if any, and GenerateAnswerResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.generateAnswer = function generateAnswer(request, callback) {
                            return this.rpcCall(generateAnswer, $root.google.ai.generativelanguage.v1beta.GenerateAnswerRequest, $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse, request, callback);
                        }, "name", { value: "GenerateAnswer" });
    
                        /**
                         * Calls GenerateAnswer.
                         * @function generateAnswer
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerRequest} request GenerateAnswerRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.GenerateAnswerResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|streamGenerateContent}.
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @typedef StreamGenerateContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse} [response] GenerateContentResponse
                         */
    
                        /**
                         * Calls StreamGenerateContent.
                         * @function streamGenerateContent
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.GenerativeService.StreamGenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.streamGenerateContent = function streamGenerateContent(request, callback) {
                            return this.rpcCall(streamGenerateContent, $root.google.ai.generativelanguage.v1beta.GenerateContentRequest, $root.google.ai.generativelanguage.v1beta.GenerateContentResponse, request, callback);
                        }, "name", { value: "StreamGenerateContent" });
    
                        /**
                         * Calls StreamGenerateContent.
                         * @function streamGenerateContent
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.GenerateContentResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|embedContent}.
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @typedef EmbedContentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.EmbedContentResponse} [response] EmbedContentResponse
                         */
    
                        /**
                         * Calls EmbedContent.
                         * @function embedContent
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IEmbedContentRequest} request EmbedContentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.GenerativeService.EmbedContentCallback} callback Node-style callback called with the error, if any, and EmbedContentResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.embedContent = function embedContent(request, callback) {
                            return this.rpcCall(embedContent, $root.google.ai.generativelanguage.v1beta.EmbedContentRequest, $root.google.ai.generativelanguage.v1beta.EmbedContentResponse, request, callback);
                        }, "name", { value: "EmbedContent" });
    
                        /**
                         * Calls EmbedContent.
                         * @function embedContent
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IEmbedContentRequest} request EmbedContentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.EmbedContentResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|batchEmbedContents}.
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @typedef BatchEmbedContentsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse} [response] BatchEmbedContentsResponse
                         */
    
                        /**
                         * Calls BatchEmbedContents.
                         * @function batchEmbedContents
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.GenerativeService.BatchEmbedContentsCallback} callback Node-style callback called with the error, if any, and BatchEmbedContentsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.batchEmbedContents = function batchEmbedContents(request, callback) {
                            return this.rpcCall(batchEmbedContents, $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest, $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse, request, callback);
                        }, "name", { value: "BatchEmbedContents" });
    
                        /**
                         * Calls BatchEmbedContents.
                         * @function batchEmbedContents
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|countTokens}.
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @typedef CountTokensCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.CountTokensResponse} [response] CountTokensResponse
                         */
    
                        /**
                         * Calls CountTokens.
                         * @function countTokens
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICountTokensRequest} request CountTokensRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.GenerativeService.CountTokensCallback} callback Node-style callback called with the error, if any, and CountTokensResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(GenerativeService.prototype.countTokens = function countTokens(request, callback) {
                            return this.rpcCall(countTokens, $root.google.ai.generativelanguage.v1beta.CountTokensRequest, $root.google.ai.generativelanguage.v1beta.CountTokensResponse, request, callback);
                        }, "name", { value: "CountTokens" });
    
                        /**
                         * Calls CountTokens.
                         * @function countTokens
                         * @memberof google.ai.generativelanguage.v1beta.GenerativeService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICountTokensRequest} request CountTokensRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.CountTokensResponse>} Promise
                         * @variation 2
                         */
    
                        return GenerativeService;
                    })();
    
                    /**
                     * TaskType enum.
                     * @name google.ai.generativelanguage.v1beta.TaskType
                     * @enum {number}
                     * @property {number} TASK_TYPE_UNSPECIFIED=0 TASK_TYPE_UNSPECIFIED value
                     * @property {number} RETRIEVAL_QUERY=1 RETRIEVAL_QUERY value
                     * @property {number} RETRIEVAL_DOCUMENT=2 RETRIEVAL_DOCUMENT value
                     * @property {number} SEMANTIC_SIMILARITY=3 SEMANTIC_SIMILARITY value
                     * @property {number} CLASSIFICATION=4 CLASSIFICATION value
                     * @property {number} CLUSTERING=5 CLUSTERING value
                     * @property {number} QUESTION_ANSWERING=6 QUESTION_ANSWERING value
                     * @property {number} FACT_VERIFICATION=7 FACT_VERIFICATION value
                     */
                    v1beta.TaskType = (function() {
                        var valuesById = {}, values = Object.create(valuesById);
                        values[valuesById[0] = "TASK_TYPE_UNSPECIFIED"] = 0;
                        values[valuesById[1] = "RETRIEVAL_QUERY"] = 1;
                        values[valuesById[2] = "RETRIEVAL_DOCUMENT"] = 2;
                        values[valuesById[3] = "SEMANTIC_SIMILARITY"] = 3;
                        values[valuesById[4] = "CLASSIFICATION"] = 4;
                        values[valuesById[5] = "CLUSTERING"] = 5;
                        values[valuesById[6] = "QUESTION_ANSWERING"] = 6;
                        values[valuesById[7] = "FACT_VERIFICATION"] = 7;
                        return values;
                    })();
    
                    v1beta.GenerateContentRequest = (function() {
    
                        /**
                         * Properties of a GenerateContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGenerateContentRequest
                         * @property {string|null} [model] GenerateContentRequest model
                         * @property {google.ai.generativelanguage.v1beta.IContent|null} [systemInstruction] GenerateContentRequest systemInstruction
                         * @property {Array.<google.ai.generativelanguage.v1beta.IContent>|null} [contents] GenerateContentRequest contents
                         * @property {Array.<google.ai.generativelanguage.v1beta.ITool>|null} [tools] GenerateContentRequest tools
                         * @property {google.ai.generativelanguage.v1beta.IToolConfig|null} [toolConfig] GenerateContentRequest toolConfig
                         * @property {Array.<google.ai.generativelanguage.v1beta.ISafetySetting>|null} [safetySettings] GenerateContentRequest safetySettings
                         * @property {google.ai.generativelanguage.v1beta.IGenerationConfig|null} [generationConfig] GenerateContentRequest generationConfig
                         * @property {string|null} [cachedContent] GenerateContentRequest cachedContent
                         */
    
                        /**
                         * Constructs a new GenerateContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GenerateContentRequest.
                         * @implements IGenerateContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest=} [properties] Properties to set
                         */
                        function GenerateContentRequest(properties) {
                            this.contents = [];
                            this.tools = [];
                            this.safetySettings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateContentRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.model = "";
    
                        /**
                         * GenerateContentRequest systemInstruction.
                         * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} systemInstruction
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.systemInstruction = null;
    
                        /**
                         * GenerateContentRequest contents.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IContent>} contents
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.contents = $util.emptyArray;
    
                        /**
                         * GenerateContentRequest tools.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ITool>} tools
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.tools = $util.emptyArray;
    
                        /**
                         * GenerateContentRequest toolConfig.
                         * @member {google.ai.generativelanguage.v1beta.IToolConfig|null|undefined} toolConfig
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.toolConfig = null;
    
                        /**
                         * GenerateContentRequest safetySettings.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ISafetySetting>} safetySettings
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.safetySettings = $util.emptyArray;
    
                        /**
                         * GenerateContentRequest generationConfig.
                         * @member {google.ai.generativelanguage.v1beta.IGenerationConfig|null|undefined} generationConfig
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.generationConfig = null;
    
                        /**
                         * GenerateContentRequest cachedContent.
                         * @member {string|null|undefined} cachedContent
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         */
                        GenerateContentRequest.prototype.cachedContent = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateContentRequest _systemInstruction.
                         * @member {"systemInstruction"|undefined} _systemInstruction
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateContentRequest.prototype, "_systemInstruction", {
                            get: $util.oneOfGetter($oneOfFields = ["systemInstruction"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateContentRequest _generationConfig.
                         * @member {"generationConfig"|undefined} _generationConfig
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateContentRequest.prototype, "_generationConfig", {
                            get: $util.oneOfGetter($oneOfFields = ["generationConfig"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateContentRequest _cachedContent.
                         * @member {"cachedContent"|undefined} _cachedContent
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateContentRequest.prototype, "_cachedContent", {
                            get: $util.oneOfGetter($oneOfFields = ["cachedContent"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GenerateContentRequest} GenerateContentRequest instance
                         */
                        GenerateContentRequest.create = function create(properties) {
                            return new GenerateContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.contents != null && message.contents.length)
                                for (var i = 0; i < message.contents.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.safetySettings != null && message.safetySettings.length)
                                for (var i = 0; i < message.safetySettings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.generationConfig != null && Object.hasOwnProperty.call(message, "generationConfig"))
                                $root.google.ai.generativelanguage.v1beta.GenerationConfig.encode(message.generationConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.tools != null && message.tools.length)
                                for (var i = 0; i < message.tools.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.toolConfig != null && Object.hasOwnProperty.call(message, "toolConfig"))
                                $root.google.ai.generativelanguage.v1beta.ToolConfig.encode(message.toolConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                            if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction"))
                                $root.google.ai.generativelanguage.v1beta.Content.encode(message.systemInstruction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.cachedContent != null && Object.hasOwnProperty.call(message, "cachedContent"))
                                writer.uint32(/* id 9, wireType 2 =*/74).string(message.cachedContent);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GenerateContentRequest} GenerateContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 8: {
                                        message.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        if (!(message.contents && message.contents.length))
                                            message.contents = [];
                                        message.contents.push($root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 5: {
                                        if (!(message.tools && message.tools.length))
                                            message.tools = [];
                                        message.tools.push($root.google.ai.generativelanguage.v1beta.Tool.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 7: {
                                        message.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.safetySettings && message.safetySettings.length))
                                            message.safetySettings = [];
                                        message.safetySettings.push($root.google.ai.generativelanguage.v1beta.SafetySetting.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.generationConfig = $root.google.ai.generativelanguage.v1beta.GenerationConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 9: {
                                        message.cachedContent = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GenerateContentRequest} GenerateContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) {
                                properties._systemInstruction = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.systemInstruction);
                                    if (error)
                                        return "systemInstruction." + error;
                                }
                            }
                            if (message.contents != null && message.hasOwnProperty("contents")) {
                                if (!Array.isArray(message.contents))
                                    return "contents: array expected";
                                for (var i = 0; i < message.contents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.contents[i]);
                                    if (error)
                                        return "contents." + error;
                                }
                            }
                            if (message.tools != null && message.hasOwnProperty("tools")) {
                                if (!Array.isArray(message.tools))
                                    return "tools: array expected";
                                for (var i = 0; i < message.tools.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Tool.verify(message.tools[i]);
                                    if (error)
                                        return "tools." + error;
                                }
                            }
                            if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) {
                                var error = $root.google.ai.generativelanguage.v1beta.ToolConfig.verify(message.toolConfig);
                                if (error)
                                    return "toolConfig." + error;
                            }
                            if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) {
                                if (!Array.isArray(message.safetySettings))
                                    return "safetySettings: array expected";
                                for (var i = 0; i < message.safetySettings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.SafetySetting.verify(message.safetySettings[i]);
                                    if (error)
                                        return "safetySettings." + error;
                                }
                            }
                            if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) {
                                properties._generationConfig = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.GenerationConfig.verify(message.generationConfig);
                                    if (error)
                                        return "generationConfig." + error;
                                }
                            }
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) {
                                properties._cachedContent = 1;
                                if (!$util.isString(message.cachedContent))
                                    return "cachedContent: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GenerateContentRequest} GenerateContentRequest
                         */
                        GenerateContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GenerateContentRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.systemInstruction != null) {
                                if (typeof object.systemInstruction !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.systemInstruction: object expected");
                                message.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.systemInstruction);
                            }
                            if (object.contents) {
                                if (!Array.isArray(object.contents))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.contents: array expected");
                                message.contents = [];
                                for (var i = 0; i < object.contents.length; ++i) {
                                    if (typeof object.contents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.contents: object expected");
                                    message.contents[i] = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.contents[i]);
                                }
                            }
                            if (object.tools) {
                                if (!Array.isArray(object.tools))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.tools: array expected");
                                message.tools = [];
                                for (var i = 0; i < object.tools.length; ++i) {
                                    if (typeof object.tools[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.tools: object expected");
                                    message.tools[i] = $root.google.ai.generativelanguage.v1beta.Tool.fromObject(object.tools[i]);
                                }
                            }
                            if (object.toolConfig != null) {
                                if (typeof object.toolConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.toolConfig: object expected");
                                message.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.fromObject(object.toolConfig);
                            }
                            if (object.safetySettings) {
                                if (!Array.isArray(object.safetySettings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.safetySettings: array expected");
                                message.safetySettings = [];
                                for (var i = 0; i < object.safetySettings.length; ++i) {
                                    if (typeof object.safetySettings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.safetySettings: object expected");
                                    message.safetySettings[i] = $root.google.ai.generativelanguage.v1beta.SafetySetting.fromObject(object.safetySettings[i]);
                                }
                            }
                            if (object.generationConfig != null) {
                                if (typeof object.generationConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.generationConfig: object expected");
                                message.generationConfig = $root.google.ai.generativelanguage.v1beta.GenerationConfig.fromObject(object.generationConfig);
                            }
                            if (object.cachedContent != null)
                                message.cachedContent = String(object.cachedContent);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GenerateContentRequest} message GenerateContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.contents = [];
                                object.safetySettings = [];
                                object.tools = [];
                            }
                            if (options.defaults) {
                                object.model = "";
                                object.toolConfig = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.contents && message.contents.length) {
                                object.contents = [];
                                for (var j = 0; j < message.contents.length; ++j)
                                    object.contents[j] = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.contents[j], options);
                            }
                            if (message.safetySettings && message.safetySettings.length) {
                                object.safetySettings = [];
                                for (var j = 0; j < message.safetySettings.length; ++j)
                                    object.safetySettings[j] = $root.google.ai.generativelanguage.v1beta.SafetySetting.toObject(message.safetySettings[j], options);
                            }
                            if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) {
                                object.generationConfig = $root.google.ai.generativelanguage.v1beta.GenerationConfig.toObject(message.generationConfig, options);
                                if (options.oneofs)
                                    object._generationConfig = "generationConfig";
                            }
                            if (message.tools && message.tools.length) {
                                object.tools = [];
                                for (var j = 0; j < message.tools.length; ++j)
                                    object.tools[j] = $root.google.ai.generativelanguage.v1beta.Tool.toObject(message.tools[j], options);
                            }
                            if (message.toolConfig != null && message.hasOwnProperty("toolConfig"))
                                object.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.toObject(message.toolConfig, options);
                            if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) {
                                object.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.systemInstruction, options);
                                if (options.oneofs)
                                    object._systemInstruction = "systemInstruction";
                            }
                            if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) {
                                object.cachedContent = message.cachedContent;
                                if (options.oneofs)
                                    object._cachedContent = "cachedContent";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateContentRequest";
                        };
    
                        return GenerateContentRequest;
                    })();
    
                    v1beta.PrebuiltVoiceConfig = (function() {
    
                        /**
                         * Properties of a PrebuiltVoiceConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IPrebuiltVoiceConfig
                         * @property {string|null} [voiceName] PrebuiltVoiceConfig voiceName
                         */
    
                        /**
                         * Constructs a new PrebuiltVoiceConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a PrebuiltVoiceConfig.
                         * @implements IPrebuiltVoiceConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig=} [properties] Properties to set
                         */
                        function PrebuiltVoiceConfig(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * PrebuiltVoiceConfig voiceName.
                         * @member {string|null|undefined} voiceName
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @instance
                         */
                        PrebuiltVoiceConfig.prototype.voiceName = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * PrebuiltVoiceConfig _voiceName.
                         * @member {"voiceName"|undefined} _voiceName
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @instance
                         */
                        Object.defineProperty(PrebuiltVoiceConfig.prototype, "_voiceName", {
                            get: $util.oneOfGetter($oneOfFields = ["voiceName"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new PrebuiltVoiceConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig} PrebuiltVoiceConfig instance
                         */
                        PrebuiltVoiceConfig.create = function create(properties) {
                            return new PrebuiltVoiceConfig(properties);
                        };
    
                        /**
                         * Encodes the specified PrebuiltVoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig} message PrebuiltVoiceConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PrebuiltVoiceConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.voiceName != null && Object.hasOwnProperty.call(message, "voiceName"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.voiceName);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified PrebuiltVoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig} message PrebuiltVoiceConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PrebuiltVoiceConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig} PrebuiltVoiceConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PrebuiltVoiceConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.voiceName = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig} PrebuiltVoiceConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PrebuiltVoiceConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a PrebuiltVoiceConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        PrebuiltVoiceConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.voiceName != null && message.hasOwnProperty("voiceName")) {
                                properties._voiceName = 1;
                                if (!$util.isString(message.voiceName))
                                    return "voiceName: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a PrebuiltVoiceConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig} PrebuiltVoiceConfig
                         */
                        PrebuiltVoiceConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig();
                            if (object.voiceName != null)
                                message.voiceName = String(object.voiceName);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a PrebuiltVoiceConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig} message PrebuiltVoiceConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        PrebuiltVoiceConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.voiceName != null && message.hasOwnProperty("voiceName")) {
                                object.voiceName = message.voiceName;
                                if (options.oneofs)
                                    object._voiceName = "voiceName";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this PrebuiltVoiceConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        PrebuiltVoiceConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for PrebuiltVoiceConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        PrebuiltVoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig";
                        };
    
                        return PrebuiltVoiceConfig;
                    })();
    
                    v1beta.VoiceConfig = (function() {
    
                        /**
                         * Properties of a VoiceConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IVoiceConfig
                         * @property {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig|null} [prebuiltVoiceConfig] VoiceConfig prebuiltVoiceConfig
                         */
    
                        /**
                         * Constructs a new VoiceConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a VoiceConfig.
                         * @implements IVoiceConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IVoiceConfig=} [properties] Properties to set
                         */
                        function VoiceConfig(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * VoiceConfig prebuiltVoiceConfig.
                         * @member {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig|null|undefined} prebuiltVoiceConfig
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @instance
                         */
                        VoiceConfig.prototype.prebuiltVoiceConfig = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * VoiceConfig voiceConfig.
                         * @member {"prebuiltVoiceConfig"|undefined} voiceConfig
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @instance
                         */
                        Object.defineProperty(VoiceConfig.prototype, "voiceConfig", {
                            get: $util.oneOfGetter($oneOfFields = ["prebuiltVoiceConfig"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new VoiceConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IVoiceConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.VoiceConfig} VoiceConfig instance
                         */
                        VoiceConfig.create = function create(properties) {
                            return new VoiceConfig(properties);
                        };
    
                        /**
                         * Encodes the specified VoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VoiceConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IVoiceConfig} message VoiceConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        VoiceConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.prebuiltVoiceConfig != null && Object.hasOwnProperty.call(message, "prebuiltVoiceConfig"))
                                $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.encode(message.prebuiltVoiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified VoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VoiceConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IVoiceConfig} message VoiceConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        VoiceConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a VoiceConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.VoiceConfig} VoiceConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        VoiceConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.VoiceConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a VoiceConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.VoiceConfig} VoiceConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        VoiceConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a VoiceConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        VoiceConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.prebuiltVoiceConfig != null && message.hasOwnProperty("prebuiltVoiceConfig")) {
                                properties.voiceConfig = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.verify(message.prebuiltVoiceConfig);
                                    if (error)
                                        return "prebuiltVoiceConfig." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a VoiceConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.VoiceConfig} VoiceConfig
                         */
                        VoiceConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.VoiceConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.VoiceConfig();
                            if (object.prebuiltVoiceConfig != null) {
                                if (typeof object.prebuiltVoiceConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.VoiceConfig.prebuiltVoiceConfig: object expected");
                                message.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.fromObject(object.prebuiltVoiceConfig);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a VoiceConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.VoiceConfig} message VoiceConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        VoiceConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.prebuiltVoiceConfig != null && message.hasOwnProperty("prebuiltVoiceConfig")) {
                                object.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.toObject(message.prebuiltVoiceConfig, options);
                                if (options.oneofs)
                                    object.voiceConfig = "prebuiltVoiceConfig";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this VoiceConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        VoiceConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for VoiceConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.VoiceConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        VoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.VoiceConfig";
                        };
    
                        return VoiceConfig;
                    })();
    
                    v1beta.SpeechConfig = (function() {
    
                        /**
                         * Properties of a SpeechConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ISpeechConfig
                         * @property {google.ai.generativelanguage.v1beta.IVoiceConfig|null} [voiceConfig] SpeechConfig voiceConfig
                         */
    
                        /**
                         * Constructs a new SpeechConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a SpeechConfig.
                         * @implements ISpeechConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ISpeechConfig=} [properties] Properties to set
                         */
                        function SpeechConfig(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SpeechConfig voiceConfig.
                         * @member {google.ai.generativelanguage.v1beta.IVoiceConfig|null|undefined} voiceConfig
                         * @memberof google.ai.generativelanguage.v1beta.SpeechConfig
                         * @instance
                         */
                        SpeechConfig.prototype.voiceConfig = null;
    
                        /**
                         * Creates a new SpeechConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.SpeechConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISpeechConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.SpeechConfig} SpeechConfig instance
                         */
                        SpeechConfig.create = function create(properties) {
                            return new SpeechConfig(properties);
                        };
    
                        /**
                         * Encodes the specified SpeechConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SpeechConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.SpeechConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISpeechConfig} message SpeechConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SpeechConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.voiceConfig != null && Object.hasOwnProperty.call(message, "voiceConfig"))
                                $root.google.ai.generativelanguage.v1beta.VoiceConfig.encode(message.voiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SpeechConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SpeechConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISpeechConfig} message SpeechConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SpeechConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SpeechConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.SpeechConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.SpeechConfig} SpeechConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SpeechConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SpeechConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SpeechConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SpeechConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.SpeechConfig} SpeechConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SpeechConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SpeechConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.SpeechConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SpeechConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig")) {
                                var error = $root.google.ai.generativelanguage.v1beta.VoiceConfig.verify(message.voiceConfig);
                                if (error)
                                    return "voiceConfig." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.SpeechConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.SpeechConfig} SpeechConfig
                         */
                        SpeechConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.SpeechConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.SpeechConfig();
                            if (object.voiceConfig != null) {
                                if (typeof object.voiceConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.SpeechConfig.voiceConfig: object expected");
                                message.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.fromObject(object.voiceConfig);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.SpeechConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.SpeechConfig} message SpeechConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SpeechConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.voiceConfig = null;
                            if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig"))
                                object.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.toObject(message.voiceConfig, options);
                            return object;
                        };
    
                        /**
                         * Converts this SpeechConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.SpeechConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SpeechConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SpeechConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.SpeechConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SpeechConfig";
                        };
    
                        return SpeechConfig;
                    })();
    
                    v1beta.GenerationConfig = (function() {
    
                        /**
                         * Properties of a GenerationConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGenerationConfig
                         * @property {number|null} [candidateCount] GenerationConfig candidateCount
                         * @property {Array.<string>|null} [stopSequences] GenerationConfig stopSequences
                         * @property {number|null} [maxOutputTokens] GenerationConfig maxOutputTokens
                         * @property {number|null} [temperature] GenerationConfig temperature
                         * @property {number|null} [topP] GenerationConfig topP
                         * @property {number|null} [topK] GenerationConfig topK
                         * @property {string|null} [responseMimeType] GenerationConfig responseMimeType
                         * @property {google.ai.generativelanguage.v1beta.ISchema|null} [responseSchema] GenerationConfig responseSchema
                         * @property {number|null} [presencePenalty] GenerationConfig presencePenalty
                         * @property {number|null} [frequencyPenalty] GenerationConfig frequencyPenalty
                         * @property {boolean|null} [responseLogprobs] GenerationConfig responseLogprobs
                         * @property {number|null} [logprobs] GenerationConfig logprobs
                         * @property {boolean|null} [enableEnhancedCivicAnswers] GenerationConfig enableEnhancedCivicAnswers
                         * @property {Array.<google.ai.generativelanguage.v1beta.GenerationConfig.Modality>|null} [responseModalities] GenerationConfig responseModalities
                         * @property {google.ai.generativelanguage.v1beta.ISpeechConfig|null} [speechConfig] GenerationConfig speechConfig
                         */
    
                        /**
                         * Constructs a new GenerationConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GenerationConfig.
                         * @implements IGenerationConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGenerationConfig=} [properties] Properties to set
                         */
                        function GenerationConfig(properties) {
                            this.stopSequences = [];
                            this.responseModalities = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerationConfig candidateCount.
                         * @member {number|null|undefined} candidateCount
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.candidateCount = null;
    
                        /**
                         * GenerationConfig stopSequences.
                         * @member {Array.<string>} stopSequences
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.stopSequences = $util.emptyArray;
    
                        /**
                         * GenerationConfig maxOutputTokens.
                         * @member {number|null|undefined} maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.maxOutputTokens = null;
    
                        /**
                         * GenerationConfig temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.temperature = null;
    
                        /**
                         * GenerationConfig topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.topP = null;
    
                        /**
                         * GenerationConfig topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.topK = null;
    
                        /**
                         * GenerationConfig responseMimeType.
                         * @member {string} responseMimeType
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.responseMimeType = "";
    
                        /**
                         * GenerationConfig responseSchema.
                         * @member {google.ai.generativelanguage.v1beta.ISchema|null|undefined} responseSchema
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.responseSchema = null;
    
                        /**
                         * GenerationConfig presencePenalty.
                         * @member {number|null|undefined} presencePenalty
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.presencePenalty = null;
    
                        /**
                         * GenerationConfig frequencyPenalty.
                         * @member {number|null|undefined} frequencyPenalty
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.frequencyPenalty = null;
    
                        /**
                         * GenerationConfig responseLogprobs.
                         * @member {boolean|null|undefined} responseLogprobs
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.responseLogprobs = null;
    
                        /**
                         * GenerationConfig logprobs.
                         * @member {number|null|undefined} logprobs
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.logprobs = null;
    
                        /**
                         * GenerationConfig enableEnhancedCivicAnswers.
                         * @member {boolean|null|undefined} enableEnhancedCivicAnswers
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.enableEnhancedCivicAnswers = null;
    
                        /**
                         * GenerationConfig responseModalities.
                         * @member {Array.<google.ai.generativelanguage.v1beta.GenerationConfig.Modality>} responseModalities
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.responseModalities = $util.emptyArray;
    
                        /**
                         * GenerationConfig speechConfig.
                         * @member {google.ai.generativelanguage.v1beta.ISpeechConfig|null|undefined} speechConfig
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        GenerationConfig.prototype.speechConfig = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerationConfig _candidateCount.
                         * @member {"candidateCount"|undefined} _candidateCount
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_candidateCount", {
                            get: $util.oneOfGetter($oneOfFields = ["candidateCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _maxOutputTokens.
                         * @member {"maxOutputTokens"|undefined} _maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_maxOutputTokens", {
                            get: $util.oneOfGetter($oneOfFields = ["maxOutputTokens"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _presencePenalty.
                         * @member {"presencePenalty"|undefined} _presencePenalty
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_presencePenalty", {
                            get: $util.oneOfGetter($oneOfFields = ["presencePenalty"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _frequencyPenalty.
                         * @member {"frequencyPenalty"|undefined} _frequencyPenalty
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_frequencyPenalty", {
                            get: $util.oneOfGetter($oneOfFields = ["frequencyPenalty"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _responseLogprobs.
                         * @member {"responseLogprobs"|undefined} _responseLogprobs
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_responseLogprobs", {
                            get: $util.oneOfGetter($oneOfFields = ["responseLogprobs"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _logprobs.
                         * @member {"logprobs"|undefined} _logprobs
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_logprobs", {
                            get: $util.oneOfGetter($oneOfFields = ["logprobs"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _enableEnhancedCivicAnswers.
                         * @member {"enableEnhancedCivicAnswers"|undefined} _enableEnhancedCivicAnswers
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_enableEnhancedCivicAnswers", {
                            get: $util.oneOfGetter($oneOfFields = ["enableEnhancedCivicAnswers"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerationConfig _speechConfig.
                         * @member {"speechConfig"|undefined} _speechConfig
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         */
                        Object.defineProperty(GenerationConfig.prototype, "_speechConfig", {
                            get: $util.oneOfGetter($oneOfFields = ["speechConfig"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerationConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerationConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GenerationConfig} GenerationConfig instance
                         */
                        GenerationConfig.create = function create(properties) {
                            return new GenerationConfig(properties);
                        };
    
                        /**
                         * Encodes the specified GenerationConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerationConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerationConfig} message GenerationConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerationConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.candidateCount);
                            if (message.stopSequences != null && message.stopSequences.length)
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.stopSequences[i]);
                            if (message.maxOutputTokens != null && Object.hasOwnProperty.call(message, "maxOutputTokens"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxOutputTokens);
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 5, wireType 5 =*/45).float(message.temperature);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 6, wireType 5 =*/53).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.topK);
                            if (message.responseMimeType != null && Object.hasOwnProperty.call(message, "responseMimeType"))
                                writer.uint32(/* id 13, wireType 2 =*/106).string(message.responseMimeType);
                            if (message.responseSchema != null && Object.hasOwnProperty.call(message, "responseSchema"))
                                $root.google.ai.generativelanguage.v1beta.Schema.encode(message.responseSchema, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
                            if (message.presencePenalty != null && Object.hasOwnProperty.call(message, "presencePenalty"))
                                writer.uint32(/* id 15, wireType 5 =*/125).float(message.presencePenalty);
                            if (message.frequencyPenalty != null && Object.hasOwnProperty.call(message, "frequencyPenalty"))
                                writer.uint32(/* id 16, wireType 5 =*/133).float(message.frequencyPenalty);
                            if (message.responseLogprobs != null && Object.hasOwnProperty.call(message, "responseLogprobs"))
                                writer.uint32(/* id 17, wireType 0 =*/136).bool(message.responseLogprobs);
                            if (message.logprobs != null && Object.hasOwnProperty.call(message, "logprobs"))
                                writer.uint32(/* id 18, wireType 0 =*/144).int32(message.logprobs);
                            if (message.enableEnhancedCivicAnswers != null && Object.hasOwnProperty.call(message, "enableEnhancedCivicAnswers"))
                                writer.uint32(/* id 19, wireType 0 =*/152).bool(message.enableEnhancedCivicAnswers);
                            if (message.responseModalities != null && message.responseModalities.length) {
                                writer.uint32(/* id 20, wireType 2 =*/162).fork();
                                for (var i = 0; i < message.responseModalities.length; ++i)
                                    writer.int32(message.responseModalities[i]);
                                writer.ldelim();
                            }
                            if (message.speechConfig != null && Object.hasOwnProperty.call(message, "speechConfig"))
                                $root.google.ai.generativelanguage.v1beta.SpeechConfig.encode(message.speechConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerationConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerationConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerationConfig} message GenerationConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerationConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerationConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GenerationConfig} GenerationConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerationConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerationConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.candidateCount = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.stopSequences && message.stopSequences.length))
                                            message.stopSequences = [];
                                        message.stopSequences.push(reader.string());
                                        break;
                                    }
                                case 4: {
                                        message.maxOutputTokens = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 6: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 7: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                case 13: {
                                        message.responseMimeType = reader.string();
                                        break;
                                    }
                                case 14: {
                                        message.responseSchema = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 15: {
                                        message.presencePenalty = reader.float();
                                        break;
                                    }
                                case 16: {
                                        message.frequencyPenalty = reader.float();
                                        break;
                                    }
                                case 17: {
                                        message.responseLogprobs = reader.bool();
                                        break;
                                    }
                                case 18: {
                                        message.logprobs = reader.int32();
                                        break;
                                    }
                                case 19: {
                                        message.enableEnhancedCivicAnswers = reader.bool();
                                        break;
                                    }
                                case 20: {
                                        if (!(message.responseModalities && message.responseModalities.length))
                                            message.responseModalities = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.responseModalities.push(reader.int32());
                                        } else
                                            message.responseModalities.push(reader.int32());
                                        break;
                                    }
                                case 21: {
                                        message.speechConfig = $root.google.ai.generativelanguage.v1beta.SpeechConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerationConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GenerationConfig} GenerationConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerationConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerationConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerationConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                properties._candidateCount = 1;
                                if (!$util.isInteger(message.candidateCount))
                                    return "candidateCount: integer expected";
                            }
                            if (message.stopSequences != null && message.hasOwnProperty("stopSequences")) {
                                if (!Array.isArray(message.stopSequences))
                                    return "stopSequences: array expected";
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    if (!$util.isString(message.stopSequences[i]))
                                        return "stopSequences: string[] expected";
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                properties._maxOutputTokens = 1;
                                if (!$util.isInteger(message.maxOutputTokens))
                                    return "maxOutputTokens: integer expected";
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            if (message.responseMimeType != null && message.hasOwnProperty("responseMimeType"))
                                if (!$util.isString(message.responseMimeType))
                                    return "responseMimeType: string expected";
                            if (message.responseSchema != null && message.hasOwnProperty("responseSchema")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.responseSchema);
                                if (error)
                                    return "responseSchema." + error;
                            }
                            if (message.presencePenalty != null && message.hasOwnProperty("presencePenalty")) {
                                properties._presencePenalty = 1;
                                if (typeof message.presencePenalty !== "number")
                                    return "presencePenalty: number expected";
                            }
                            if (message.frequencyPenalty != null && message.hasOwnProperty("frequencyPenalty")) {
                                properties._frequencyPenalty = 1;
                                if (typeof message.frequencyPenalty !== "number")
                                    return "frequencyPenalty: number expected";
                            }
                            if (message.responseLogprobs != null && message.hasOwnProperty("responseLogprobs")) {
                                properties._responseLogprobs = 1;
                                if (typeof message.responseLogprobs !== "boolean")
                                    return "responseLogprobs: boolean expected";
                            }
                            if (message.logprobs != null && message.hasOwnProperty("logprobs")) {
                                properties._logprobs = 1;
                                if (!$util.isInteger(message.logprobs))
                                    return "logprobs: integer expected";
                            }
                            if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) {
                                properties._enableEnhancedCivicAnswers = 1;
                                if (typeof message.enableEnhancedCivicAnswers !== "boolean")
                                    return "enableEnhancedCivicAnswers: boolean expected";
                            }
                            if (message.responseModalities != null && message.hasOwnProperty("responseModalities")) {
                                if (!Array.isArray(message.responseModalities))
                                    return "responseModalities: array expected";
                                for (var i = 0; i < message.responseModalities.length; ++i)
                                    switch (message.responseModalities[i]) {
                                    default:
                                        return "responseModalities: enum value[] expected";
                                    case 0:
                                    case 1:
                                    case 2:
                                    case 3:
                                        break;
                                    }
                            }
                            if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) {
                                properties._speechConfig = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.SpeechConfig.verify(message.speechConfig);
                                    if (error)
                                        return "speechConfig." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerationConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GenerationConfig} GenerationConfig
                         */
                        GenerationConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerationConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GenerationConfig();
                            if (object.candidateCount != null)
                                message.candidateCount = object.candidateCount | 0;
                            if (object.stopSequences) {
                                if (!Array.isArray(object.stopSequences))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerationConfig.stopSequences: array expected");
                                message.stopSequences = [];
                                for (var i = 0; i < object.stopSequences.length; ++i)
                                    message.stopSequences[i] = String(object.stopSequences[i]);
                            }
                            if (object.maxOutputTokens != null)
                                message.maxOutputTokens = object.maxOutputTokens | 0;
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            if (object.responseMimeType != null)
                                message.responseMimeType = String(object.responseMimeType);
                            if (object.responseSchema != null) {
                                if (typeof object.responseSchema !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerationConfig.responseSchema: object expected");
                                message.responseSchema = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.responseSchema);
                            }
                            if (object.presencePenalty != null)
                                message.presencePenalty = Number(object.presencePenalty);
                            if (object.frequencyPenalty != null)
                                message.frequencyPenalty = Number(object.frequencyPenalty);
                            if (object.responseLogprobs != null)
                                message.responseLogprobs = Boolean(object.responseLogprobs);
                            if (object.logprobs != null)
                                message.logprobs = object.logprobs | 0;
                            if (object.enableEnhancedCivicAnswers != null)
                                message.enableEnhancedCivicAnswers = Boolean(object.enableEnhancedCivicAnswers);
                            if (object.responseModalities) {
                                if (!Array.isArray(object.responseModalities))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerationConfig.responseModalities: array expected");
                                message.responseModalities = [];
                                for (var i = 0; i < object.responseModalities.length; ++i)
                                    switch (object.responseModalities[i]) {
                                    default:
                                        if (typeof object.responseModalities[i] === "number") {
                                            message.responseModalities[i] = object.responseModalities[i];
                                            break;
                                        }
                                    case "MODALITY_UNSPECIFIED":
                                    case 0:
                                        message.responseModalities[i] = 0;
                                        break;
                                    case "TEXT":
                                    case 1:
                                        message.responseModalities[i] = 1;
                                        break;
                                    case "IMAGE":
                                    case 2:
                                        message.responseModalities[i] = 2;
                                        break;
                                    case "AUDIO":
                                    case 3:
                                        message.responseModalities[i] = 3;
                                        break;
                                    }
                            }
                            if (object.speechConfig != null) {
                                if (typeof object.speechConfig !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerationConfig.speechConfig: object expected");
                                message.speechConfig = $root.google.ai.generativelanguage.v1beta.SpeechConfig.fromObject(object.speechConfig);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerationConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GenerationConfig} message GenerationConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerationConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.stopSequences = [];
                                object.responseModalities = [];
                            }
                            if (options.defaults) {
                                object.responseMimeType = "";
                                object.responseSchema = null;
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                object.candidateCount = message.candidateCount;
                                if (options.oneofs)
                                    object._candidateCount = "candidateCount";
                            }
                            if (message.stopSequences && message.stopSequences.length) {
                                object.stopSequences = [];
                                for (var j = 0; j < message.stopSequences.length; ++j)
                                    object.stopSequences[j] = message.stopSequences[j];
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                object.maxOutputTokens = message.maxOutputTokens;
                                if (options.oneofs)
                                    object._maxOutputTokens = "maxOutputTokens";
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.responseMimeType != null && message.hasOwnProperty("responseMimeType"))
                                object.responseMimeType = message.responseMimeType;
                            if (message.responseSchema != null && message.hasOwnProperty("responseSchema"))
                                object.responseSchema = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.responseSchema, options);
                            if (message.presencePenalty != null && message.hasOwnProperty("presencePenalty")) {
                                object.presencePenalty = options.json && !isFinite(message.presencePenalty) ? String(message.presencePenalty) : message.presencePenalty;
                                if (options.oneofs)
                                    object._presencePenalty = "presencePenalty";
                            }
                            if (message.frequencyPenalty != null && message.hasOwnProperty("frequencyPenalty")) {
                                object.frequencyPenalty = options.json && !isFinite(message.frequencyPenalty) ? String(message.frequencyPenalty) : message.frequencyPenalty;
                                if (options.oneofs)
                                    object._frequencyPenalty = "frequencyPenalty";
                            }
                            if (message.responseLogprobs != null && message.hasOwnProperty("responseLogprobs")) {
                                object.responseLogprobs = message.responseLogprobs;
                                if (options.oneofs)
                                    object._responseLogprobs = "responseLogprobs";
                            }
                            if (message.logprobs != null && message.hasOwnProperty("logprobs")) {
                                object.logprobs = message.logprobs;
                                if (options.oneofs)
                                    object._logprobs = "logprobs";
                            }
                            if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) {
                                object.enableEnhancedCivicAnswers = message.enableEnhancedCivicAnswers;
                                if (options.oneofs)
                                    object._enableEnhancedCivicAnswers = "enableEnhancedCivicAnswers";
                            }
                            if (message.responseModalities && message.responseModalities.length) {
                                object.responseModalities = [];
                                for (var j = 0; j < message.responseModalities.length; ++j)
                                    object.responseModalities[j] = options.enums === String ? $root.google.ai.generativelanguage.v1beta.GenerationConfig.Modality[message.responseModalities[j]] === undefined ? message.responseModalities[j] : $root.google.ai.generativelanguage.v1beta.GenerationConfig.Modality[message.responseModalities[j]] : message.responseModalities[j];
                            }
                            if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) {
                                object.speechConfig = $root.google.ai.generativelanguage.v1beta.SpeechConfig.toObject(message.speechConfig, options);
                                if (options.oneofs)
                                    object._speechConfig = "speechConfig";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerationConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerationConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerationConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GenerationConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerationConfig";
                        };
    
                        /**
                         * Modality enum.
                         * @name google.ai.generativelanguage.v1beta.GenerationConfig.Modality
                         * @enum {number}
                         * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value
                         * @property {number} TEXT=1 TEXT value
                         * @property {number} IMAGE=2 IMAGE value
                         * @property {number} AUDIO=3 AUDIO value
                         */
                        GenerationConfig.Modality = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "TEXT"] = 1;
                            values[valuesById[2] = "IMAGE"] = 2;
                            values[valuesById[3] = "AUDIO"] = 3;
                            return values;
                        })();
    
                        return GenerationConfig;
                    })();
    
                    v1beta.SemanticRetrieverConfig = (function() {
    
                        /**
                         * Properties of a SemanticRetrieverConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ISemanticRetrieverConfig
                         * @property {string|null} [source] SemanticRetrieverConfig source
                         * @property {google.ai.generativelanguage.v1beta.IContent|null} [query] SemanticRetrieverConfig query
                         * @property {Array.<google.ai.generativelanguage.v1beta.IMetadataFilter>|null} [metadataFilters] SemanticRetrieverConfig metadataFilters
                         * @property {number|null} [maxChunksCount] SemanticRetrieverConfig maxChunksCount
                         * @property {number|null} [minimumRelevanceScore] SemanticRetrieverConfig minimumRelevanceScore
                         */
    
                        /**
                         * Constructs a new SemanticRetrieverConfig.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a SemanticRetrieverConfig.
                         * @implements ISemanticRetrieverConfig
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ISemanticRetrieverConfig=} [properties] Properties to set
                         */
                        function SemanticRetrieverConfig(properties) {
                            this.metadataFilters = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SemanticRetrieverConfig source.
                         * @member {string} source
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @instance
                         */
                        SemanticRetrieverConfig.prototype.source = "";
    
                        /**
                         * SemanticRetrieverConfig query.
                         * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} query
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @instance
                         */
                        SemanticRetrieverConfig.prototype.query = null;
    
                        /**
                         * SemanticRetrieverConfig metadataFilters.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IMetadataFilter>} metadataFilters
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @instance
                         */
                        SemanticRetrieverConfig.prototype.metadataFilters = $util.emptyArray;
    
                        /**
                         * SemanticRetrieverConfig maxChunksCount.
                         * @member {number|null|undefined} maxChunksCount
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @instance
                         */
                        SemanticRetrieverConfig.prototype.maxChunksCount = null;
    
                        /**
                         * SemanticRetrieverConfig minimumRelevanceScore.
                         * @member {number|null|undefined} minimumRelevanceScore
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @instance
                         */
                        SemanticRetrieverConfig.prototype.minimumRelevanceScore = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * SemanticRetrieverConfig _maxChunksCount.
                         * @member {"maxChunksCount"|undefined} _maxChunksCount
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @instance
                         */
                        Object.defineProperty(SemanticRetrieverConfig.prototype, "_maxChunksCount", {
                            get: $util.oneOfGetter($oneOfFields = ["maxChunksCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * SemanticRetrieverConfig _minimumRelevanceScore.
                         * @member {"minimumRelevanceScore"|undefined} _minimumRelevanceScore
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @instance
                         */
                        Object.defineProperty(SemanticRetrieverConfig.prototype, "_minimumRelevanceScore", {
                            get: $util.oneOfGetter($oneOfFields = ["minimumRelevanceScore"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new SemanticRetrieverConfig instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISemanticRetrieverConfig=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.SemanticRetrieverConfig} SemanticRetrieverConfig instance
                         */
                        SemanticRetrieverConfig.create = function create(properties) {
                            return new SemanticRetrieverConfig(properties);
                        };
    
                        /**
                         * Encodes the specified SemanticRetrieverConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISemanticRetrieverConfig} message SemanticRetrieverConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SemanticRetrieverConfig.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.source != null && Object.hasOwnProperty.call(message, "source"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.source);
                            if (message.query != null && Object.hasOwnProperty.call(message, "query"))
                                $root.google.ai.generativelanguage.v1beta.Content.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.metadataFilters != null && message.metadataFilters.length)
                                for (var i = 0; i < message.metadataFilters.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.MetadataFilter.encode(message.metadataFilters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.maxChunksCount != null && Object.hasOwnProperty.call(message, "maxChunksCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxChunksCount);
                            if (message.minimumRelevanceScore != null && Object.hasOwnProperty.call(message, "minimumRelevanceScore"))
                                writer.uint32(/* id 5, wireType 5 =*/45).float(message.minimumRelevanceScore);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SemanticRetrieverConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISemanticRetrieverConfig} message SemanticRetrieverConfig message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SemanticRetrieverConfig.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SemanticRetrieverConfig message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.SemanticRetrieverConfig} SemanticRetrieverConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SemanticRetrieverConfig.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SemanticRetrieverConfig();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.source = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.query = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.metadataFilters && message.metadataFilters.length))
                                            message.metadataFilters = [];
                                        message.metadataFilters.push($root.google.ai.generativelanguage.v1beta.MetadataFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.maxChunksCount = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.minimumRelevanceScore = reader.float();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SemanticRetrieverConfig message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.SemanticRetrieverConfig} SemanticRetrieverConfig
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SemanticRetrieverConfig.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SemanticRetrieverConfig message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SemanticRetrieverConfig.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.source != null && message.hasOwnProperty("source"))
                                if (!$util.isString(message.source))
                                    return "source: string expected";
                            if (message.query != null && message.hasOwnProperty("query")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.query);
                                if (error)
                                    return "query." + error;
                            }
                            if (message.metadataFilters != null && message.hasOwnProperty("metadataFilters")) {
                                if (!Array.isArray(message.metadataFilters))
                                    return "metadataFilters: array expected";
                                for (var i = 0; i < message.metadataFilters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.MetadataFilter.verify(message.metadataFilters[i]);
                                    if (error)
                                        return "metadataFilters." + error;
                                }
                            }
                            if (message.maxChunksCount != null && message.hasOwnProperty("maxChunksCount")) {
                                properties._maxChunksCount = 1;
                                if (!$util.isInteger(message.maxChunksCount))
                                    return "maxChunksCount: integer expected";
                            }
                            if (message.minimumRelevanceScore != null && message.hasOwnProperty("minimumRelevanceScore")) {
                                properties._minimumRelevanceScore = 1;
                                if (typeof message.minimumRelevanceScore !== "number")
                                    return "minimumRelevanceScore: number expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a SemanticRetrieverConfig message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.SemanticRetrieverConfig} SemanticRetrieverConfig
                         */
                        SemanticRetrieverConfig.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.SemanticRetrieverConfig)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.SemanticRetrieverConfig();
                            if (object.source != null)
                                message.source = String(object.source);
                            if (object.query != null) {
                                if (typeof object.query !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.query: object expected");
                                message.query = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.query);
                            }
                            if (object.metadataFilters) {
                                if (!Array.isArray(object.metadataFilters))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.metadataFilters: array expected");
                                message.metadataFilters = [];
                                for (var i = 0; i < object.metadataFilters.length; ++i) {
                                    if (typeof object.metadataFilters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.metadataFilters: object expected");
                                    message.metadataFilters[i] = $root.google.ai.generativelanguage.v1beta.MetadataFilter.fromObject(object.metadataFilters[i]);
                                }
                            }
                            if (object.maxChunksCount != null)
                                message.maxChunksCount = object.maxChunksCount | 0;
                            if (object.minimumRelevanceScore != null)
                                message.minimumRelevanceScore = Number(object.minimumRelevanceScore);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SemanticRetrieverConfig message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.SemanticRetrieverConfig} message SemanticRetrieverConfig
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SemanticRetrieverConfig.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.metadataFilters = [];
                            if (options.defaults) {
                                object.source = "";
                                object.query = null;
                            }
                            if (message.source != null && message.hasOwnProperty("source"))
                                object.source = message.source;
                            if (message.query != null && message.hasOwnProperty("query"))
                                object.query = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.query, options);
                            if (message.metadataFilters && message.metadataFilters.length) {
                                object.metadataFilters = [];
                                for (var j = 0; j < message.metadataFilters.length; ++j)
                                    object.metadataFilters[j] = $root.google.ai.generativelanguage.v1beta.MetadataFilter.toObject(message.metadataFilters[j], options);
                            }
                            if (message.maxChunksCount != null && message.hasOwnProperty("maxChunksCount")) {
                                object.maxChunksCount = message.maxChunksCount;
                                if (options.oneofs)
                                    object._maxChunksCount = "maxChunksCount";
                            }
                            if (message.minimumRelevanceScore != null && message.hasOwnProperty("minimumRelevanceScore")) {
                                object.minimumRelevanceScore = options.json && !isFinite(message.minimumRelevanceScore) ? String(message.minimumRelevanceScore) : message.minimumRelevanceScore;
                                if (options.oneofs)
                                    object._minimumRelevanceScore = "minimumRelevanceScore";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this SemanticRetrieverConfig to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SemanticRetrieverConfig.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SemanticRetrieverConfig
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SemanticRetrieverConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SemanticRetrieverConfig";
                        };
    
                        return SemanticRetrieverConfig;
                    })();
    
                    v1beta.GenerateContentResponse = (function() {
    
                        /**
                         * Properties of a GenerateContentResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGenerateContentResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.ICandidate>|null} [candidates] GenerateContentResponse candidates
                         * @property {google.ai.generativelanguage.v1beta.GenerateContentResponse.IPromptFeedback|null} [promptFeedback] GenerateContentResponse promptFeedback
                         * @property {google.ai.generativelanguage.v1beta.GenerateContentResponse.IUsageMetadata|null} [usageMetadata] GenerateContentResponse usageMetadata
                         * @property {string|null} [modelVersion] GenerateContentResponse modelVersion
                         */
    
                        /**
                         * Constructs a new GenerateContentResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GenerateContentResponse.
                         * @implements IGenerateContentResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentResponse=} [properties] Properties to set
                         */
                        function GenerateContentResponse(properties) {
                            this.candidates = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateContentResponse candidates.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ICandidate>} candidates
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.candidates = $util.emptyArray;
    
                        /**
                         * GenerateContentResponse promptFeedback.
                         * @member {google.ai.generativelanguage.v1beta.GenerateContentResponse.IPromptFeedback|null|undefined} promptFeedback
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.promptFeedback = null;
    
                        /**
                         * GenerateContentResponse usageMetadata.
                         * @member {google.ai.generativelanguage.v1beta.GenerateContentResponse.IUsageMetadata|null|undefined} usageMetadata
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.usageMetadata = null;
    
                        /**
                         * GenerateContentResponse modelVersion.
                         * @member {string} modelVersion
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @instance
                         */
                        GenerateContentResponse.prototype.modelVersion = "";
    
                        /**
                         * Creates a new GenerateContentResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse} GenerateContentResponse instance
                         */
                        GenerateContentResponse.create = function create(properties) {
                            return new GenerateContentResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateContentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentResponse} message GenerateContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidates != null && message.candidates.length)
                                for (var i = 0; i < message.candidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Candidate.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.promptFeedback != null && Object.hasOwnProperty.call(message, "promptFeedback"))
                                $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.encode(message.promptFeedback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.usageMetadata != null && Object.hasOwnProperty.call(message, "usageMetadata"))
                                $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelVersion);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateContentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateContentResponse} message GenerateContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateContentResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateContentResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse} GenerateContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateContentResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.candidates && message.candidates.length))
                                            message.candidates = [];
                                        message.candidates.push($root.google.ai.generativelanguage.v1beta.Candidate.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.promptFeedback = $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.usageMetadata = $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.modelVersion = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateContentResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse} GenerateContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateContentResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateContentResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateContentResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                if (!Array.isArray(message.candidates))
                                    return "candidates: array expected";
                                for (var i = 0; i < message.candidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Candidate.verify(message.candidates[i]);
                                    if (error)
                                        return "candidates." + error;
                                }
                            }
                            if (message.promptFeedback != null && message.hasOwnProperty("promptFeedback")) {
                                var error = $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.verify(message.promptFeedback);
                                if (error)
                                    return "promptFeedback." + error;
                            }
                            if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata.verify(message.usageMetadata);
                                if (error)
                                    return "usageMetadata." + error;
                            }
                            if (message.modelVersion != null && message.hasOwnProperty("modelVersion"))
                                if (!$util.isString(message.modelVersion))
                                    return "modelVersion: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GenerateContentResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse} GenerateContentResponse
                         */
                        GenerateContentResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateContentResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GenerateContentResponse();
                            if (object.candidates) {
                                if (!Array.isArray(object.candidates))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentResponse.candidates: array expected");
                                message.candidates = [];
                                for (var i = 0; i < object.candidates.length; ++i) {
                                    if (typeof object.candidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentResponse.candidates: object expected");
                                    message.candidates[i] = $root.google.ai.generativelanguage.v1beta.Candidate.fromObject(object.candidates[i]);
                                }
                            }
                            if (object.promptFeedback != null) {
                                if (typeof object.promptFeedback !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentResponse.promptFeedback: object expected");
                                message.promptFeedback = $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.fromObject(object.promptFeedback);
                            }
                            if (object.usageMetadata != null) {
                                if (typeof object.usageMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentResponse.usageMetadata: object expected");
                                message.usageMetadata = $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata.fromObject(object.usageMetadata);
                            }
                            if (object.modelVersion != null)
                                message.modelVersion = String(object.modelVersion);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateContentResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse} message GenerateContentResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateContentResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.candidates = [];
                            if (options.defaults) {
                                object.promptFeedback = null;
                                object.usageMetadata = null;
                                object.modelVersion = "";
                            }
                            if (message.candidates && message.candidates.length) {
                                object.candidates = [];
                                for (var j = 0; j < message.candidates.length; ++j)
                                    object.candidates[j] = $root.google.ai.generativelanguage.v1beta.Candidate.toObject(message.candidates[j], options);
                            }
                            if (message.promptFeedback != null && message.hasOwnProperty("promptFeedback"))
                                object.promptFeedback = $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.toObject(message.promptFeedback, options);
                            if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata"))
                                object.usageMetadata = $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata.toObject(message.usageMetadata, options);
                            if (message.modelVersion != null && message.hasOwnProperty("modelVersion"))
                                object.modelVersion = message.modelVersion;
                            return object;
                        };
    
                        /**
                         * Converts this GenerateContentResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateContentResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateContentResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateContentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateContentResponse";
                        };
    
                        GenerateContentResponse.PromptFeedback = (function() {
    
                            /**
                             * Properties of a PromptFeedback.
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                             * @interface IPromptFeedback
                             * @property {google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.BlockReason|null} [blockReason] PromptFeedback blockReason
                             * @property {Array.<google.ai.generativelanguage.v1beta.ISafetyRating>|null} [safetyRatings] PromptFeedback safetyRatings
                             */
    
                            /**
                             * Constructs a new PromptFeedback.
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                             * @classdesc Represents a PromptFeedback.
                             * @implements IPromptFeedback
                             * @constructor
                             * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse.IPromptFeedback=} [properties] Properties to set
                             */
                            function PromptFeedback(properties) {
                                this.safetyRatings = [];
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * PromptFeedback blockReason.
                             * @member {google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.BlockReason} blockReason
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @instance
                             */
                            PromptFeedback.prototype.blockReason = 0;
    
                            /**
                             * PromptFeedback safetyRatings.
                             * @member {Array.<google.ai.generativelanguage.v1beta.ISafetyRating>} safetyRatings
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @instance
                             */
                            PromptFeedback.prototype.safetyRatings = $util.emptyArray;
    
                            /**
                             * Creates a new PromptFeedback instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse.IPromptFeedback=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback} PromptFeedback instance
                             */
                            PromptFeedback.create = function create(properties) {
                                return new PromptFeedback(properties);
                            };
    
                            /**
                             * Encodes the specified PromptFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse.IPromptFeedback} message PromptFeedback message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            PromptFeedback.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.blockReason != null && Object.hasOwnProperty.call(message, "blockReason"))
                                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.blockReason);
                                if (message.safetyRatings != null && message.safetyRatings.length)
                                    for (var i = 0; i < message.safetyRatings.length; ++i)
                                        $root.google.ai.generativelanguage.v1beta.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                                return writer;
                            };
    
                            /**
                             * Encodes the specified PromptFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse.IPromptFeedback} message PromptFeedback message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            PromptFeedback.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a PromptFeedback message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback} PromptFeedback
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            PromptFeedback.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.blockReason = reader.int32();
                                            break;
                                        }
                                    case 2: {
                                            if (!(message.safetyRatings && message.safetyRatings.length))
                                                message.safetyRatings = [];
                                            message.safetyRatings.push($root.google.ai.generativelanguage.v1beta.SafetyRating.decode(reader, reader.uint32()));
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a PromptFeedback message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback} PromptFeedback
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            PromptFeedback.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a PromptFeedback message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            PromptFeedback.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.blockReason != null && message.hasOwnProperty("blockReason"))
                                    switch (message.blockReason) {
                                    default:
                                        return "blockReason: enum value expected";
                                    case 0:
                                    case 1:
                                    case 2:
                                    case 3:
                                    case 4:
                                    case 5:
                                        break;
                                    }
                                if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                    if (!Array.isArray(message.safetyRatings))
                                        return "safetyRatings: array expected";
                                    for (var i = 0; i < message.safetyRatings.length; ++i) {
                                        var error = $root.google.ai.generativelanguage.v1beta.SafetyRating.verify(message.safetyRatings[i]);
                                        if (error)
                                            return "safetyRatings." + error;
                                    }
                                }
                                return null;
                            };
    
                            /**
                             * Creates a PromptFeedback message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback} PromptFeedback
                             */
                            PromptFeedback.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback();
                                switch (object.blockReason) {
                                default:
                                    if (typeof object.blockReason === "number") {
                                        message.blockReason = object.blockReason;
                                        break;
                                    }
                                    break;
                                case "BLOCK_REASON_UNSPECIFIED":
                                case 0:
                                    message.blockReason = 0;
                                    break;
                                case "SAFETY":
                                case 1:
                                    message.blockReason = 1;
                                    break;
                                case "OTHER":
                                case 2:
                                    message.blockReason = 2;
                                    break;
                                case "BLOCKLIST":
                                case 3:
                                    message.blockReason = 3;
                                    break;
                                case "PROHIBITED_CONTENT":
                                case 4:
                                    message.blockReason = 4;
                                    break;
                                case "IMAGE_SAFETY":
                                case 5:
                                    message.blockReason = 5;
                                    break;
                                }
                                if (object.safetyRatings) {
                                    if (!Array.isArray(object.safetyRatings))
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.safetyRatings: array expected");
                                    message.safetyRatings = [];
                                    for (var i = 0; i < object.safetyRatings.length; ++i) {
                                        if (typeof object.safetyRatings[i] !== "object")
                                            throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.safetyRatings: object expected");
                                        message.safetyRatings[i] = $root.google.ai.generativelanguage.v1beta.SafetyRating.fromObject(object.safetyRatings[i]);
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a PromptFeedback message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback} message PromptFeedback
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            PromptFeedback.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.arrays || options.defaults)
                                    object.safetyRatings = [];
                                if (options.defaults)
                                    object.blockReason = options.enums === String ? "BLOCK_REASON_UNSPECIFIED" : 0;
                                if (message.blockReason != null && message.hasOwnProperty("blockReason"))
                                    object.blockReason = options.enums === String ? $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.BlockReason[message.blockReason] === undefined ? message.blockReason : $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.BlockReason[message.blockReason] : message.blockReason;
                                if (message.safetyRatings && message.safetyRatings.length) {
                                    object.safetyRatings = [];
                                    for (var j = 0; j < message.safetyRatings.length; ++j)
                                        object.safetyRatings[j] = $root.google.ai.generativelanguage.v1beta.SafetyRating.toObject(message.safetyRatings[j], options);
                                }
                                return object;
                            };
    
                            /**
                             * Converts this PromptFeedback to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            PromptFeedback.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for PromptFeedback
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            PromptFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback";
                            };
    
                            /**
                             * BlockReason enum.
                             * @name google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.BlockReason
                             * @enum {number}
                             * @property {number} BLOCK_REASON_UNSPECIFIED=0 BLOCK_REASON_UNSPECIFIED value
                             * @property {number} SAFETY=1 SAFETY value
                             * @property {number} OTHER=2 OTHER value
                             * @property {number} BLOCKLIST=3 BLOCKLIST value
                             * @property {number} PROHIBITED_CONTENT=4 PROHIBITED_CONTENT value
                             * @property {number} IMAGE_SAFETY=5 IMAGE_SAFETY value
                             */
                            PromptFeedback.BlockReason = (function() {
                                var valuesById = {}, values = Object.create(valuesById);
                                values[valuesById[0] = "BLOCK_REASON_UNSPECIFIED"] = 0;
                                values[valuesById[1] = "SAFETY"] = 1;
                                values[valuesById[2] = "OTHER"] = 2;
                                values[valuesById[3] = "BLOCKLIST"] = 3;
                                values[valuesById[4] = "PROHIBITED_CONTENT"] = 4;
                                values[valuesById[5] = "IMAGE_SAFETY"] = 5;
                                return values;
                            })();
    
                            return PromptFeedback;
                        })();
    
                        GenerateContentResponse.UsageMetadata = (function() {
    
                            /**
                             * Properties of a UsageMetadata.
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                             * @interface IUsageMetadata
                             * @property {number|null} [promptTokenCount] UsageMetadata promptTokenCount
                             * @property {number|null} [cachedContentTokenCount] UsageMetadata cachedContentTokenCount
                             * @property {number|null} [candidatesTokenCount] UsageMetadata candidatesTokenCount
                             * @property {number|null} [totalTokenCount] UsageMetadata totalTokenCount
                             */
    
                            /**
                             * Constructs a new UsageMetadata.
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse
                             * @classdesc Represents a UsageMetadata.
                             * @implements IUsageMetadata
                             * @constructor
                             * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse.IUsageMetadata=} [properties] Properties to set
                             */
                            function UsageMetadata(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * UsageMetadata promptTokenCount.
                             * @member {number} promptTokenCount
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.promptTokenCount = 0;
    
                            /**
                             * UsageMetadata cachedContentTokenCount.
                             * @member {number} cachedContentTokenCount
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.cachedContentTokenCount = 0;
    
                            /**
                             * UsageMetadata candidatesTokenCount.
                             * @member {number} candidatesTokenCount
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.candidatesTokenCount = 0;
    
                            /**
                             * UsageMetadata totalTokenCount.
                             * @member {number} totalTokenCount
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @instance
                             */
                            UsageMetadata.prototype.totalTokenCount = 0;
    
                            /**
                             * Creates a new UsageMetadata instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse.IUsageMetadata=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata} UsageMetadata instance
                             */
                            UsageMetadata.create = function create(properties) {
                                return new UsageMetadata(properties);
                            };
    
                            /**
                             * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse.IUsageMetadata} message UsageMetadata message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            UsageMetadata.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.promptTokenCount != null && Object.hasOwnProperty.call(message, "promptTokenCount"))
                                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.promptTokenCount);
                                if (message.candidatesTokenCount != null && Object.hasOwnProperty.call(message, "candidatesTokenCount"))
                                    writer.uint32(/* id 2, wireType 0 =*/16).int32(message.candidatesTokenCount);
                                if (message.totalTokenCount != null && Object.hasOwnProperty.call(message, "totalTokenCount"))
                                    writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalTokenCount);
                                if (message.cachedContentTokenCount != null && Object.hasOwnProperty.call(message, "cachedContentTokenCount"))
                                    writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cachedContentTokenCount);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse.IUsageMetadata} message UsageMetadata message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            UsageMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a UsageMetadata message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata} UsageMetadata
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            UsageMetadata.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.promptTokenCount = reader.int32();
                                            break;
                                        }
                                    case 4: {
                                            message.cachedContentTokenCount = reader.int32();
                                            break;
                                        }
                                    case 2: {
                                            message.candidatesTokenCount = reader.int32();
                                            break;
                                        }
                                    case 3: {
                                            message.totalTokenCount = reader.int32();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a UsageMetadata message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata} UsageMetadata
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            UsageMetadata.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a UsageMetadata message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            UsageMetadata.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.promptTokenCount != null && message.hasOwnProperty("promptTokenCount"))
                                    if (!$util.isInteger(message.promptTokenCount))
                                        return "promptTokenCount: integer expected";
                                if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount"))
                                    if (!$util.isInteger(message.cachedContentTokenCount))
                                        return "cachedContentTokenCount: integer expected";
                                if (message.candidatesTokenCount != null && message.hasOwnProperty("candidatesTokenCount"))
                                    if (!$util.isInteger(message.candidatesTokenCount))
                                        return "candidatesTokenCount: integer expected";
                                if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount"))
                                    if (!$util.isInteger(message.totalTokenCount))
                                        return "totalTokenCount: integer expected";
                                return null;
                            };
    
                            /**
                             * Creates a UsageMetadata message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata} UsageMetadata
                             */
                            UsageMetadata.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata();
                                if (object.promptTokenCount != null)
                                    message.promptTokenCount = object.promptTokenCount | 0;
                                if (object.cachedContentTokenCount != null)
                                    message.cachedContentTokenCount = object.cachedContentTokenCount | 0;
                                if (object.candidatesTokenCount != null)
                                    message.candidatesTokenCount = object.candidatesTokenCount | 0;
                                if (object.totalTokenCount != null)
                                    message.totalTokenCount = object.totalTokenCount | 0;
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a UsageMetadata message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata} message UsageMetadata
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            UsageMetadata.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.defaults) {
                                    object.promptTokenCount = 0;
                                    object.candidatesTokenCount = 0;
                                    object.totalTokenCount = 0;
                                    object.cachedContentTokenCount = 0;
                                }
                                if (message.promptTokenCount != null && message.hasOwnProperty("promptTokenCount"))
                                    object.promptTokenCount = message.promptTokenCount;
                                if (message.candidatesTokenCount != null && message.hasOwnProperty("candidatesTokenCount"))
                                    object.candidatesTokenCount = message.candidatesTokenCount;
                                if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount"))
                                    object.totalTokenCount = message.totalTokenCount;
                                if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount"))
                                    object.cachedContentTokenCount = message.cachedContentTokenCount;
                                return object;
                            };
    
                            /**
                             * Converts this UsageMetadata to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            UsageMetadata.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for UsageMetadata
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            UsageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata";
                            };
    
                            return UsageMetadata;
                        })();
    
                        return GenerateContentResponse;
                    })();
    
                    v1beta.Candidate = (function() {
    
                        /**
                         * Properties of a Candidate.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICandidate
                         * @property {number|null} [index] Candidate index
                         * @property {google.ai.generativelanguage.v1beta.IContent|null} [content] Candidate content
                         * @property {google.ai.generativelanguage.v1beta.Candidate.FinishReason|null} [finishReason] Candidate finishReason
                         * @property {Array.<google.ai.generativelanguage.v1beta.ISafetyRating>|null} [safetyRatings] Candidate safetyRatings
                         * @property {google.ai.generativelanguage.v1beta.ICitationMetadata|null} [citationMetadata] Candidate citationMetadata
                         * @property {number|null} [tokenCount] Candidate tokenCount
                         * @property {Array.<google.ai.generativelanguage.v1beta.IGroundingAttribution>|null} [groundingAttributions] Candidate groundingAttributions
                         * @property {google.ai.generativelanguage.v1beta.IGroundingMetadata|null} [groundingMetadata] Candidate groundingMetadata
                         * @property {number|null} [avgLogprobs] Candidate avgLogprobs
                         * @property {google.ai.generativelanguage.v1beta.ILogprobsResult|null} [logprobsResult] Candidate logprobsResult
                         */
    
                        /**
                         * Constructs a new Candidate.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Candidate.
                         * @implements ICandidate
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICandidate=} [properties] Properties to set
                         */
                        function Candidate(properties) {
                            this.safetyRatings = [];
                            this.groundingAttributions = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Candidate index.
                         * @member {number|null|undefined} index
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         */
                        Candidate.prototype.index = null;
    
                        /**
                         * Candidate content.
                         * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} content
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         */
                        Candidate.prototype.content = null;
    
                        /**
                         * Candidate finishReason.
                         * @member {google.ai.generativelanguage.v1beta.Candidate.FinishReason} finishReason
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         */
                        Candidate.prototype.finishReason = 0;
    
                        /**
                         * Candidate safetyRatings.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ISafetyRating>} safetyRatings
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         */
                        Candidate.prototype.safetyRatings = $util.emptyArray;
    
                        /**
                         * Candidate citationMetadata.
                         * @member {google.ai.generativelanguage.v1beta.ICitationMetadata|null|undefined} citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         */
                        Candidate.prototype.citationMetadata = null;
    
                        /**
                         * Candidate tokenCount.
                         * @member {number} tokenCount
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         */
                        Candidate.prototype.tokenCount = 0;
    
                        /**
                         * Candidate groundingAttributions.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IGroundingAttribution>} groundingAttributions
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         */
                        Candidate.prototype.groundingAttributions = $util.emptyArray;
    
                        /**
                         * Candidate groundingMetadata.
                         * @member {google.ai.generativelanguage.v1beta.IGroundingMetadata|null|undefined} groundingMetadata
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         */
                        Candidate.prototype.groundingMetadata = null;
    
                        /**
                         * Candidate avgLogprobs.
                         * @member {number} avgLogprobs
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         */
                        Candidate.prototype.avgLogprobs = 0;
    
                        /**
                         * Candidate logprobsResult.
                         * @member {google.ai.generativelanguage.v1beta.ILogprobsResult|null|undefined} logprobsResult
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         */
                        Candidate.prototype.logprobsResult = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Candidate _index.
                         * @member {"index"|undefined} _index
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         */
                        Object.defineProperty(Candidate.prototype, "_index", {
                            get: $util.oneOfGetter($oneOfFields = ["index"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Candidate instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICandidate=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Candidate} Candidate instance
                         */
                        Candidate.create = function create(properties) {
                            return new Candidate(properties);
                        };
    
                        /**
                         * Encodes the specified Candidate message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Candidate.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICandidate} message Candidate message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Candidate.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                $root.google.ai.generativelanguage.v1beta.Content.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.finishReason != null && Object.hasOwnProperty.call(message, "finishReason"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.finishReason);
                            if (message.index != null && Object.hasOwnProperty.call(message, "index"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.index);
                            if (message.safetyRatings != null && message.safetyRatings.length)
                                for (var i = 0; i < message.safetyRatings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata"))
                                $root.google.ai.generativelanguage.v1beta.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.tokenCount);
                            if (message.groundingAttributions != null && message.groundingAttributions.length)
                                for (var i = 0; i < message.groundingAttributions.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.GroundingAttribution.encode(message.groundingAttributions[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.groundingMetadata != null && Object.hasOwnProperty.call(message, "groundingMetadata"))
                                $root.google.ai.generativelanguage.v1beta.GroundingMetadata.encode(message.groundingMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                            if (message.avgLogprobs != null && Object.hasOwnProperty.call(message, "avgLogprobs"))
                                writer.uint32(/* id 10, wireType 1 =*/81).double(message.avgLogprobs);
                            if (message.logprobsResult != null && Object.hasOwnProperty.call(message, "logprobsResult"))
                                $root.google.ai.generativelanguage.v1beta.LogprobsResult.encode(message.logprobsResult, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Candidate.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICandidate} message Candidate message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Candidate.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Candidate message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Candidate} Candidate
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Candidate.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Candidate();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.index = reader.int32();
                                        break;
                                    }
                                case 1: {
                                        message.content = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.finishReason = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        if (!(message.safetyRatings && message.safetyRatings.length))
                                            message.safetyRatings = [];
                                        message.safetyRatings.push($root.google.ai.generativelanguage.v1beta.SafetyRating.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 6: {
                                        message.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 7: {
                                        message.tokenCount = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        if (!(message.groundingAttributions && message.groundingAttributions.length))
                                            message.groundingAttributions = [];
                                        message.groundingAttributions.push($root.google.ai.generativelanguage.v1beta.GroundingAttribution.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 9: {
                                        message.groundingMetadata = $root.google.ai.generativelanguage.v1beta.GroundingMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 10: {
                                        message.avgLogprobs = reader.double();
                                        break;
                                    }
                                case 11: {
                                        message.logprobsResult = $root.google.ai.generativelanguage.v1beta.LogprobsResult.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Candidate message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Candidate} Candidate
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Candidate.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Candidate message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Candidate.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.index != null && message.hasOwnProperty("index")) {
                                properties._index = 1;
                                if (!$util.isInteger(message.index))
                                    return "index: integer expected";
                            }
                            if (message.content != null && message.hasOwnProperty("content")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.content);
                                if (error)
                                    return "content." + error;
                            }
                            if (message.finishReason != null && message.hasOwnProperty("finishReason"))
                                switch (message.finishReason) {
                                default:
                                    return "finishReason: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 6:
                                case 5:
                                case 7:
                                case 8:
                                case 9:
                                case 10:
                                case 11:
                                    break;
                                }
                            if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                if (!Array.isArray(message.safetyRatings))
                                    return "safetyRatings: array expected";
                                for (var i = 0; i < message.safetyRatings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.SafetyRating.verify(message.safetyRatings[i]);
                                    if (error)
                                        return "safetyRatings." + error;
                                }
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1beta.CitationMetadata.verify(message.citationMetadata);
                                if (error)
                                    return "citationMetadata." + error;
                            }
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                if (!$util.isInteger(message.tokenCount))
                                    return "tokenCount: integer expected";
                            if (message.groundingAttributions != null && message.hasOwnProperty("groundingAttributions")) {
                                if (!Array.isArray(message.groundingAttributions))
                                    return "groundingAttributions: array expected";
                                for (var i = 0; i < message.groundingAttributions.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.GroundingAttribution.verify(message.groundingAttributions[i]);
                                    if (error)
                                        return "groundingAttributions." + error;
                                }
                            }
                            if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata")) {
                                var error = $root.google.ai.generativelanguage.v1beta.GroundingMetadata.verify(message.groundingMetadata);
                                if (error)
                                    return "groundingMetadata." + error;
                            }
                            if (message.avgLogprobs != null && message.hasOwnProperty("avgLogprobs"))
                                if (typeof message.avgLogprobs !== "number")
                                    return "avgLogprobs: number expected";
                            if (message.logprobsResult != null && message.hasOwnProperty("logprobsResult")) {
                                var error = $root.google.ai.generativelanguage.v1beta.LogprobsResult.verify(message.logprobsResult);
                                if (error)
                                    return "logprobsResult." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Candidate message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Candidate} Candidate
                         */
                        Candidate.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Candidate)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Candidate();
                            if (object.index != null)
                                message.index = object.index | 0;
                            if (object.content != null) {
                                if (typeof object.content !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Candidate.content: object expected");
                                message.content = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.content);
                            }
                            switch (object.finishReason) {
                            default:
                                if (typeof object.finishReason === "number") {
                                    message.finishReason = object.finishReason;
                                    break;
                                }
                                break;
                            case "FINISH_REASON_UNSPECIFIED":
                            case 0:
                                message.finishReason = 0;
                                break;
                            case "STOP":
                            case 1:
                                message.finishReason = 1;
                                break;
                            case "MAX_TOKENS":
                            case 2:
                                message.finishReason = 2;
                                break;
                            case "SAFETY":
                            case 3:
                                message.finishReason = 3;
                                break;
                            case "RECITATION":
                            case 4:
                                message.finishReason = 4;
                                break;
                            case "LANGUAGE":
                            case 6:
                                message.finishReason = 6;
                                break;
                            case "OTHER":
                            case 5:
                                message.finishReason = 5;
                                break;
                            case "BLOCKLIST":
                            case 7:
                                message.finishReason = 7;
                                break;
                            case "PROHIBITED_CONTENT":
                            case 8:
                                message.finishReason = 8;
                                break;
                            case "SPII":
                            case 9:
                                message.finishReason = 9;
                                break;
                            case "MALFORMED_FUNCTION_CALL":
                            case 10:
                                message.finishReason = 10;
                                break;
                            case "IMAGE_SAFETY":
                            case 11:
                                message.finishReason = 11;
                                break;
                            }
                            if (object.safetyRatings) {
                                if (!Array.isArray(object.safetyRatings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Candidate.safetyRatings: array expected");
                                message.safetyRatings = [];
                                for (var i = 0; i < object.safetyRatings.length; ++i) {
                                    if (typeof object.safetyRatings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.Candidate.safetyRatings: object expected");
                                    message.safetyRatings[i] = $root.google.ai.generativelanguage.v1beta.SafetyRating.fromObject(object.safetyRatings[i]);
                                }
                            }
                            if (object.citationMetadata != null) {
                                if (typeof object.citationMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Candidate.citationMetadata: object expected");
                                message.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.fromObject(object.citationMetadata);
                            }
                            if (object.tokenCount != null)
                                message.tokenCount = object.tokenCount | 0;
                            if (object.groundingAttributions) {
                                if (!Array.isArray(object.groundingAttributions))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Candidate.groundingAttributions: array expected");
                                message.groundingAttributions = [];
                                for (var i = 0; i < object.groundingAttributions.length; ++i) {
                                    if (typeof object.groundingAttributions[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.Candidate.groundingAttributions: object expected");
                                    message.groundingAttributions[i] = $root.google.ai.generativelanguage.v1beta.GroundingAttribution.fromObject(object.groundingAttributions[i]);
                                }
                            }
                            if (object.groundingMetadata != null) {
                                if (typeof object.groundingMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Candidate.groundingMetadata: object expected");
                                message.groundingMetadata = $root.google.ai.generativelanguage.v1beta.GroundingMetadata.fromObject(object.groundingMetadata);
                            }
                            if (object.avgLogprobs != null)
                                message.avgLogprobs = Number(object.avgLogprobs);
                            if (object.logprobsResult != null) {
                                if (typeof object.logprobsResult !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Candidate.logprobsResult: object expected");
                                message.logprobsResult = $root.google.ai.generativelanguage.v1beta.LogprobsResult.fromObject(object.logprobsResult);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Candidate message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Candidate} message Candidate
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Candidate.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.safetyRatings = [];
                                object.groundingAttributions = [];
                            }
                            if (options.defaults) {
                                object.content = null;
                                object.finishReason = options.enums === String ? "FINISH_REASON_UNSPECIFIED" : 0;
                                object.citationMetadata = null;
                                object.tokenCount = 0;
                                object.groundingMetadata = null;
                                object.avgLogprobs = 0;
                                object.logprobsResult = null;
                            }
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.content, options);
                            if (message.finishReason != null && message.hasOwnProperty("finishReason"))
                                object.finishReason = options.enums === String ? $root.google.ai.generativelanguage.v1beta.Candidate.FinishReason[message.finishReason] === undefined ? message.finishReason : $root.google.ai.generativelanguage.v1beta.Candidate.FinishReason[message.finishReason] : message.finishReason;
                            if (message.index != null && message.hasOwnProperty("index")) {
                                object.index = message.index;
                                if (options.oneofs)
                                    object._index = "index";
                            }
                            if (message.safetyRatings && message.safetyRatings.length) {
                                object.safetyRatings = [];
                                for (var j = 0; j < message.safetyRatings.length; ++j)
                                    object.safetyRatings[j] = $root.google.ai.generativelanguage.v1beta.SafetyRating.toObject(message.safetyRatings[j], options);
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata"))
                                object.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.toObject(message.citationMetadata, options);
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                object.tokenCount = message.tokenCount;
                            if (message.groundingAttributions && message.groundingAttributions.length) {
                                object.groundingAttributions = [];
                                for (var j = 0; j < message.groundingAttributions.length; ++j)
                                    object.groundingAttributions[j] = $root.google.ai.generativelanguage.v1beta.GroundingAttribution.toObject(message.groundingAttributions[j], options);
                            }
                            if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata"))
                                object.groundingMetadata = $root.google.ai.generativelanguage.v1beta.GroundingMetadata.toObject(message.groundingMetadata, options);
                            if (message.avgLogprobs != null && message.hasOwnProperty("avgLogprobs"))
                                object.avgLogprobs = options.json && !isFinite(message.avgLogprobs) ? String(message.avgLogprobs) : message.avgLogprobs;
                            if (message.logprobsResult != null && message.hasOwnProperty("logprobsResult"))
                                object.logprobsResult = $root.google.ai.generativelanguage.v1beta.LogprobsResult.toObject(message.logprobsResult, options);
                            return object;
                        };
    
                        /**
                         * Converts this Candidate to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Candidate.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Candidate
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Candidate
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Candidate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Candidate";
                        };
    
                        /**
                         * FinishReason enum.
                         * @name google.ai.generativelanguage.v1beta.Candidate.FinishReason
                         * @enum {number}
                         * @property {number} FINISH_REASON_UNSPECIFIED=0 FINISH_REASON_UNSPECIFIED value
                         * @property {number} STOP=1 STOP value
                         * @property {number} MAX_TOKENS=2 MAX_TOKENS value
                         * @property {number} SAFETY=3 SAFETY value
                         * @property {number} RECITATION=4 RECITATION value
                         * @property {number} LANGUAGE=6 LANGUAGE value
                         * @property {number} OTHER=5 OTHER value
                         * @property {number} BLOCKLIST=7 BLOCKLIST value
                         * @property {number} PROHIBITED_CONTENT=8 PROHIBITED_CONTENT value
                         * @property {number} SPII=9 SPII value
                         * @property {number} MALFORMED_FUNCTION_CALL=10 MALFORMED_FUNCTION_CALL value
                         * @property {number} IMAGE_SAFETY=11 IMAGE_SAFETY value
                         */
                        Candidate.FinishReason = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "FINISH_REASON_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "STOP"] = 1;
                            values[valuesById[2] = "MAX_TOKENS"] = 2;
                            values[valuesById[3] = "SAFETY"] = 3;
                            values[valuesById[4] = "RECITATION"] = 4;
                            values[valuesById[6] = "LANGUAGE"] = 6;
                            values[valuesById[5] = "OTHER"] = 5;
                            values[valuesById[7] = "BLOCKLIST"] = 7;
                            values[valuesById[8] = "PROHIBITED_CONTENT"] = 8;
                            values[valuesById[9] = "SPII"] = 9;
                            values[valuesById[10] = "MALFORMED_FUNCTION_CALL"] = 10;
                            values[valuesById[11] = "IMAGE_SAFETY"] = 11;
                            return values;
                        })();
    
                        return Candidate;
                    })();
    
                    v1beta.LogprobsResult = (function() {
    
                        /**
                         * Properties of a LogprobsResult.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ILogprobsResult
                         * @property {Array.<google.ai.generativelanguage.v1beta.LogprobsResult.ITopCandidates>|null} [topCandidates] LogprobsResult topCandidates
                         * @property {Array.<google.ai.generativelanguage.v1beta.LogprobsResult.ICandidate>|null} [chosenCandidates] LogprobsResult chosenCandidates
                         */
    
                        /**
                         * Constructs a new LogprobsResult.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a LogprobsResult.
                         * @implements ILogprobsResult
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ILogprobsResult=} [properties] Properties to set
                         */
                        function LogprobsResult(properties) {
                            this.topCandidates = [];
                            this.chosenCandidates = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * LogprobsResult topCandidates.
                         * @member {Array.<google.ai.generativelanguage.v1beta.LogprobsResult.ITopCandidates>} topCandidates
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @instance
                         */
                        LogprobsResult.prototype.topCandidates = $util.emptyArray;
    
                        /**
                         * LogprobsResult chosenCandidates.
                         * @member {Array.<google.ai.generativelanguage.v1beta.LogprobsResult.ICandidate>} chosenCandidates
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @instance
                         */
                        LogprobsResult.prototype.chosenCandidates = $util.emptyArray;
    
                        /**
                         * Creates a new LogprobsResult instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ILogprobsResult=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.LogprobsResult} LogprobsResult instance
                         */
                        LogprobsResult.create = function create(properties) {
                            return new LogprobsResult(properties);
                        };
    
                        /**
                         * Encodes the specified LogprobsResult message. Does not implicitly {@link google.ai.generativelanguage.v1beta.LogprobsResult.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ILogprobsResult} message LogprobsResult message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        LogprobsResult.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.topCandidates != null && message.topCandidates.length)
                                for (var i = 0; i < message.topCandidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates.encode(message.topCandidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.chosenCandidates != null && message.chosenCandidates.length)
                                for (var i = 0; i < message.chosenCandidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.encode(message.chosenCandidates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified LogprobsResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.LogprobsResult.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ILogprobsResult} message LogprobsResult message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        LogprobsResult.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a LogprobsResult message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.LogprobsResult} LogprobsResult
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        LogprobsResult.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.LogprobsResult();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.topCandidates && message.topCandidates.length))
                                            message.topCandidates = [];
                                        message.topCandidates.push($root.google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        if (!(message.chosenCandidates && message.chosenCandidates.length))
                                            message.chosenCandidates = [];
                                        message.chosenCandidates.push($root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a LogprobsResult message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.LogprobsResult} LogprobsResult
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        LogprobsResult.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a LogprobsResult message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        LogprobsResult.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.topCandidates != null && message.hasOwnProperty("topCandidates")) {
                                if (!Array.isArray(message.topCandidates))
                                    return "topCandidates: array expected";
                                for (var i = 0; i < message.topCandidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates.verify(message.topCandidates[i]);
                                    if (error)
                                        return "topCandidates." + error;
                                }
                            }
                            if (message.chosenCandidates != null && message.hasOwnProperty("chosenCandidates")) {
                                if (!Array.isArray(message.chosenCandidates))
                                    return "chosenCandidates: array expected";
                                for (var i = 0; i < message.chosenCandidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.verify(message.chosenCandidates[i]);
                                    if (error)
                                        return "chosenCandidates." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a LogprobsResult message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.LogprobsResult} LogprobsResult
                         */
                        LogprobsResult.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.LogprobsResult)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.LogprobsResult();
                            if (object.topCandidates) {
                                if (!Array.isArray(object.topCandidates))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.LogprobsResult.topCandidates: array expected");
                                message.topCandidates = [];
                                for (var i = 0; i < object.topCandidates.length; ++i) {
                                    if (typeof object.topCandidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.LogprobsResult.topCandidates: object expected");
                                    message.topCandidates[i] = $root.google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates.fromObject(object.topCandidates[i]);
                                }
                            }
                            if (object.chosenCandidates) {
                                if (!Array.isArray(object.chosenCandidates))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.LogprobsResult.chosenCandidates: array expected");
                                message.chosenCandidates = [];
                                for (var i = 0; i < object.chosenCandidates.length; ++i) {
                                    if (typeof object.chosenCandidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.LogprobsResult.chosenCandidates: object expected");
                                    message.chosenCandidates[i] = $root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.fromObject(object.chosenCandidates[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a LogprobsResult message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.LogprobsResult} message LogprobsResult
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        LogprobsResult.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.topCandidates = [];
                                object.chosenCandidates = [];
                            }
                            if (message.topCandidates && message.topCandidates.length) {
                                object.topCandidates = [];
                                for (var j = 0; j < message.topCandidates.length; ++j)
                                    object.topCandidates[j] = $root.google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates.toObject(message.topCandidates[j], options);
                            }
                            if (message.chosenCandidates && message.chosenCandidates.length) {
                                object.chosenCandidates = [];
                                for (var j = 0; j < message.chosenCandidates.length; ++j)
                                    object.chosenCandidates[j] = $root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.toObject(message.chosenCandidates[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this LogprobsResult to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        LogprobsResult.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for LogprobsResult
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        LogprobsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.LogprobsResult";
                        };
    
                        LogprobsResult.Candidate = (function() {
    
                            /**
                             * Properties of a Candidate.
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                             * @interface ICandidate
                             * @property {string|null} [token] Candidate token
                             * @property {number|null} [tokenId] Candidate tokenId
                             * @property {number|null} [logProbability] Candidate logProbability
                             */
    
                            /**
                             * Constructs a new Candidate.
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                             * @classdesc Represents a Candidate.
                             * @implements ICandidate
                             * @constructor
                             * @param {google.ai.generativelanguage.v1beta.LogprobsResult.ICandidate=} [properties] Properties to set
                             */
                            function Candidate(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * Candidate token.
                             * @member {string|null|undefined} token
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @instance
                             */
                            Candidate.prototype.token = null;
    
                            /**
                             * Candidate tokenId.
                             * @member {number|null|undefined} tokenId
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @instance
                             */
                            Candidate.prototype.tokenId = null;
    
                            /**
                             * Candidate logProbability.
                             * @member {number|null|undefined} logProbability
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @instance
                             */
                            Candidate.prototype.logProbability = null;
    
                            // OneOf field names bound to virtual getters and setters
                            var $oneOfFields;
    
                            /**
                             * Candidate _token.
                             * @member {"token"|undefined} _token
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @instance
                             */
                            Object.defineProperty(Candidate.prototype, "_token", {
                                get: $util.oneOfGetter($oneOfFields = ["token"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Candidate _tokenId.
                             * @member {"tokenId"|undefined} _tokenId
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @instance
                             */
                            Object.defineProperty(Candidate.prototype, "_tokenId", {
                                get: $util.oneOfGetter($oneOfFields = ["tokenId"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Candidate _logProbability.
                             * @member {"logProbability"|undefined} _logProbability
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @instance
                             */
                            Object.defineProperty(Candidate.prototype, "_logProbability", {
                                get: $util.oneOfGetter($oneOfFields = ["logProbability"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Creates a new Candidate instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.LogprobsResult.ICandidate=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1beta.LogprobsResult.Candidate} Candidate instance
                             */
                            Candidate.create = function create(properties) {
                                return new Candidate(properties);
                            };
    
                            /**
                             * Encodes the specified Candidate message. Does not implicitly {@link google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.LogprobsResult.ICandidate} message Candidate message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Candidate.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.token != null && Object.hasOwnProperty.call(message, "token"))
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.token);
                                if (message.logProbability != null && Object.hasOwnProperty.call(message, "logProbability"))
                                    writer.uint32(/* id 2, wireType 5 =*/21).float(message.logProbability);
                                if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId"))
                                    writer.uint32(/* id 3, wireType 0 =*/24).int32(message.tokenId);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.LogprobsResult.ICandidate} message Candidate message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Candidate.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a Candidate message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1beta.LogprobsResult.Candidate} Candidate
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Candidate.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.token = reader.string();
                                            break;
                                        }
                                    case 3: {
                                            message.tokenId = reader.int32();
                                            break;
                                        }
                                    case 2: {
                                            message.logProbability = reader.float();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a Candidate message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1beta.LogprobsResult.Candidate} Candidate
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Candidate.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a Candidate message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            Candidate.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                var properties = {};
                                if (message.token != null && message.hasOwnProperty("token")) {
                                    properties._token = 1;
                                    if (!$util.isString(message.token))
                                        return "token: string expected";
                                }
                                if (message.tokenId != null && message.hasOwnProperty("tokenId")) {
                                    properties._tokenId = 1;
                                    if (!$util.isInteger(message.tokenId))
                                        return "tokenId: integer expected";
                                }
                                if (message.logProbability != null && message.hasOwnProperty("logProbability")) {
                                    properties._logProbability = 1;
                                    if (typeof message.logProbability !== "number")
                                        return "logProbability: number expected";
                                }
                                return null;
                            };
    
                            /**
                             * Creates a Candidate message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1beta.LogprobsResult.Candidate} Candidate
                             */
                            Candidate.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate();
                                if (object.token != null)
                                    message.token = String(object.token);
                                if (object.tokenId != null)
                                    message.tokenId = object.tokenId | 0;
                                if (object.logProbability != null)
                                    message.logProbability = Number(object.logProbability);
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a Candidate message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.LogprobsResult.Candidate} message Candidate
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            Candidate.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (message.token != null && message.hasOwnProperty("token")) {
                                    object.token = message.token;
                                    if (options.oneofs)
                                        object._token = "token";
                                }
                                if (message.logProbability != null && message.hasOwnProperty("logProbability")) {
                                    object.logProbability = options.json && !isFinite(message.logProbability) ? String(message.logProbability) : message.logProbability;
                                    if (options.oneofs)
                                        object._logProbability = "logProbability";
                                }
                                if (message.tokenId != null && message.hasOwnProperty("tokenId")) {
                                    object.tokenId = message.tokenId;
                                    if (options.oneofs)
                                        object._tokenId = "tokenId";
                                }
                                return object;
                            };
    
                            /**
                             * Converts this Candidate to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            Candidate.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for Candidate
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.Candidate
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            Candidate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.LogprobsResult.Candidate";
                            };
    
                            return Candidate;
                        })();
    
                        LogprobsResult.TopCandidates = (function() {
    
                            /**
                             * Properties of a TopCandidates.
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                             * @interface ITopCandidates
                             * @property {Array.<google.ai.generativelanguage.v1beta.LogprobsResult.ICandidate>|null} [candidates] TopCandidates candidates
                             */
    
                            /**
                             * Constructs a new TopCandidates.
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult
                             * @classdesc Represents a TopCandidates.
                             * @implements ITopCandidates
                             * @constructor
                             * @param {google.ai.generativelanguage.v1beta.LogprobsResult.ITopCandidates=} [properties] Properties to set
                             */
                            function TopCandidates(properties) {
                                this.candidates = [];
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * TopCandidates candidates.
                             * @member {Array.<google.ai.generativelanguage.v1beta.LogprobsResult.ICandidate>} candidates
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates
                             * @instance
                             */
                            TopCandidates.prototype.candidates = $util.emptyArray;
    
                            /**
                             * Creates a new TopCandidates instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.LogprobsResult.ITopCandidates=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates} TopCandidates instance
                             */
                            TopCandidates.create = function create(properties) {
                                return new TopCandidates(properties);
                            };
    
                            /**
                             * Encodes the specified TopCandidates message. Does not implicitly {@link google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.LogprobsResult.ITopCandidates} message TopCandidates message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            TopCandidates.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.candidates != null && message.candidates.length)
                                    for (var i = 0; i < message.candidates.length; ++i)
                                        $root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                                return writer;
                            };
    
                            /**
                             * Encodes the specified TopCandidates message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.LogprobsResult.ITopCandidates} message TopCandidates message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            TopCandidates.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a TopCandidates message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates} TopCandidates
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            TopCandidates.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            if (!(message.candidates && message.candidates.length))
                                                message.candidates = [];
                                            message.candidates.push($root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.decode(reader, reader.uint32()));
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a TopCandidates message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates} TopCandidates
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            TopCandidates.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a TopCandidates message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            TopCandidates.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                    if (!Array.isArray(message.candidates))
                                        return "candidates: array expected";
                                    for (var i = 0; i < message.candidates.length; ++i) {
                                        var error = $root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.verify(message.candidates[i]);
                                        if (error)
                                            return "candidates." + error;
                                    }
                                }
                                return null;
                            };
    
                            /**
                             * Creates a TopCandidates message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates} TopCandidates
                             */
                            TopCandidates.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates();
                                if (object.candidates) {
                                    if (!Array.isArray(object.candidates))
                                        throw TypeError(".google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates.candidates: array expected");
                                    message.candidates = [];
                                    for (var i = 0; i < object.candidates.length; ++i) {
                                        if (typeof object.candidates[i] !== "object")
                                            throw TypeError(".google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates.candidates: object expected");
                                        message.candidates[i] = $root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.fromObject(object.candidates[i]);
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a TopCandidates message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates} message TopCandidates
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            TopCandidates.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.arrays || options.defaults)
                                    object.candidates = [];
                                if (message.candidates && message.candidates.length) {
                                    object.candidates = [];
                                    for (var j = 0; j < message.candidates.length; ++j)
                                        object.candidates[j] = $root.google.ai.generativelanguage.v1beta.LogprobsResult.Candidate.toObject(message.candidates[j], options);
                                }
                                return object;
                            };
    
                            /**
                             * Converts this TopCandidates to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            TopCandidates.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for TopCandidates
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            TopCandidates.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.LogprobsResult.TopCandidates";
                            };
    
                            return TopCandidates;
                        })();
    
                        return LogprobsResult;
                    })();
    
                    v1beta.AttributionSourceId = (function() {
    
                        /**
                         * Properties of an AttributionSourceId.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IAttributionSourceId
                         * @property {google.ai.generativelanguage.v1beta.AttributionSourceId.IGroundingPassageId|null} [groundingPassage] AttributionSourceId groundingPassage
                         * @property {google.ai.generativelanguage.v1beta.AttributionSourceId.ISemanticRetrieverChunk|null} [semanticRetrieverChunk] AttributionSourceId semanticRetrieverChunk
                         */
    
                        /**
                         * Constructs a new AttributionSourceId.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an AttributionSourceId.
                         * @implements IAttributionSourceId
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IAttributionSourceId=} [properties] Properties to set
                         */
                        function AttributionSourceId(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * AttributionSourceId groundingPassage.
                         * @member {google.ai.generativelanguage.v1beta.AttributionSourceId.IGroundingPassageId|null|undefined} groundingPassage
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @instance
                         */
                        AttributionSourceId.prototype.groundingPassage = null;
    
                        /**
                         * AttributionSourceId semanticRetrieverChunk.
                         * @member {google.ai.generativelanguage.v1beta.AttributionSourceId.ISemanticRetrieverChunk|null|undefined} semanticRetrieverChunk
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @instance
                         */
                        AttributionSourceId.prototype.semanticRetrieverChunk = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * AttributionSourceId source.
                         * @member {"groundingPassage"|"semanticRetrieverChunk"|undefined} source
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @instance
                         */
                        Object.defineProperty(AttributionSourceId.prototype, "source", {
                            get: $util.oneOfGetter($oneOfFields = ["groundingPassage", "semanticRetrieverChunk"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new AttributionSourceId instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IAttributionSourceId=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId} AttributionSourceId instance
                         */
                        AttributionSourceId.create = function create(properties) {
                            return new AttributionSourceId(properties);
                        };
    
                        /**
                         * Encodes the specified AttributionSourceId message. Does not implicitly {@link google.ai.generativelanguage.v1beta.AttributionSourceId.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IAttributionSourceId} message AttributionSourceId message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        AttributionSourceId.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.groundingPassage != null && Object.hasOwnProperty.call(message, "groundingPassage"))
                                $root.google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId.encode(message.groundingPassage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.semanticRetrieverChunk != null && Object.hasOwnProperty.call(message, "semanticRetrieverChunk"))
                                $root.google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk.encode(message.semanticRetrieverChunk, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified AttributionSourceId message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.AttributionSourceId.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IAttributionSourceId} message AttributionSourceId message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        AttributionSourceId.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an AttributionSourceId message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId} AttributionSourceId
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        AttributionSourceId.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.AttributionSourceId();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.groundingPassage = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.semanticRetrieverChunk = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an AttributionSourceId message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId} AttributionSourceId
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        AttributionSourceId.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an AttributionSourceId message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        AttributionSourceId.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.groundingPassage != null && message.hasOwnProperty("groundingPassage")) {
                                properties.source = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId.verify(message.groundingPassage);
                                    if (error)
                                        return "groundingPassage." + error;
                                }
                            }
                            if (message.semanticRetrieverChunk != null && message.hasOwnProperty("semanticRetrieverChunk")) {
                                if (properties.source === 1)
                                    return "source: multiple values";
                                properties.source = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk.verify(message.semanticRetrieverChunk);
                                    if (error)
                                        return "semanticRetrieverChunk." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates an AttributionSourceId message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId} AttributionSourceId
                         */
                        AttributionSourceId.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.AttributionSourceId)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.AttributionSourceId();
                            if (object.groundingPassage != null) {
                                if (typeof object.groundingPassage !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.AttributionSourceId.groundingPassage: object expected");
                                message.groundingPassage = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId.fromObject(object.groundingPassage);
                            }
                            if (object.semanticRetrieverChunk != null) {
                                if (typeof object.semanticRetrieverChunk !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.AttributionSourceId.semanticRetrieverChunk: object expected");
                                message.semanticRetrieverChunk = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk.fromObject(object.semanticRetrieverChunk);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an AttributionSourceId message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.AttributionSourceId} message AttributionSourceId
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        AttributionSourceId.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.groundingPassage != null && message.hasOwnProperty("groundingPassage")) {
                                object.groundingPassage = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId.toObject(message.groundingPassage, options);
                                if (options.oneofs)
                                    object.source = "groundingPassage";
                            }
                            if (message.semanticRetrieverChunk != null && message.hasOwnProperty("semanticRetrieverChunk")) {
                                object.semanticRetrieverChunk = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk.toObject(message.semanticRetrieverChunk, options);
                                if (options.oneofs)
                                    object.source = "semanticRetrieverChunk";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this AttributionSourceId to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        AttributionSourceId.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for AttributionSourceId
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        AttributionSourceId.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.AttributionSourceId";
                        };
    
                        AttributionSourceId.GroundingPassageId = (function() {
    
                            /**
                             * Properties of a GroundingPassageId.
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                             * @interface IGroundingPassageId
                             * @property {string|null} [passageId] GroundingPassageId passageId
                             * @property {number|null} [partIndex] GroundingPassageId partIndex
                             */
    
                            /**
                             * Constructs a new GroundingPassageId.
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                             * @classdesc Represents a GroundingPassageId.
                             * @implements IGroundingPassageId
                             * @constructor
                             * @param {google.ai.generativelanguage.v1beta.AttributionSourceId.IGroundingPassageId=} [properties] Properties to set
                             */
                            function GroundingPassageId(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * GroundingPassageId passageId.
                             * @member {string} passageId
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @instance
                             */
                            GroundingPassageId.prototype.passageId = "";
    
                            /**
                             * GroundingPassageId partIndex.
                             * @member {number} partIndex
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @instance
                             */
                            GroundingPassageId.prototype.partIndex = 0;
    
                            /**
                             * Creates a new GroundingPassageId instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.AttributionSourceId.IGroundingPassageId=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId} GroundingPassageId instance
                             */
                            GroundingPassageId.create = function create(properties) {
                                return new GroundingPassageId(properties);
                            };
    
                            /**
                             * Encodes the specified GroundingPassageId message. Does not implicitly {@link google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.AttributionSourceId.IGroundingPassageId} message GroundingPassageId message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            GroundingPassageId.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.passageId != null && Object.hasOwnProperty.call(message, "passageId"))
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.passageId);
                                if (message.partIndex != null && Object.hasOwnProperty.call(message, "partIndex"))
                                    writer.uint32(/* id 2, wireType 0 =*/16).int32(message.partIndex);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified GroundingPassageId message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.AttributionSourceId.IGroundingPassageId} message GroundingPassageId message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            GroundingPassageId.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a GroundingPassageId message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId} GroundingPassageId
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            GroundingPassageId.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.passageId = reader.string();
                                            break;
                                        }
                                    case 2: {
                                            message.partIndex = reader.int32();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a GroundingPassageId message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId} GroundingPassageId
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            GroundingPassageId.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a GroundingPassageId message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            GroundingPassageId.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.passageId != null && message.hasOwnProperty("passageId"))
                                    if (!$util.isString(message.passageId))
                                        return "passageId: string expected";
                                if (message.partIndex != null && message.hasOwnProperty("partIndex"))
                                    if (!$util.isInteger(message.partIndex))
                                        return "partIndex: integer expected";
                                return null;
                            };
    
                            /**
                             * Creates a GroundingPassageId message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId} GroundingPassageId
                             */
                            GroundingPassageId.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId();
                                if (object.passageId != null)
                                    message.passageId = String(object.passageId);
                                if (object.partIndex != null)
                                    message.partIndex = object.partIndex | 0;
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a GroundingPassageId message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId} message GroundingPassageId
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            GroundingPassageId.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.defaults) {
                                    object.passageId = "";
                                    object.partIndex = 0;
                                }
                                if (message.passageId != null && message.hasOwnProperty("passageId"))
                                    object.passageId = message.passageId;
                                if (message.partIndex != null && message.hasOwnProperty("partIndex"))
                                    object.partIndex = message.partIndex;
                                return object;
                            };
    
                            /**
                             * Converts this GroundingPassageId to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            GroundingPassageId.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for GroundingPassageId
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            GroundingPassageId.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId";
                            };
    
                            return GroundingPassageId;
                        })();
    
                        AttributionSourceId.SemanticRetrieverChunk = (function() {
    
                            /**
                             * Properties of a SemanticRetrieverChunk.
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                             * @interface ISemanticRetrieverChunk
                             * @property {string|null} [source] SemanticRetrieverChunk source
                             * @property {string|null} [chunk] SemanticRetrieverChunk chunk
                             */
    
                            /**
                             * Constructs a new SemanticRetrieverChunk.
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId
                             * @classdesc Represents a SemanticRetrieverChunk.
                             * @implements ISemanticRetrieverChunk
                             * @constructor
                             * @param {google.ai.generativelanguage.v1beta.AttributionSourceId.ISemanticRetrieverChunk=} [properties] Properties to set
                             */
                            function SemanticRetrieverChunk(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * SemanticRetrieverChunk source.
                             * @member {string} source
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @instance
                             */
                            SemanticRetrieverChunk.prototype.source = "";
    
                            /**
                             * SemanticRetrieverChunk chunk.
                             * @member {string} chunk
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @instance
                             */
                            SemanticRetrieverChunk.prototype.chunk = "";
    
                            /**
                             * Creates a new SemanticRetrieverChunk instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.AttributionSourceId.ISemanticRetrieverChunk=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk instance
                             */
                            SemanticRetrieverChunk.create = function create(properties) {
                                return new SemanticRetrieverChunk(properties);
                            };
    
                            /**
                             * Encodes the specified SemanticRetrieverChunk message. Does not implicitly {@link google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.AttributionSourceId.ISemanticRetrieverChunk} message SemanticRetrieverChunk message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            SemanticRetrieverChunk.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.source != null && Object.hasOwnProperty.call(message, "source"))
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.source);
                                if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk"))
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.chunk);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified SemanticRetrieverChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.AttributionSourceId.ISemanticRetrieverChunk} message SemanticRetrieverChunk message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            SemanticRetrieverChunk.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a SemanticRetrieverChunk message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            SemanticRetrieverChunk.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.source = reader.string();
                                            break;
                                        }
                                    case 2: {
                                            message.chunk = reader.string();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a SemanticRetrieverChunk message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            SemanticRetrieverChunk.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a SemanticRetrieverChunk message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            SemanticRetrieverChunk.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                if (message.source != null && message.hasOwnProperty("source"))
                                    if (!$util.isString(message.source))
                                        return "source: string expected";
                                if (message.chunk != null && message.hasOwnProperty("chunk"))
                                    if (!$util.isString(message.chunk))
                                        return "chunk: string expected";
                                return null;
                            };
    
                            /**
                             * Creates a SemanticRetrieverChunk message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk
                             */
                            SemanticRetrieverChunk.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk();
                                if (object.source != null)
                                    message.source = String(object.source);
                                if (object.chunk != null)
                                    message.chunk = String(object.chunk);
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a SemanticRetrieverChunk message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk} message SemanticRetrieverChunk
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            SemanticRetrieverChunk.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.defaults) {
                                    object.source = "";
                                    object.chunk = "";
                                }
                                if (message.source != null && message.hasOwnProperty("source"))
                                    object.source = message.source;
                                if (message.chunk != null && message.hasOwnProperty("chunk"))
                                    object.chunk = message.chunk;
                                return object;
                            };
    
                            /**
                             * Converts this SemanticRetrieverChunk to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            SemanticRetrieverChunk.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for SemanticRetrieverChunk
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            SemanticRetrieverChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk";
                            };
    
                            return SemanticRetrieverChunk;
                        })();
    
                        return AttributionSourceId;
                    })();
    
                    v1beta.GroundingAttribution = (function() {
    
                        /**
                         * Properties of a GroundingAttribution.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGroundingAttribution
                         * @property {google.ai.generativelanguage.v1beta.IAttributionSourceId|null} [sourceId] GroundingAttribution sourceId
                         * @property {google.ai.generativelanguage.v1beta.IContent|null} [content] GroundingAttribution content
                         */
    
                        /**
                         * Constructs a new GroundingAttribution.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GroundingAttribution.
                         * @implements IGroundingAttribution
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGroundingAttribution=} [properties] Properties to set
                         */
                        function GroundingAttribution(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingAttribution sourceId.
                         * @member {google.ai.generativelanguage.v1beta.IAttributionSourceId|null|undefined} sourceId
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @instance
                         */
                        GroundingAttribution.prototype.sourceId = null;
    
                        /**
                         * GroundingAttribution content.
                         * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} content
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @instance
                         */
                        GroundingAttribution.prototype.content = null;
    
                        /**
                         * Creates a new GroundingAttribution instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingAttribution=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GroundingAttribution} GroundingAttribution instance
                         */
                        GroundingAttribution.create = function create(properties) {
                            return new GroundingAttribution(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingAttribution message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingAttribution.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingAttribution} message GroundingAttribution message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingAttribution.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                $root.google.ai.generativelanguage.v1beta.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.sourceId != null && Object.hasOwnProperty.call(message, "sourceId"))
                                $root.google.ai.generativelanguage.v1beta.AttributionSourceId.encode(message.sourceId, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingAttribution message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingAttribution.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingAttribution} message GroundingAttribution message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingAttribution.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingAttribution message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GroundingAttribution} GroundingAttribution
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingAttribution.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GroundingAttribution();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.sourceId = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.content = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingAttribution message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GroundingAttribution} GroundingAttribution
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingAttribution.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingAttribution message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingAttribution.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.sourceId != null && message.hasOwnProperty("sourceId")) {
                                var error = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.verify(message.sourceId);
                                if (error)
                                    return "sourceId." + error;
                            }
                            if (message.content != null && message.hasOwnProperty("content")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.content);
                                if (error)
                                    return "content." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingAttribution message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GroundingAttribution} GroundingAttribution
                         */
                        GroundingAttribution.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingAttribution)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GroundingAttribution();
                            if (object.sourceId != null) {
                                if (typeof object.sourceId !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingAttribution.sourceId: object expected");
                                message.sourceId = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.fromObject(object.sourceId);
                            }
                            if (object.content != null) {
                                if (typeof object.content !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingAttribution.content: object expected");
                                message.content = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.content);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingAttribution message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GroundingAttribution} message GroundingAttribution
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingAttribution.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.content = null;
                                object.sourceId = null;
                            }
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.content, options);
                            if (message.sourceId != null && message.hasOwnProperty("sourceId"))
                                object.sourceId = $root.google.ai.generativelanguage.v1beta.AttributionSourceId.toObject(message.sourceId, options);
                            return object;
                        };
    
                        /**
                         * Converts this GroundingAttribution to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingAttribution.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingAttribution
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GroundingAttribution
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingAttribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingAttribution";
                        };
    
                        return GroundingAttribution;
                    })();
    
                    v1beta.RetrievalMetadata = (function() {
    
                        /**
                         * Properties of a RetrievalMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IRetrievalMetadata
                         * @property {number|null} [googleSearchDynamicRetrievalScore] RetrievalMetadata googleSearchDynamicRetrievalScore
                         */
    
                        /**
                         * Constructs a new RetrievalMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a RetrievalMetadata.
                         * @implements IRetrievalMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IRetrievalMetadata=} [properties] Properties to set
                         */
                        function RetrievalMetadata(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * RetrievalMetadata googleSearchDynamicRetrievalScore.
                         * @member {number} googleSearchDynamicRetrievalScore
                         * @memberof google.ai.generativelanguage.v1beta.RetrievalMetadata
                         * @instance
                         */
                        RetrievalMetadata.prototype.googleSearchDynamicRetrievalScore = 0;
    
                        /**
                         * Creates a new RetrievalMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IRetrievalMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.RetrievalMetadata} RetrievalMetadata instance
                         */
                        RetrievalMetadata.create = function create(properties) {
                            return new RetrievalMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified RetrievalMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.RetrievalMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IRetrievalMetadata} message RetrievalMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        RetrievalMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.googleSearchDynamicRetrievalScore != null && Object.hasOwnProperty.call(message, "googleSearchDynamicRetrievalScore"))
                                writer.uint32(/* id 2, wireType 5 =*/21).float(message.googleSearchDynamicRetrievalScore);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified RetrievalMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.RetrievalMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IRetrievalMetadata} message RetrievalMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        RetrievalMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a RetrievalMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.RetrievalMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.RetrievalMetadata} RetrievalMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        RetrievalMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.RetrievalMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.googleSearchDynamicRetrievalScore = reader.float();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a RetrievalMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.RetrievalMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.RetrievalMetadata} RetrievalMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        RetrievalMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a RetrievalMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.RetrievalMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        RetrievalMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.googleSearchDynamicRetrievalScore != null && message.hasOwnProperty("googleSearchDynamicRetrievalScore"))
                                if (typeof message.googleSearchDynamicRetrievalScore !== "number")
                                    return "googleSearchDynamicRetrievalScore: number expected";
                            return null;
                        };
    
                        /**
                         * Creates a RetrievalMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.RetrievalMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.RetrievalMetadata} RetrievalMetadata
                         */
                        RetrievalMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.RetrievalMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.RetrievalMetadata();
                            if (object.googleSearchDynamicRetrievalScore != null)
                                message.googleSearchDynamicRetrievalScore = Number(object.googleSearchDynamicRetrievalScore);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a RetrievalMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.RetrievalMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.RetrievalMetadata} message RetrievalMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        RetrievalMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.googleSearchDynamicRetrievalScore = 0;
                            if (message.googleSearchDynamicRetrievalScore != null && message.hasOwnProperty("googleSearchDynamicRetrievalScore"))
                                object.googleSearchDynamicRetrievalScore = options.json && !isFinite(message.googleSearchDynamicRetrievalScore) ? String(message.googleSearchDynamicRetrievalScore) : message.googleSearchDynamicRetrievalScore;
                            return object;
                        };
    
                        /**
                         * Converts this RetrievalMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.RetrievalMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        RetrievalMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for RetrievalMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.RetrievalMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        RetrievalMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.RetrievalMetadata";
                        };
    
                        return RetrievalMetadata;
                    })();
    
                    v1beta.GroundingMetadata = (function() {
    
                        /**
                         * Properties of a GroundingMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGroundingMetadata
                         * @property {google.ai.generativelanguage.v1beta.ISearchEntryPoint|null} [searchEntryPoint] GroundingMetadata searchEntryPoint
                         * @property {Array.<google.ai.generativelanguage.v1beta.IGroundingChunk>|null} [groundingChunks] GroundingMetadata groundingChunks
                         * @property {Array.<google.ai.generativelanguage.v1beta.IGroundingSupport>|null} [groundingSupports] GroundingMetadata groundingSupports
                         * @property {google.ai.generativelanguage.v1beta.IRetrievalMetadata|null} [retrievalMetadata] GroundingMetadata retrievalMetadata
                         * @property {Array.<string>|null} [webSearchQueries] GroundingMetadata webSearchQueries
                         */
    
                        /**
                         * Constructs a new GroundingMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GroundingMetadata.
                         * @implements IGroundingMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGroundingMetadata=} [properties] Properties to set
                         */
                        function GroundingMetadata(properties) {
                            this.groundingChunks = [];
                            this.groundingSupports = [];
                            this.webSearchQueries = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingMetadata searchEntryPoint.
                         * @member {google.ai.generativelanguage.v1beta.ISearchEntryPoint|null|undefined} searchEntryPoint
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.searchEntryPoint = null;
    
                        /**
                         * GroundingMetadata groundingChunks.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IGroundingChunk>} groundingChunks
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.groundingChunks = $util.emptyArray;
    
                        /**
                         * GroundingMetadata groundingSupports.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IGroundingSupport>} groundingSupports
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.groundingSupports = $util.emptyArray;
    
                        /**
                         * GroundingMetadata retrievalMetadata.
                         * @member {google.ai.generativelanguage.v1beta.IRetrievalMetadata|null|undefined} retrievalMetadata
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.retrievalMetadata = null;
    
                        /**
                         * GroundingMetadata webSearchQueries.
                         * @member {Array.<string>} webSearchQueries
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @instance
                         */
                        GroundingMetadata.prototype.webSearchQueries = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GroundingMetadata _searchEntryPoint.
                         * @member {"searchEntryPoint"|undefined} _searchEntryPoint
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @instance
                         */
                        Object.defineProperty(GroundingMetadata.prototype, "_searchEntryPoint", {
                            get: $util.oneOfGetter($oneOfFields = ["searchEntryPoint"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GroundingMetadata _retrievalMetadata.
                         * @member {"retrievalMetadata"|undefined} _retrievalMetadata
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @instance
                         */
                        Object.defineProperty(GroundingMetadata.prototype, "_retrievalMetadata", {
                            get: $util.oneOfGetter($oneOfFields = ["retrievalMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GroundingMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GroundingMetadata} GroundingMetadata instance
                         */
                        GroundingMetadata.create = function create(properties) {
                            return new GroundingMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingMetadata} message GroundingMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.searchEntryPoint != null && Object.hasOwnProperty.call(message, "searchEntryPoint"))
                                $root.google.ai.generativelanguage.v1beta.SearchEntryPoint.encode(message.searchEntryPoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.groundingChunks != null && message.groundingChunks.length)
                                for (var i = 0; i < message.groundingChunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.GroundingChunk.encode(message.groundingChunks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.groundingSupports != null && message.groundingSupports.length)
                                for (var i = 0; i < message.groundingSupports.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.GroundingSupport.encode(message.groundingSupports[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.retrievalMetadata != null && Object.hasOwnProperty.call(message, "retrievalMetadata"))
                                $root.google.ai.generativelanguage.v1beta.RetrievalMetadata.encode(message.retrievalMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.webSearchQueries != null && message.webSearchQueries.length)
                                for (var i = 0; i < message.webSearchQueries.length; ++i)
                                    writer.uint32(/* id 5, wireType 2 =*/42).string(message.webSearchQueries[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingMetadata} message GroundingMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GroundingMetadata} GroundingMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GroundingMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.searchEntryPoint = $root.google.ai.generativelanguage.v1beta.SearchEntryPoint.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        if (!(message.groundingChunks && message.groundingChunks.length))
                                            message.groundingChunks = [];
                                        message.groundingChunks.push($root.google.ai.generativelanguage.v1beta.GroundingChunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.groundingSupports && message.groundingSupports.length))
                                            message.groundingSupports = [];
                                        message.groundingSupports.push($root.google.ai.generativelanguage.v1beta.GroundingSupport.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.retrievalMetadata = $root.google.ai.generativelanguage.v1beta.RetrievalMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        if (!(message.webSearchQueries && message.webSearchQueries.length))
                                            message.webSearchQueries = [];
                                        message.webSearchQueries.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GroundingMetadata} GroundingMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.searchEntryPoint != null && message.hasOwnProperty("searchEntryPoint")) {
                                properties._searchEntryPoint = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.SearchEntryPoint.verify(message.searchEntryPoint);
                                    if (error)
                                        return "searchEntryPoint." + error;
                                }
                            }
                            if (message.groundingChunks != null && message.hasOwnProperty("groundingChunks")) {
                                if (!Array.isArray(message.groundingChunks))
                                    return "groundingChunks: array expected";
                                for (var i = 0; i < message.groundingChunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.GroundingChunk.verify(message.groundingChunks[i]);
                                    if (error)
                                        return "groundingChunks." + error;
                                }
                            }
                            if (message.groundingSupports != null && message.hasOwnProperty("groundingSupports")) {
                                if (!Array.isArray(message.groundingSupports))
                                    return "groundingSupports: array expected";
                                for (var i = 0; i < message.groundingSupports.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.GroundingSupport.verify(message.groundingSupports[i]);
                                    if (error)
                                        return "groundingSupports." + error;
                                }
                            }
                            if (message.retrievalMetadata != null && message.hasOwnProperty("retrievalMetadata")) {
                                properties._retrievalMetadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.RetrievalMetadata.verify(message.retrievalMetadata);
                                    if (error)
                                        return "retrievalMetadata." + error;
                                }
                            }
                            if (message.webSearchQueries != null && message.hasOwnProperty("webSearchQueries")) {
                                if (!Array.isArray(message.webSearchQueries))
                                    return "webSearchQueries: array expected";
                                for (var i = 0; i < message.webSearchQueries.length; ++i)
                                    if (!$util.isString(message.webSearchQueries[i]))
                                        return "webSearchQueries: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GroundingMetadata} GroundingMetadata
                         */
                        GroundingMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GroundingMetadata();
                            if (object.searchEntryPoint != null) {
                                if (typeof object.searchEntryPoint !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingMetadata.searchEntryPoint: object expected");
                                message.searchEntryPoint = $root.google.ai.generativelanguage.v1beta.SearchEntryPoint.fromObject(object.searchEntryPoint);
                            }
                            if (object.groundingChunks) {
                                if (!Array.isArray(object.groundingChunks))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingMetadata.groundingChunks: array expected");
                                message.groundingChunks = [];
                                for (var i = 0; i < object.groundingChunks.length; ++i) {
                                    if (typeof object.groundingChunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GroundingMetadata.groundingChunks: object expected");
                                    message.groundingChunks[i] = $root.google.ai.generativelanguage.v1beta.GroundingChunk.fromObject(object.groundingChunks[i]);
                                }
                            }
                            if (object.groundingSupports) {
                                if (!Array.isArray(object.groundingSupports))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingMetadata.groundingSupports: array expected");
                                message.groundingSupports = [];
                                for (var i = 0; i < object.groundingSupports.length; ++i) {
                                    if (typeof object.groundingSupports[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GroundingMetadata.groundingSupports: object expected");
                                    message.groundingSupports[i] = $root.google.ai.generativelanguage.v1beta.GroundingSupport.fromObject(object.groundingSupports[i]);
                                }
                            }
                            if (object.retrievalMetadata != null) {
                                if (typeof object.retrievalMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingMetadata.retrievalMetadata: object expected");
                                message.retrievalMetadata = $root.google.ai.generativelanguage.v1beta.RetrievalMetadata.fromObject(object.retrievalMetadata);
                            }
                            if (object.webSearchQueries) {
                                if (!Array.isArray(object.webSearchQueries))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingMetadata.webSearchQueries: array expected");
                                message.webSearchQueries = [];
                                for (var i = 0; i < object.webSearchQueries.length; ++i)
                                    message.webSearchQueries[i] = String(object.webSearchQueries[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GroundingMetadata} message GroundingMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.groundingChunks = [];
                                object.groundingSupports = [];
                                object.webSearchQueries = [];
                            }
                            if (message.searchEntryPoint != null && message.hasOwnProperty("searchEntryPoint")) {
                                object.searchEntryPoint = $root.google.ai.generativelanguage.v1beta.SearchEntryPoint.toObject(message.searchEntryPoint, options);
                                if (options.oneofs)
                                    object._searchEntryPoint = "searchEntryPoint";
                            }
                            if (message.groundingChunks && message.groundingChunks.length) {
                                object.groundingChunks = [];
                                for (var j = 0; j < message.groundingChunks.length; ++j)
                                    object.groundingChunks[j] = $root.google.ai.generativelanguage.v1beta.GroundingChunk.toObject(message.groundingChunks[j], options);
                            }
                            if (message.groundingSupports && message.groundingSupports.length) {
                                object.groundingSupports = [];
                                for (var j = 0; j < message.groundingSupports.length; ++j)
                                    object.groundingSupports[j] = $root.google.ai.generativelanguage.v1beta.GroundingSupport.toObject(message.groundingSupports[j], options);
                            }
                            if (message.retrievalMetadata != null && message.hasOwnProperty("retrievalMetadata")) {
                                object.retrievalMetadata = $root.google.ai.generativelanguage.v1beta.RetrievalMetadata.toObject(message.retrievalMetadata, options);
                                if (options.oneofs)
                                    object._retrievalMetadata = "retrievalMetadata";
                            }
                            if (message.webSearchQueries && message.webSearchQueries.length) {
                                object.webSearchQueries = [];
                                for (var j = 0; j < message.webSearchQueries.length; ++j)
                                    object.webSearchQueries[j] = message.webSearchQueries[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GroundingMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GroundingMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingMetadata";
                        };
    
                        return GroundingMetadata;
                    })();
    
                    v1beta.SearchEntryPoint = (function() {
    
                        /**
                         * Properties of a SearchEntryPoint.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ISearchEntryPoint
                         * @property {string|null} [renderedContent] SearchEntryPoint renderedContent
                         * @property {Uint8Array|null} [sdkBlob] SearchEntryPoint sdkBlob
                         */
    
                        /**
                         * Constructs a new SearchEntryPoint.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a SearchEntryPoint.
                         * @implements ISearchEntryPoint
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ISearchEntryPoint=} [properties] Properties to set
                         */
                        function SearchEntryPoint(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SearchEntryPoint renderedContent.
                         * @member {string} renderedContent
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @instance
                         */
                        SearchEntryPoint.prototype.renderedContent = "";
    
                        /**
                         * SearchEntryPoint sdkBlob.
                         * @member {Uint8Array} sdkBlob
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @instance
                         */
                        SearchEntryPoint.prototype.sdkBlob = $util.newBuffer([]);
    
                        /**
                         * Creates a new SearchEntryPoint instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISearchEntryPoint=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.SearchEntryPoint} SearchEntryPoint instance
                         */
                        SearchEntryPoint.create = function create(properties) {
                            return new SearchEntryPoint(properties);
                        };
    
                        /**
                         * Encodes the specified SearchEntryPoint message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SearchEntryPoint.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISearchEntryPoint} message SearchEntryPoint message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SearchEntryPoint.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.renderedContent != null && Object.hasOwnProperty.call(message, "renderedContent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderedContent);
                            if (message.sdkBlob != null && Object.hasOwnProperty.call(message, "sdkBlob"))
                                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.sdkBlob);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SearchEntryPoint message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SearchEntryPoint.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISearchEntryPoint} message SearchEntryPoint message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SearchEntryPoint.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SearchEntryPoint message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.SearchEntryPoint} SearchEntryPoint
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SearchEntryPoint.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SearchEntryPoint();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.renderedContent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.sdkBlob = reader.bytes();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SearchEntryPoint message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.SearchEntryPoint} SearchEntryPoint
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SearchEntryPoint.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SearchEntryPoint message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SearchEntryPoint.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.renderedContent != null && message.hasOwnProperty("renderedContent"))
                                if (!$util.isString(message.renderedContent))
                                    return "renderedContent: string expected";
                            if (message.sdkBlob != null && message.hasOwnProperty("sdkBlob"))
                                if (!(message.sdkBlob && typeof message.sdkBlob.length === "number" || $util.isString(message.sdkBlob)))
                                    return "sdkBlob: buffer expected";
                            return null;
                        };
    
                        /**
                         * Creates a SearchEntryPoint message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.SearchEntryPoint} SearchEntryPoint
                         */
                        SearchEntryPoint.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.SearchEntryPoint)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.SearchEntryPoint();
                            if (object.renderedContent != null)
                                message.renderedContent = String(object.renderedContent);
                            if (object.sdkBlob != null)
                                if (typeof object.sdkBlob === "string")
                                    $util.base64.decode(object.sdkBlob, message.sdkBlob = $util.newBuffer($util.base64.length(object.sdkBlob)), 0);
                                else if (object.sdkBlob.length >= 0)
                                    message.sdkBlob = object.sdkBlob;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SearchEntryPoint message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.SearchEntryPoint} message SearchEntryPoint
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SearchEntryPoint.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.renderedContent = "";
                                if (options.bytes === String)
                                    object.sdkBlob = "";
                                else {
                                    object.sdkBlob = [];
                                    if (options.bytes !== Array)
                                        object.sdkBlob = $util.newBuffer(object.sdkBlob);
                                }
                            }
                            if (message.renderedContent != null && message.hasOwnProperty("renderedContent"))
                                object.renderedContent = message.renderedContent;
                            if (message.sdkBlob != null && message.hasOwnProperty("sdkBlob"))
                                object.sdkBlob = options.bytes === String ? $util.base64.encode(message.sdkBlob, 0, message.sdkBlob.length) : options.bytes === Array ? Array.prototype.slice.call(message.sdkBlob) : message.sdkBlob;
                            return object;
                        };
    
                        /**
                         * Converts this SearchEntryPoint to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SearchEntryPoint.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SearchEntryPoint
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.SearchEntryPoint
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SearchEntryPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SearchEntryPoint";
                        };
    
                        return SearchEntryPoint;
                    })();
    
                    v1beta.GroundingChunk = (function() {
    
                        /**
                         * Properties of a GroundingChunk.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGroundingChunk
                         * @property {google.ai.generativelanguage.v1beta.GroundingChunk.IWeb|null} [web] GroundingChunk web
                         */
    
                        /**
                         * Constructs a new GroundingChunk.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GroundingChunk.
                         * @implements IGroundingChunk
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGroundingChunk=} [properties] Properties to set
                         */
                        function GroundingChunk(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingChunk web.
                         * @member {google.ai.generativelanguage.v1beta.GroundingChunk.IWeb|null|undefined} web
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @instance
                         */
                        GroundingChunk.prototype.web = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GroundingChunk chunkType.
                         * @member {"web"|undefined} chunkType
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @instance
                         */
                        Object.defineProperty(GroundingChunk.prototype, "chunkType", {
                            get: $util.oneOfGetter($oneOfFields = ["web"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GroundingChunk instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingChunk=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GroundingChunk} GroundingChunk instance
                         */
                        GroundingChunk.create = function create(properties) {
                            return new GroundingChunk(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingChunk message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingChunk.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingChunk} message GroundingChunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingChunk.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.web != null && Object.hasOwnProperty.call(message, "web"))
                                $root.google.ai.generativelanguage.v1beta.GroundingChunk.Web.encode(message.web, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingChunk.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingChunk} message GroundingChunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingChunk.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingChunk message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GroundingChunk} GroundingChunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingChunk.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GroundingChunk();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.web = $root.google.ai.generativelanguage.v1beta.GroundingChunk.Web.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingChunk message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GroundingChunk} GroundingChunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingChunk.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingChunk message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingChunk.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.web != null && message.hasOwnProperty("web")) {
                                properties.chunkType = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.GroundingChunk.Web.verify(message.web);
                                    if (error)
                                        return "web." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingChunk message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GroundingChunk} GroundingChunk
                         */
                        GroundingChunk.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingChunk)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GroundingChunk();
                            if (object.web != null) {
                                if (typeof object.web !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingChunk.web: object expected");
                                message.web = $root.google.ai.generativelanguage.v1beta.GroundingChunk.Web.fromObject(object.web);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingChunk message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GroundingChunk} message GroundingChunk
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingChunk.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.web != null && message.hasOwnProperty("web")) {
                                object.web = $root.google.ai.generativelanguage.v1beta.GroundingChunk.Web.toObject(message.web, options);
                                if (options.oneofs)
                                    object.chunkType = "web";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GroundingChunk to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingChunk.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingChunk
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingChunk";
                        };
    
                        GroundingChunk.Web = (function() {
    
                            /**
                             * Properties of a Web.
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                             * @interface IWeb
                             * @property {string|null} [uri] Web uri
                             * @property {string|null} [title] Web title
                             */
    
                            /**
                             * Constructs a new Web.
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk
                             * @classdesc Represents a Web.
                             * @implements IWeb
                             * @constructor
                             * @param {google.ai.generativelanguage.v1beta.GroundingChunk.IWeb=} [properties] Properties to set
                             */
                            function Web(properties) {
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * Web uri.
                             * @member {string|null|undefined} uri
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @instance
                             */
                            Web.prototype.uri = null;
    
                            /**
                             * Web title.
                             * @member {string|null|undefined} title
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @instance
                             */
                            Web.prototype.title = null;
    
                            // OneOf field names bound to virtual getters and setters
                            var $oneOfFields;
    
                            /**
                             * Web _uri.
                             * @member {"uri"|undefined} _uri
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @instance
                             */
                            Object.defineProperty(Web.prototype, "_uri", {
                                get: $util.oneOfGetter($oneOfFields = ["uri"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Web _title.
                             * @member {"title"|undefined} _title
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @instance
                             */
                            Object.defineProperty(Web.prototype, "_title", {
                                get: $util.oneOfGetter($oneOfFields = ["title"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Creates a new Web instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GroundingChunk.IWeb=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1beta.GroundingChunk.Web} Web instance
                             */
                            Web.create = function create(properties) {
                                return new Web(properties);
                            };
    
                            /**
                             * Encodes the specified Web message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingChunk.Web.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GroundingChunk.IWeb} message Web message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Web.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri);
                                if (message.title != null && Object.hasOwnProperty.call(message, "title"))
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.title);
                                return writer;
                            };
    
                            /**
                             * Encodes the specified Web message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingChunk.Web.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GroundingChunk.IWeb} message Web message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            Web.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes a Web message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1beta.GroundingChunk.Web} Web
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Web.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GroundingChunk.Web();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.uri = reader.string();
                                            break;
                                        }
                                    case 2: {
                                            message.title = reader.string();
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes a Web message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1beta.GroundingChunk.Web} Web
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            Web.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies a Web message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            Web.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                var properties = {};
                                if (message.uri != null && message.hasOwnProperty("uri")) {
                                    properties._uri = 1;
                                    if (!$util.isString(message.uri))
                                        return "uri: string expected";
                                }
                                if (message.title != null && message.hasOwnProperty("title")) {
                                    properties._title = 1;
                                    if (!$util.isString(message.title))
                                        return "title: string expected";
                                }
                                return null;
                            };
    
                            /**
                             * Creates a Web message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1beta.GroundingChunk.Web} Web
                             */
                            Web.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingChunk.Web)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1beta.GroundingChunk.Web();
                                if (object.uri != null)
                                    message.uri = String(object.uri);
                                if (object.title != null)
                                    message.title = String(object.title);
                                return message;
                            };
    
                            /**
                             * Creates a plain object from a Web message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GroundingChunk.Web} message Web
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            Web.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (message.uri != null && message.hasOwnProperty("uri")) {
                                    object.uri = message.uri;
                                    if (options.oneofs)
                                        object._uri = "uri";
                                }
                                if (message.title != null && message.hasOwnProperty("title")) {
                                    object.title = message.title;
                                    if (options.oneofs)
                                        object._title = "title";
                                }
                                return object;
                            };
    
                            /**
                             * Converts this Web to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            Web.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for Web
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1beta.GroundingChunk.Web
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            Web.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingChunk.Web";
                            };
    
                            return Web;
                        })();
    
                        return GroundingChunk;
                    })();
    
                    v1beta.Segment = (function() {
    
                        /**
                         * Properties of a Segment.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ISegment
                         * @property {number|null} [partIndex] Segment partIndex
                         * @property {number|null} [startIndex] Segment startIndex
                         * @property {number|null} [endIndex] Segment endIndex
                         * @property {string|null} [text] Segment text
                         */
    
                        /**
                         * Constructs a new Segment.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Segment.
                         * @implements ISegment
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ISegment=} [properties] Properties to set
                         */
                        function Segment(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Segment partIndex.
                         * @member {number} partIndex
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @instance
                         */
                        Segment.prototype.partIndex = 0;
    
                        /**
                         * Segment startIndex.
                         * @member {number} startIndex
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @instance
                         */
                        Segment.prototype.startIndex = 0;
    
                        /**
                         * Segment endIndex.
                         * @member {number} endIndex
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @instance
                         */
                        Segment.prototype.endIndex = 0;
    
                        /**
                         * Segment text.
                         * @member {string} text
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @instance
                         */
                        Segment.prototype.text = "";
    
                        /**
                         * Creates a new Segment instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISegment=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Segment} Segment instance
                         */
                        Segment.create = function create(properties) {
                            return new Segment(properties);
                        };
    
                        /**
                         * Encodes the specified Segment message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Segment.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISegment} message Segment message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Segment.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.partIndex != null && Object.hasOwnProperty.call(message, "partIndex"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.partIndex);
                            if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.startIndex);
                            if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.endIndex);
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Segment message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Segment.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ISegment} message Segment message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Segment.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Segment message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Segment} Segment
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Segment.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Segment();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.partIndex = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.startIndex = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.endIndex = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Segment message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Segment} Segment
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Segment.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Segment message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Segment.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.partIndex != null && message.hasOwnProperty("partIndex"))
                                if (!$util.isInteger(message.partIndex))
                                    return "partIndex: integer expected";
                            if (message.startIndex != null && message.hasOwnProperty("startIndex"))
                                if (!$util.isInteger(message.startIndex))
                                    return "startIndex: integer expected";
                            if (message.endIndex != null && message.hasOwnProperty("endIndex"))
                                if (!$util.isInteger(message.endIndex))
                                    return "endIndex: integer expected";
                            if (message.text != null && message.hasOwnProperty("text"))
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a Segment message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Segment} Segment
                         */
                        Segment.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Segment)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Segment();
                            if (object.partIndex != null)
                                message.partIndex = object.partIndex | 0;
                            if (object.startIndex != null)
                                message.startIndex = object.startIndex | 0;
                            if (object.endIndex != null)
                                message.endIndex = object.endIndex | 0;
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Segment message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Segment} message Segment
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Segment.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.partIndex = 0;
                                object.startIndex = 0;
                                object.endIndex = 0;
                                object.text = "";
                            }
                            if (message.partIndex != null && message.hasOwnProperty("partIndex"))
                                object.partIndex = message.partIndex;
                            if (message.startIndex != null && message.hasOwnProperty("startIndex"))
                                object.startIndex = message.startIndex;
                            if (message.endIndex != null && message.hasOwnProperty("endIndex"))
                                object.endIndex = message.endIndex;
                            if (message.text != null && message.hasOwnProperty("text"))
                                object.text = message.text;
                            return object;
                        };
    
                        /**
                         * Converts this Segment to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Segment.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Segment
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Segment
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Segment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Segment";
                        };
    
                        return Segment;
                    })();
    
                    v1beta.GroundingSupport = (function() {
    
                        /**
                         * Properties of a GroundingSupport.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGroundingSupport
                         * @property {google.ai.generativelanguage.v1beta.ISegment|null} [segment] GroundingSupport segment
                         * @property {Array.<number>|null} [groundingChunkIndices] GroundingSupport groundingChunkIndices
                         * @property {Array.<number>|null} [confidenceScores] GroundingSupport confidenceScores
                         */
    
                        /**
                         * Constructs a new GroundingSupport.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GroundingSupport.
                         * @implements IGroundingSupport
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGroundingSupport=} [properties] Properties to set
                         */
                        function GroundingSupport(properties) {
                            this.groundingChunkIndices = [];
                            this.confidenceScores = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GroundingSupport segment.
                         * @member {google.ai.generativelanguage.v1beta.ISegment|null|undefined} segment
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @instance
                         */
                        GroundingSupport.prototype.segment = null;
    
                        /**
                         * GroundingSupport groundingChunkIndices.
                         * @member {Array.<number>} groundingChunkIndices
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @instance
                         */
                        GroundingSupport.prototype.groundingChunkIndices = $util.emptyArray;
    
                        /**
                         * GroundingSupport confidenceScores.
                         * @member {Array.<number>} confidenceScores
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @instance
                         */
                        GroundingSupport.prototype.confidenceScores = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GroundingSupport _segment.
                         * @member {"segment"|undefined} _segment
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @instance
                         */
                        Object.defineProperty(GroundingSupport.prototype, "_segment", {
                            get: $util.oneOfGetter($oneOfFields = ["segment"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GroundingSupport instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingSupport=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GroundingSupport} GroundingSupport instance
                         */
                        GroundingSupport.create = function create(properties) {
                            return new GroundingSupport(properties);
                        };
    
                        /**
                         * Encodes the specified GroundingSupport message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingSupport.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingSupport} message GroundingSupport message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingSupport.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.segment != null && Object.hasOwnProperty.call(message, "segment"))
                                $root.google.ai.generativelanguage.v1beta.Segment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.groundingChunkIndices != null && message.groundingChunkIndices.length) {
                                writer.uint32(/* id 2, wireType 2 =*/18).fork();
                                for (var i = 0; i < message.groundingChunkIndices.length; ++i)
                                    writer.int32(message.groundingChunkIndices[i]);
                                writer.ldelim();
                            }
                            if (message.confidenceScores != null && message.confidenceScores.length) {
                                writer.uint32(/* id 3, wireType 2 =*/26).fork();
                                for (var i = 0; i < message.confidenceScores.length; ++i)
                                    writer.float(message.confidenceScores[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GroundingSupport message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingSupport.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGroundingSupport} message GroundingSupport message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GroundingSupport.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GroundingSupport message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GroundingSupport} GroundingSupport
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingSupport.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GroundingSupport();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.segment = $root.google.ai.generativelanguage.v1beta.Segment.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        if (!(message.groundingChunkIndices && message.groundingChunkIndices.length))
                                            message.groundingChunkIndices = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.groundingChunkIndices.push(reader.int32());
                                        } else
                                            message.groundingChunkIndices.push(reader.int32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.confidenceScores && message.confidenceScores.length))
                                            message.confidenceScores = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.confidenceScores.push(reader.float());
                                        } else
                                            message.confidenceScores.push(reader.float());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GroundingSupport message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GroundingSupport} GroundingSupport
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GroundingSupport.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GroundingSupport message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GroundingSupport.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.segment != null && message.hasOwnProperty("segment")) {
                                properties._segment = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.Segment.verify(message.segment);
                                    if (error)
                                        return "segment." + error;
                                }
                            }
                            if (message.groundingChunkIndices != null && message.hasOwnProperty("groundingChunkIndices")) {
                                if (!Array.isArray(message.groundingChunkIndices))
                                    return "groundingChunkIndices: array expected";
                                for (var i = 0; i < message.groundingChunkIndices.length; ++i)
                                    if (!$util.isInteger(message.groundingChunkIndices[i]))
                                        return "groundingChunkIndices: integer[] expected";
                            }
                            if (message.confidenceScores != null && message.hasOwnProperty("confidenceScores")) {
                                if (!Array.isArray(message.confidenceScores))
                                    return "confidenceScores: array expected";
                                for (var i = 0; i < message.confidenceScores.length; ++i)
                                    if (typeof message.confidenceScores[i] !== "number")
                                        return "confidenceScores: number[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GroundingSupport message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GroundingSupport} GroundingSupport
                         */
                        GroundingSupport.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingSupport)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GroundingSupport();
                            if (object.segment != null) {
                                if (typeof object.segment !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingSupport.segment: object expected");
                                message.segment = $root.google.ai.generativelanguage.v1beta.Segment.fromObject(object.segment);
                            }
                            if (object.groundingChunkIndices) {
                                if (!Array.isArray(object.groundingChunkIndices))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingSupport.groundingChunkIndices: array expected");
                                message.groundingChunkIndices = [];
                                for (var i = 0; i < object.groundingChunkIndices.length; ++i)
                                    message.groundingChunkIndices[i] = object.groundingChunkIndices[i] | 0;
                            }
                            if (object.confidenceScores) {
                                if (!Array.isArray(object.confidenceScores))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GroundingSupport.confidenceScores: array expected");
                                message.confidenceScores = [];
                                for (var i = 0; i < object.confidenceScores.length; ++i)
                                    message.confidenceScores[i] = Number(object.confidenceScores[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GroundingSupport message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GroundingSupport} message GroundingSupport
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GroundingSupport.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.groundingChunkIndices = [];
                                object.confidenceScores = [];
                            }
                            if (message.segment != null && message.hasOwnProperty("segment")) {
                                object.segment = $root.google.ai.generativelanguage.v1beta.Segment.toObject(message.segment, options);
                                if (options.oneofs)
                                    object._segment = "segment";
                            }
                            if (message.groundingChunkIndices && message.groundingChunkIndices.length) {
                                object.groundingChunkIndices = [];
                                for (var j = 0; j < message.groundingChunkIndices.length; ++j)
                                    object.groundingChunkIndices[j] = message.groundingChunkIndices[j];
                            }
                            if (message.confidenceScores && message.confidenceScores.length) {
                                object.confidenceScores = [];
                                for (var j = 0; j < message.confidenceScores.length; ++j)
                                    object.confidenceScores[j] = options.json && !isFinite(message.confidenceScores[j]) ? String(message.confidenceScores[j]) : message.confidenceScores[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GroundingSupport to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GroundingSupport.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GroundingSupport
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GroundingSupport
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GroundingSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingSupport";
                        };
    
                        return GroundingSupport;
                    })();
    
                    v1beta.GenerateAnswerRequest = (function() {
    
                        /**
                         * Properties of a GenerateAnswerRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGenerateAnswerRequest
                         * @property {google.ai.generativelanguage.v1beta.IGroundingPassages|null} [inlinePassages] GenerateAnswerRequest inlinePassages
                         * @property {google.ai.generativelanguage.v1beta.ISemanticRetrieverConfig|null} [semanticRetriever] GenerateAnswerRequest semanticRetriever
                         * @property {string|null} [model] GenerateAnswerRequest model
                         * @property {Array.<google.ai.generativelanguage.v1beta.IContent>|null} [contents] GenerateAnswerRequest contents
                         * @property {google.ai.generativelanguage.v1beta.GenerateAnswerRequest.AnswerStyle|null} [answerStyle] GenerateAnswerRequest answerStyle
                         * @property {Array.<google.ai.generativelanguage.v1beta.ISafetySetting>|null} [safetySettings] GenerateAnswerRequest safetySettings
                         * @property {number|null} [temperature] GenerateAnswerRequest temperature
                         */
    
                        /**
                         * Constructs a new GenerateAnswerRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GenerateAnswerRequest.
                         * @implements IGenerateAnswerRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerRequest=} [properties] Properties to set
                         */
                        function GenerateAnswerRequest(properties) {
                            this.contents = [];
                            this.safetySettings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateAnswerRequest inlinePassages.
                         * @member {google.ai.generativelanguage.v1beta.IGroundingPassages|null|undefined} inlinePassages
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.inlinePassages = null;
    
                        /**
                         * GenerateAnswerRequest semanticRetriever.
                         * @member {google.ai.generativelanguage.v1beta.ISemanticRetrieverConfig|null|undefined} semanticRetriever
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.semanticRetriever = null;
    
                        /**
                         * GenerateAnswerRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.model = "";
    
                        /**
                         * GenerateAnswerRequest contents.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IContent>} contents
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.contents = $util.emptyArray;
    
                        /**
                         * GenerateAnswerRequest answerStyle.
                         * @member {google.ai.generativelanguage.v1beta.GenerateAnswerRequest.AnswerStyle} answerStyle
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.answerStyle = 0;
    
                        /**
                         * GenerateAnswerRequest safetySettings.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ISafetySetting>} safetySettings
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.safetySettings = $util.emptyArray;
    
                        /**
                         * GenerateAnswerRequest temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @instance
                         */
                        GenerateAnswerRequest.prototype.temperature = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateAnswerRequest groundingSource.
                         * @member {"inlinePassages"|"semanticRetriever"|undefined} groundingSource
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateAnswerRequest.prototype, "groundingSource", {
                            get: $util.oneOfGetter($oneOfFields = ["inlinePassages", "semanticRetriever"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateAnswerRequest _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateAnswerRequest.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateAnswerRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerRequest} GenerateAnswerRequest instance
                         */
                        GenerateAnswerRequest.create = function create(properties) {
                            return new GenerateAnswerRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateAnswerRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateAnswerRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerRequest} message GenerateAnswerRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateAnswerRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.contents != null && message.contents.length)
                                for (var i = 0; i < message.contents.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.safetySettings != null && message.safetySettings.length)
                                for (var i = 0; i < message.safetySettings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 4, wireType 5 =*/37).float(message.temperature);
                            if (message.answerStyle != null && Object.hasOwnProperty.call(message, "answerStyle"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.answerStyle);
                            if (message.inlinePassages != null && Object.hasOwnProperty.call(message, "inlinePassages"))
                                $root.google.ai.generativelanguage.v1beta.GroundingPassages.encode(message.inlinePassages, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.semanticRetriever != null && Object.hasOwnProperty.call(message, "semanticRetriever"))
                                $root.google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.encode(message.semanticRetriever, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateAnswerRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateAnswerRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerRequest} message GenerateAnswerRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateAnswerRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateAnswerRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerRequest} GenerateAnswerRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateAnswerRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateAnswerRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 6: {
                                        message.inlinePassages = $root.google.ai.generativelanguage.v1beta.GroundingPassages.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 7: {
                                        message.semanticRetriever = $root.google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.contents && message.contents.length))
                                            message.contents = [];
                                        message.contents.push($root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 5: {
                                        message.answerStyle = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        if (!(message.safetySettings && message.safetySettings.length))
                                            message.safetySettings = [];
                                        message.safetySettings.push($root.google.ai.generativelanguage.v1beta.SafetySetting.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateAnswerRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerRequest} GenerateAnswerRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateAnswerRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateAnswerRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateAnswerRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.inlinePassages != null && message.hasOwnProperty("inlinePassages")) {
                                properties.groundingSource = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.GroundingPassages.verify(message.inlinePassages);
                                    if (error)
                                        return "inlinePassages." + error;
                                }
                            }
                            if (message.semanticRetriever != null && message.hasOwnProperty("semanticRetriever")) {
                                if (properties.groundingSource === 1)
                                    return "groundingSource: multiple values";
                                properties.groundingSource = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.verify(message.semanticRetriever);
                                    if (error)
                                        return "semanticRetriever." + error;
                                }
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.contents != null && message.hasOwnProperty("contents")) {
                                if (!Array.isArray(message.contents))
                                    return "contents: array expected";
                                for (var i = 0; i < message.contents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.contents[i]);
                                    if (error)
                                        return "contents." + error;
                                }
                            }
                            if (message.answerStyle != null && message.hasOwnProperty("answerStyle"))
                                switch (message.answerStyle) {
                                default:
                                    return "answerStyle: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) {
                                if (!Array.isArray(message.safetySettings))
                                    return "safetySettings: array expected";
                                for (var i = 0; i < message.safetySettings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.SafetySetting.verify(message.safetySettings[i]);
                                    if (error)
                                        return "safetySettings." + error;
                                }
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateAnswerRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerRequest} GenerateAnswerRequest
                         */
                        GenerateAnswerRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateAnswerRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GenerateAnswerRequest();
                            if (object.inlinePassages != null) {
                                if (typeof object.inlinePassages !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateAnswerRequest.inlinePassages: object expected");
                                message.inlinePassages = $root.google.ai.generativelanguage.v1beta.GroundingPassages.fromObject(object.inlinePassages);
                            }
                            if (object.semanticRetriever != null) {
                                if (typeof object.semanticRetriever !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateAnswerRequest.semanticRetriever: object expected");
                                message.semanticRetriever = $root.google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.fromObject(object.semanticRetriever);
                            }
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.contents) {
                                if (!Array.isArray(object.contents))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateAnswerRequest.contents: array expected");
                                message.contents = [];
                                for (var i = 0; i < object.contents.length; ++i) {
                                    if (typeof object.contents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateAnswerRequest.contents: object expected");
                                    message.contents[i] = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.contents[i]);
                                }
                            }
                            switch (object.answerStyle) {
                            default:
                                if (typeof object.answerStyle === "number") {
                                    message.answerStyle = object.answerStyle;
                                    break;
                                }
                                break;
                            case "ANSWER_STYLE_UNSPECIFIED":
                            case 0:
                                message.answerStyle = 0;
                                break;
                            case "ABSTRACTIVE":
                            case 1:
                                message.answerStyle = 1;
                                break;
                            case "EXTRACTIVE":
                            case 2:
                                message.answerStyle = 2;
                                break;
                            case "VERBOSE":
                            case 3:
                                message.answerStyle = 3;
                                break;
                            }
                            if (object.safetySettings) {
                                if (!Array.isArray(object.safetySettings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateAnswerRequest.safetySettings: array expected");
                                message.safetySettings = [];
                                for (var i = 0; i < object.safetySettings.length; ++i) {
                                    if (typeof object.safetySettings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateAnswerRequest.safetySettings: object expected");
                                    message.safetySettings[i] = $root.google.ai.generativelanguage.v1beta.SafetySetting.fromObject(object.safetySettings[i]);
                                }
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateAnswerRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GenerateAnswerRequest} message GenerateAnswerRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateAnswerRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.contents = [];
                                object.safetySettings = [];
                            }
                            if (options.defaults) {
                                object.model = "";
                                object.answerStyle = options.enums === String ? "ANSWER_STYLE_UNSPECIFIED" : 0;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.contents && message.contents.length) {
                                object.contents = [];
                                for (var j = 0; j < message.contents.length; ++j)
                                    object.contents[j] = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.contents[j], options);
                            }
                            if (message.safetySettings && message.safetySettings.length) {
                                object.safetySettings = [];
                                for (var j = 0; j < message.safetySettings.length; ++j)
                                    object.safetySettings[j] = $root.google.ai.generativelanguage.v1beta.SafetySetting.toObject(message.safetySettings[j], options);
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.answerStyle != null && message.hasOwnProperty("answerStyle"))
                                object.answerStyle = options.enums === String ? $root.google.ai.generativelanguage.v1beta.GenerateAnswerRequest.AnswerStyle[message.answerStyle] === undefined ? message.answerStyle : $root.google.ai.generativelanguage.v1beta.GenerateAnswerRequest.AnswerStyle[message.answerStyle] : message.answerStyle;
                            if (message.inlinePassages != null && message.hasOwnProperty("inlinePassages")) {
                                object.inlinePassages = $root.google.ai.generativelanguage.v1beta.GroundingPassages.toObject(message.inlinePassages, options);
                                if (options.oneofs)
                                    object.groundingSource = "inlinePassages";
                            }
                            if (message.semanticRetriever != null && message.hasOwnProperty("semanticRetriever")) {
                                object.semanticRetriever = $root.google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.toObject(message.semanticRetriever, options);
                                if (options.oneofs)
                                    object.groundingSource = "semanticRetriever";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateAnswerRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateAnswerRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateAnswerRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateAnswerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateAnswerRequest";
                        };
    
                        /**
                         * AnswerStyle enum.
                         * @name google.ai.generativelanguage.v1beta.GenerateAnswerRequest.AnswerStyle
                         * @enum {number}
                         * @property {number} ANSWER_STYLE_UNSPECIFIED=0 ANSWER_STYLE_UNSPECIFIED value
                         * @property {number} ABSTRACTIVE=1 ABSTRACTIVE value
                         * @property {number} EXTRACTIVE=2 EXTRACTIVE value
                         * @property {number} VERBOSE=3 VERBOSE value
                         */
                        GenerateAnswerRequest.AnswerStyle = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "ANSWER_STYLE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "ABSTRACTIVE"] = 1;
                            values[valuesById[2] = "EXTRACTIVE"] = 2;
                            values[valuesById[3] = "VERBOSE"] = 3;
                            return values;
                        })();
    
                        return GenerateAnswerRequest;
                    })();
    
                    v1beta.GenerateAnswerResponse = (function() {
    
                        /**
                         * Properties of a GenerateAnswerResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGenerateAnswerResponse
                         * @property {google.ai.generativelanguage.v1beta.ICandidate|null} [answer] GenerateAnswerResponse answer
                         * @property {number|null} [answerableProbability] GenerateAnswerResponse answerableProbability
                         * @property {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.IInputFeedback|null} [inputFeedback] GenerateAnswerResponse inputFeedback
                         */
    
                        /**
                         * Constructs a new GenerateAnswerResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GenerateAnswerResponse.
                         * @implements IGenerateAnswerResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerResponse=} [properties] Properties to set
                         */
                        function GenerateAnswerResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateAnswerResponse answer.
                         * @member {google.ai.generativelanguage.v1beta.ICandidate|null|undefined} answer
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @instance
                         */
                        GenerateAnswerResponse.prototype.answer = null;
    
                        /**
                         * GenerateAnswerResponse answerableProbability.
                         * @member {number|null|undefined} answerableProbability
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @instance
                         */
                        GenerateAnswerResponse.prototype.answerableProbability = null;
    
                        /**
                         * GenerateAnswerResponse inputFeedback.
                         * @member {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.IInputFeedback|null|undefined} inputFeedback
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @instance
                         */
                        GenerateAnswerResponse.prototype.inputFeedback = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateAnswerResponse _answerableProbability.
                         * @member {"answerableProbability"|undefined} _answerableProbability
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @instance
                         */
                        Object.defineProperty(GenerateAnswerResponse.prototype, "_answerableProbability", {
                            get: $util.oneOfGetter($oneOfFields = ["answerableProbability"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateAnswerResponse _inputFeedback.
                         * @member {"inputFeedback"|undefined} _inputFeedback
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @instance
                         */
                        Object.defineProperty(GenerateAnswerResponse.prototype, "_inputFeedback", {
                            get: $util.oneOfGetter($oneOfFields = ["inputFeedback"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateAnswerResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerResponse} GenerateAnswerResponse instance
                         */
                        GenerateAnswerResponse.create = function create(properties) {
                            return new GenerateAnswerResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateAnswerResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateAnswerResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerResponse} message GenerateAnswerResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateAnswerResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.answer != null && Object.hasOwnProperty.call(message, "answer"))
                                $root.google.ai.generativelanguage.v1beta.Candidate.encode(message.answer, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.answerableProbability != null && Object.hasOwnProperty.call(message, "answerableProbability"))
                                writer.uint32(/* id 2, wireType 5 =*/21).float(message.answerableProbability);
                            if (message.inputFeedback != null && Object.hasOwnProperty.call(message, "inputFeedback"))
                                $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.encode(message.inputFeedback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateAnswerResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateAnswerResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerResponse} message GenerateAnswerResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateAnswerResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateAnswerResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerResponse} GenerateAnswerResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateAnswerResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.answer = $root.google.ai.generativelanguage.v1beta.Candidate.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.answerableProbability = reader.float();
                                        break;
                                    }
                                case 3: {
                                        message.inputFeedback = $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateAnswerResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerResponse} GenerateAnswerResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateAnswerResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateAnswerResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateAnswerResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.answer != null && message.hasOwnProperty("answer")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Candidate.verify(message.answer);
                                if (error)
                                    return "answer." + error;
                            }
                            if (message.answerableProbability != null && message.hasOwnProperty("answerableProbability")) {
                                properties._answerableProbability = 1;
                                if (typeof message.answerableProbability !== "number")
                                    return "answerableProbability: number expected";
                            }
                            if (message.inputFeedback != null && message.hasOwnProperty("inputFeedback")) {
                                properties._inputFeedback = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.verify(message.inputFeedback);
                                    if (error)
                                        return "inputFeedback." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateAnswerResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerResponse} GenerateAnswerResponse
                         */
                        GenerateAnswerResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse();
                            if (object.answer != null) {
                                if (typeof object.answer !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateAnswerResponse.answer: object expected");
                                message.answer = $root.google.ai.generativelanguage.v1beta.Candidate.fromObject(object.answer);
                            }
                            if (object.answerableProbability != null)
                                message.answerableProbability = Number(object.answerableProbability);
                            if (object.inputFeedback != null) {
                                if (typeof object.inputFeedback !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateAnswerResponse.inputFeedback: object expected");
                                message.inputFeedback = $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.fromObject(object.inputFeedback);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateAnswerResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GenerateAnswerResponse} message GenerateAnswerResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateAnswerResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.answer = null;
                            if (message.answer != null && message.hasOwnProperty("answer"))
                                object.answer = $root.google.ai.generativelanguage.v1beta.Candidate.toObject(message.answer, options);
                            if (message.answerableProbability != null && message.hasOwnProperty("answerableProbability")) {
                                object.answerableProbability = options.json && !isFinite(message.answerableProbability) ? String(message.answerableProbability) : message.answerableProbability;
                                if (options.oneofs)
                                    object._answerableProbability = "answerableProbability";
                            }
                            if (message.inputFeedback != null && message.hasOwnProperty("inputFeedback")) {
                                object.inputFeedback = $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.toObject(message.inputFeedback, options);
                                if (options.oneofs)
                                    object._inputFeedback = "inputFeedback";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateAnswerResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateAnswerResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateAnswerResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateAnswerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateAnswerResponse";
                        };
    
                        GenerateAnswerResponse.InputFeedback = (function() {
    
                            /**
                             * Properties of an InputFeedback.
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                             * @interface IInputFeedback
                             * @property {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.BlockReason|null} [blockReason] InputFeedback blockReason
                             * @property {Array.<google.ai.generativelanguage.v1beta.ISafetyRating>|null} [safetyRatings] InputFeedback safetyRatings
                             */
    
                            /**
                             * Constructs a new InputFeedback.
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse
                             * @classdesc Represents an InputFeedback.
                             * @implements IInputFeedback
                             * @constructor
                             * @param {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.IInputFeedback=} [properties] Properties to set
                             */
                            function InputFeedback(properties) {
                                this.safetyRatings = [];
                                if (properties)
                                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                        if (properties[keys[i]] != null)
                                            this[keys[i]] = properties[keys[i]];
                            }
    
                            /**
                             * InputFeedback blockReason.
                             * @member {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.BlockReason|null|undefined} blockReason
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @instance
                             */
                            InputFeedback.prototype.blockReason = null;
    
                            /**
                             * InputFeedback safetyRatings.
                             * @member {Array.<google.ai.generativelanguage.v1beta.ISafetyRating>} safetyRatings
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @instance
                             */
                            InputFeedback.prototype.safetyRatings = $util.emptyArray;
    
                            // OneOf field names bound to virtual getters and setters
                            var $oneOfFields;
    
                            /**
                             * InputFeedback _blockReason.
                             * @member {"blockReason"|undefined} _blockReason
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @instance
                             */
                            Object.defineProperty(InputFeedback.prototype, "_blockReason", {
                                get: $util.oneOfGetter($oneOfFields = ["blockReason"]),
                                set: $util.oneOfSetter($oneOfFields)
                            });
    
                            /**
                             * Creates a new InputFeedback instance using the specified properties.
                             * @function create
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.IInputFeedback=} [properties] Properties to set
                             * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback} InputFeedback instance
                             */
                            InputFeedback.create = function create(properties) {
                                return new InputFeedback(properties);
                            };
    
                            /**
                             * Encodes the specified InputFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.verify|verify} messages.
                             * @function encode
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.IInputFeedback} message InputFeedback message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            InputFeedback.encode = function encode(message, writer) {
                                if (!writer)
                                    writer = $Writer.create();
                                if (message.blockReason != null && Object.hasOwnProperty.call(message, "blockReason"))
                                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.blockReason);
                                if (message.safetyRatings != null && message.safetyRatings.length)
                                    for (var i = 0; i < message.safetyRatings.length; ++i)
                                        $root.google.ai.generativelanguage.v1beta.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                                return writer;
                            };
    
                            /**
                             * Encodes the specified InputFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.verify|verify} messages.
                             * @function encodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.IInputFeedback} message InputFeedback message or plain object to encode
                             * @param {$protobuf.Writer} [writer] Writer to encode to
                             * @returns {$protobuf.Writer} Writer
                             */
                            InputFeedback.encodeDelimited = function encodeDelimited(message, writer) {
                                return this.encode(message, writer).ldelim();
                            };
    
                            /**
                             * Decodes an InputFeedback message from the specified reader or buffer.
                             * @function decode
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @param {number} [length] Message length if known beforehand
                             * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback} InputFeedback
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            InputFeedback.decode = function decode(reader, length) {
                                if (!(reader instanceof $Reader))
                                    reader = $Reader.create(reader);
                                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback();
                                while (reader.pos < end) {
                                    var tag = reader.uint32();
                                    switch (tag >>> 3) {
                                    case 1: {
                                            message.blockReason = reader.int32();
                                            break;
                                        }
                                    case 2: {
                                            if (!(message.safetyRatings && message.safetyRatings.length))
                                                message.safetyRatings = [];
                                            message.safetyRatings.push($root.google.ai.generativelanguage.v1beta.SafetyRating.decode(reader, reader.uint32()));
                                            break;
                                        }
                                    default:
                                        reader.skipType(tag & 7);
                                        break;
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Decodes an InputFeedback message from the specified reader or buffer, length delimited.
                             * @function decodeDelimited
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                             * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback} InputFeedback
                             * @throws {Error} If the payload is not a reader or valid buffer
                             * @throws {$protobuf.util.ProtocolError} If required fields are missing
                             */
                            InputFeedback.decodeDelimited = function decodeDelimited(reader) {
                                if (!(reader instanceof $Reader))
                                    reader = new $Reader(reader);
                                return this.decode(reader, reader.uint32());
                            };
    
                            /**
                             * Verifies an InputFeedback message.
                             * @function verify
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {Object.<string,*>} message Plain object to verify
                             * @returns {string|null} `null` if valid, otherwise the reason why it is not
                             */
                            InputFeedback.verify = function verify(message) {
                                if (typeof message !== "object" || message === null)
                                    return "object expected";
                                var properties = {};
                                if (message.blockReason != null && message.hasOwnProperty("blockReason")) {
                                    properties._blockReason = 1;
                                    switch (message.blockReason) {
                                    default:
                                        return "blockReason: enum value expected";
                                    case 0:
                                    case 1:
                                    case 2:
                                        break;
                                    }
                                }
                                if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                    if (!Array.isArray(message.safetyRatings))
                                        return "safetyRatings: array expected";
                                    for (var i = 0; i < message.safetyRatings.length; ++i) {
                                        var error = $root.google.ai.generativelanguage.v1beta.SafetyRating.verify(message.safetyRatings[i]);
                                        if (error)
                                            return "safetyRatings." + error;
                                    }
                                }
                                return null;
                            };
    
                            /**
                             * Creates an InputFeedback message from a plain object. Also converts values to their respective internal types.
                             * @function fromObject
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {Object.<string,*>} object Plain object
                             * @returns {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback} InputFeedback
                             */
                            InputFeedback.fromObject = function fromObject(object) {
                                if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback)
                                    return object;
                                var message = new $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback();
                                switch (object.blockReason) {
                                default:
                                    if (typeof object.blockReason === "number") {
                                        message.blockReason = object.blockReason;
                                        break;
                                    }
                                    break;
                                case "BLOCK_REASON_UNSPECIFIED":
                                case 0:
                                    message.blockReason = 0;
                                    break;
                                case "SAFETY":
                                case 1:
                                    message.blockReason = 1;
                                    break;
                                case "OTHER":
                                case 2:
                                    message.blockReason = 2;
                                    break;
                                }
                                if (object.safetyRatings) {
                                    if (!Array.isArray(object.safetyRatings))
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.safetyRatings: array expected");
                                    message.safetyRatings = [];
                                    for (var i = 0; i < object.safetyRatings.length; ++i) {
                                        if (typeof object.safetyRatings[i] !== "object")
                                            throw TypeError(".google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.safetyRatings: object expected");
                                        message.safetyRatings[i] = $root.google.ai.generativelanguage.v1beta.SafetyRating.fromObject(object.safetyRatings[i]);
                                    }
                                }
                                return message;
                            };
    
                            /**
                             * Creates a plain object from an InputFeedback message. Also converts values to other types if specified.
                             * @function toObject
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback} message InputFeedback
                             * @param {$protobuf.IConversionOptions} [options] Conversion options
                             * @returns {Object.<string,*>} Plain object
                             */
                            InputFeedback.toObject = function toObject(message, options) {
                                if (!options)
                                    options = {};
                                var object = {};
                                if (options.arrays || options.defaults)
                                    object.safetyRatings = [];
                                if (message.blockReason != null && message.hasOwnProperty("blockReason")) {
                                    object.blockReason = options.enums === String ? $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.BlockReason[message.blockReason] === undefined ? message.blockReason : $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.BlockReason[message.blockReason] : message.blockReason;
                                    if (options.oneofs)
                                        object._blockReason = "blockReason";
                                }
                                if (message.safetyRatings && message.safetyRatings.length) {
                                    object.safetyRatings = [];
                                    for (var j = 0; j < message.safetyRatings.length; ++j)
                                        object.safetyRatings[j] = $root.google.ai.generativelanguage.v1beta.SafetyRating.toObject(message.safetyRatings[j], options);
                                }
                                return object;
                            };
    
                            /**
                             * Converts this InputFeedback to JSON.
                             * @function toJSON
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @instance
                             * @returns {Object.<string,*>} JSON object
                             */
                            InputFeedback.prototype.toJSON = function toJSON() {
                                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                            };
    
                            /**
                             * Gets the default type url for InputFeedback
                             * @function getTypeUrl
                             * @memberof google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
                             * @static
                             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                             * @returns {string} The default type url
                             */
                            InputFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                                if (typeUrlPrefix === undefined) {
                                    typeUrlPrefix = "type.googleapis.com";
                                }
                                return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback";
                            };
    
                            /**
                             * BlockReason enum.
                             * @name google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.BlockReason
                             * @enum {number}
                             * @property {number} BLOCK_REASON_UNSPECIFIED=0 BLOCK_REASON_UNSPECIFIED value
                             * @property {number} SAFETY=1 SAFETY value
                             * @property {number} OTHER=2 OTHER value
                             */
                            InputFeedback.BlockReason = (function() {
                                var valuesById = {}, values = Object.create(valuesById);
                                values[valuesById[0] = "BLOCK_REASON_UNSPECIFIED"] = 0;
                                values[valuesById[1] = "SAFETY"] = 1;
                                values[valuesById[2] = "OTHER"] = 2;
                                return values;
                            })();
    
                            return InputFeedback;
                        })();
    
                        return GenerateAnswerResponse;
                    })();
    
                    v1beta.EmbedContentRequest = (function() {
    
                        /**
                         * Properties of an EmbedContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IEmbedContentRequest
                         * @property {string|null} [model] EmbedContentRequest model
                         * @property {google.ai.generativelanguage.v1beta.IContent|null} [content] EmbedContentRequest content
                         * @property {google.ai.generativelanguage.v1beta.TaskType|null} [taskType] EmbedContentRequest taskType
                         * @property {string|null} [title] EmbedContentRequest title
                         * @property {number|null} [outputDimensionality] EmbedContentRequest outputDimensionality
                         */
    
                        /**
                         * Constructs a new EmbedContentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an EmbedContentRequest.
                         * @implements IEmbedContentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IEmbedContentRequest=} [properties] Properties to set
                         */
                        function EmbedContentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedContentRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.model = "";
    
                        /**
                         * EmbedContentRequest content.
                         * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} content
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.content = null;
    
                        /**
                         * EmbedContentRequest taskType.
                         * @member {google.ai.generativelanguage.v1beta.TaskType|null|undefined} taskType
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.taskType = null;
    
                        /**
                         * EmbedContentRequest title.
                         * @member {string|null|undefined} title
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.title = null;
    
                        /**
                         * EmbedContentRequest outputDimensionality.
                         * @member {number|null|undefined} outputDimensionality
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @instance
                         */
                        EmbedContentRequest.prototype.outputDimensionality = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * EmbedContentRequest _taskType.
                         * @member {"taskType"|undefined} _taskType
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @instance
                         */
                        Object.defineProperty(EmbedContentRequest.prototype, "_taskType", {
                            get: $util.oneOfGetter($oneOfFields = ["taskType"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * EmbedContentRequest _title.
                         * @member {"title"|undefined} _title
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @instance
                         */
                        Object.defineProperty(EmbedContentRequest.prototype, "_title", {
                            get: $util.oneOfGetter($oneOfFields = ["title"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * EmbedContentRequest _outputDimensionality.
                         * @member {"outputDimensionality"|undefined} _outputDimensionality
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @instance
                         */
                        Object.defineProperty(EmbedContentRequest.prototype, "_outputDimensionality", {
                            get: $util.oneOfGetter($oneOfFields = ["outputDimensionality"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new EmbedContentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedContentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.EmbedContentRequest} EmbedContentRequest instance
                         */
                        EmbedContentRequest.create = function create(properties) {
                            return new EmbedContentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.EmbedContentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedContentRequest} message EmbedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                $root.google.ai.generativelanguage.v1beta.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.taskType != null && Object.hasOwnProperty.call(message, "taskType"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.taskType);
                            if (message.title != null && Object.hasOwnProperty.call(message, "title"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.title);
                            if (message.outputDimensionality != null && Object.hasOwnProperty.call(message, "outputDimensionality"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.outputDimensionality);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.EmbedContentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedContentRequest} message EmbedContentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedContentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.EmbedContentRequest} EmbedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.EmbedContentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.content = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.taskType = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.title = reader.string();
                                        break;
                                    }
                                case 5: {
                                        message.outputDimensionality = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedContentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.EmbedContentRequest} EmbedContentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedContentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedContentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.content != null && message.hasOwnProperty("content")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.content);
                                if (error)
                                    return "content." + error;
                            }
                            if (message.taskType != null && message.hasOwnProperty("taskType")) {
                                properties._taskType = 1;
                                switch (message.taskType) {
                                default:
                                    return "taskType: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                    break;
                                }
                            }
                            if (message.title != null && message.hasOwnProperty("title")) {
                                properties._title = 1;
                                if (!$util.isString(message.title))
                                    return "title: string expected";
                            }
                            if (message.outputDimensionality != null && message.hasOwnProperty("outputDimensionality")) {
                                properties._outputDimensionality = 1;
                                if (!$util.isInteger(message.outputDimensionality))
                                    return "outputDimensionality: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates an EmbedContentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.EmbedContentRequest} EmbedContentRequest
                         */
                        EmbedContentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.EmbedContentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.EmbedContentRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.content != null) {
                                if (typeof object.content !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.EmbedContentRequest.content: object expected");
                                message.content = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.content);
                            }
                            switch (object.taskType) {
                            default:
                                if (typeof object.taskType === "number") {
                                    message.taskType = object.taskType;
                                    break;
                                }
                                break;
                            case "TASK_TYPE_UNSPECIFIED":
                            case 0:
                                message.taskType = 0;
                                break;
                            case "RETRIEVAL_QUERY":
                            case 1:
                                message.taskType = 1;
                                break;
                            case "RETRIEVAL_DOCUMENT":
                            case 2:
                                message.taskType = 2;
                                break;
                            case "SEMANTIC_SIMILARITY":
                            case 3:
                                message.taskType = 3;
                                break;
                            case "CLASSIFICATION":
                            case 4:
                                message.taskType = 4;
                                break;
                            case "CLUSTERING":
                            case 5:
                                message.taskType = 5;
                                break;
                            case "QUESTION_ANSWERING":
                            case 6:
                                message.taskType = 6;
                                break;
                            case "FACT_VERIFICATION":
                            case 7:
                                message.taskType = 7;
                                break;
                            }
                            if (object.title != null)
                                message.title = String(object.title);
                            if (object.outputDimensionality != null)
                                message.outputDimensionality = object.outputDimensionality | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedContentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.EmbedContentRequest} message EmbedContentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedContentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.content = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.content, options);
                            if (message.taskType != null && message.hasOwnProperty("taskType")) {
                                object.taskType = options.enums === String ? $root.google.ai.generativelanguage.v1beta.TaskType[message.taskType] === undefined ? message.taskType : $root.google.ai.generativelanguage.v1beta.TaskType[message.taskType] : message.taskType;
                                if (options.oneofs)
                                    object._taskType = "taskType";
                            }
                            if (message.title != null && message.hasOwnProperty("title")) {
                                object.title = message.title;
                                if (options.oneofs)
                                    object._title = "title";
                            }
                            if (message.outputDimensionality != null && message.hasOwnProperty("outputDimensionality")) {
                                object.outputDimensionality = message.outputDimensionality;
                                if (options.oneofs)
                                    object._outputDimensionality = "outputDimensionality";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this EmbedContentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedContentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedContentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.EmbedContentRequest";
                        };
    
                        return EmbedContentRequest;
                    })();
    
                    v1beta.ContentEmbedding = (function() {
    
                        /**
                         * Properties of a ContentEmbedding.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IContentEmbedding
                         * @property {Array.<number>|null} [values] ContentEmbedding values
                         */
    
                        /**
                         * Constructs a new ContentEmbedding.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ContentEmbedding.
                         * @implements IContentEmbedding
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IContentEmbedding=} [properties] Properties to set
                         */
                        function ContentEmbedding(properties) {
                            this.values = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ContentEmbedding values.
                         * @member {Array.<number>} values
                         * @memberof google.ai.generativelanguage.v1beta.ContentEmbedding
                         * @instance
                         */
                        ContentEmbedding.prototype.values = $util.emptyArray;
    
                        /**
                         * Creates a new ContentEmbedding instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IContentEmbedding=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ContentEmbedding} ContentEmbedding instance
                         */
                        ContentEmbedding.create = function create(properties) {
                            return new ContentEmbedding(properties);
                        };
    
                        /**
                         * Encodes the specified ContentEmbedding message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ContentEmbedding.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IContentEmbedding} message ContentEmbedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentEmbedding.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.values != null && message.values.length) {
                                writer.uint32(/* id 1, wireType 2 =*/10).fork();
                                for (var i = 0; i < message.values.length; ++i)
                                    writer.float(message.values[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ContentEmbedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ContentEmbedding.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IContentEmbedding} message ContentEmbedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentEmbedding.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ContentEmbedding message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ContentEmbedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ContentEmbedding} ContentEmbedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentEmbedding.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ContentEmbedding();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.values && message.values.length))
                                            message.values = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.values.push(reader.float());
                                        } else
                                            message.values.push(reader.float());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ContentEmbedding message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ContentEmbedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ContentEmbedding} ContentEmbedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentEmbedding.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ContentEmbedding message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ContentEmbedding
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ContentEmbedding.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.values != null && message.hasOwnProperty("values")) {
                                if (!Array.isArray(message.values))
                                    return "values: array expected";
                                for (var i = 0; i < message.values.length; ++i)
                                    if (typeof message.values[i] !== "number")
                                        return "values: number[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a ContentEmbedding message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ContentEmbedding
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ContentEmbedding} ContentEmbedding
                         */
                        ContentEmbedding.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ContentEmbedding)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ContentEmbedding();
                            if (object.values) {
                                if (!Array.isArray(object.values))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.ContentEmbedding.values: array expected");
                                message.values = [];
                                for (var i = 0; i < object.values.length; ++i)
                                    message.values[i] = Number(object.values[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ContentEmbedding message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ContentEmbedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ContentEmbedding} message ContentEmbedding
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ContentEmbedding.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.values = [];
                            if (message.values && message.values.length) {
                                object.values = [];
                                for (var j = 0; j < message.values.length; ++j)
                                    object.values[j] = options.json && !isFinite(message.values[j]) ? String(message.values[j]) : message.values[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this ContentEmbedding to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ContentEmbedding
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ContentEmbedding.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ContentEmbedding
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ContentEmbedding
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ContentEmbedding.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ContentEmbedding";
                        };
    
                        return ContentEmbedding;
                    })();
    
                    v1beta.EmbedContentResponse = (function() {
    
                        /**
                         * Properties of an EmbedContentResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IEmbedContentResponse
                         * @property {google.ai.generativelanguage.v1beta.IContentEmbedding|null} [embedding] EmbedContentResponse embedding
                         */
    
                        /**
                         * Constructs a new EmbedContentResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an EmbedContentResponse.
                         * @implements IEmbedContentResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IEmbedContentResponse=} [properties] Properties to set
                         */
                        function EmbedContentResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedContentResponse embedding.
                         * @member {google.ai.generativelanguage.v1beta.IContentEmbedding|null|undefined} embedding
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentResponse
                         * @instance
                         */
                        EmbedContentResponse.prototype.embedding = null;
    
                        /**
                         * Creates a new EmbedContentResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedContentResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.EmbedContentResponse} EmbedContentResponse instance
                         */
                        EmbedContentResponse.create = function create(properties) {
                            return new EmbedContentResponse(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedContentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.EmbedContentResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedContentResponse} message EmbedContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embedding != null && Object.hasOwnProperty.call(message, "embedding"))
                                $root.google.ai.generativelanguage.v1beta.ContentEmbedding.encode(message.embedding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedContentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.EmbedContentResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedContentResponse} message EmbedContentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedContentResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedContentResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.EmbedContentResponse} EmbedContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.EmbedContentResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.embedding = $root.google.ai.generativelanguage.v1beta.ContentEmbedding.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedContentResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.EmbedContentResponse} EmbedContentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedContentResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedContentResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedContentResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.embedding != null && message.hasOwnProperty("embedding")) {
                                var error = $root.google.ai.generativelanguage.v1beta.ContentEmbedding.verify(message.embedding);
                                if (error)
                                    return "embedding." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an EmbedContentResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.EmbedContentResponse} EmbedContentResponse
                         */
                        EmbedContentResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.EmbedContentResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.EmbedContentResponse();
                            if (object.embedding != null) {
                                if (typeof object.embedding !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.EmbedContentResponse.embedding: object expected");
                                message.embedding = $root.google.ai.generativelanguage.v1beta.ContentEmbedding.fromObject(object.embedding);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedContentResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.EmbedContentResponse} message EmbedContentResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedContentResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.embedding = null;
                            if (message.embedding != null && message.hasOwnProperty("embedding"))
                                object.embedding = $root.google.ai.generativelanguage.v1beta.ContentEmbedding.toObject(message.embedding, options);
                            return object;
                        };
    
                        /**
                         * Converts this EmbedContentResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedContentResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedContentResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.EmbedContentResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedContentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.EmbedContentResponse";
                        };
    
                        return EmbedContentResponse;
                    })();
    
                    v1beta.BatchEmbedContentsRequest = (function() {
    
                        /**
                         * Properties of a BatchEmbedContentsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IBatchEmbedContentsRequest
                         * @property {string|null} [model] BatchEmbedContentsRequest model
                         * @property {Array.<google.ai.generativelanguage.v1beta.IEmbedContentRequest>|null} [requests] BatchEmbedContentsRequest requests
                         */
    
                        /**
                         * Constructs a new BatchEmbedContentsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a BatchEmbedContentsRequest.
                         * @implements IBatchEmbedContentsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest=} [properties] Properties to set
                         */
                        function BatchEmbedContentsRequest(properties) {
                            this.requests = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedContentsRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @instance
                         */
                        BatchEmbedContentsRequest.prototype.model = "";
    
                        /**
                         * BatchEmbedContentsRequest requests.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IEmbedContentRequest>} requests
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @instance
                         */
                        BatchEmbedContentsRequest.prototype.requests = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedContentsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest} BatchEmbedContentsRequest instance
                         */
                        BatchEmbedContentsRequest.create = function create(properties) {
                            return new BatchEmbedContentsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest} message BatchEmbedContentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.requests != null && message.requests.length)
                                for (var i = 0; i < message.requests.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.EmbedContentRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest} message BatchEmbedContentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest} BatchEmbedContentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.requests && message.requests.length))
                                            message.requests = [];
                                        message.requests.push($root.google.ai.generativelanguage.v1beta.EmbedContentRequest.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest} BatchEmbedContentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedContentsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedContentsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.requests != null && message.hasOwnProperty("requests")) {
                                if (!Array.isArray(message.requests))
                                    return "requests: array expected";
                                for (var i = 0; i < message.requests.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.EmbedContentRequest.verify(message.requests[i]);
                                    if (error)
                                        return "requests." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedContentsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest} BatchEmbedContentsRequest
                         */
                        BatchEmbedContentsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.requests) {
                                if (!Array.isArray(object.requests))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest.requests: array expected");
                                message.requests = [];
                                for (var i = 0; i < object.requests.length; ++i) {
                                    if (typeof object.requests[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest.requests: object expected");
                                    message.requests[i] = $root.google.ai.generativelanguage.v1beta.EmbedContentRequest.fromObject(object.requests[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedContentsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest} message BatchEmbedContentsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedContentsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.requests = [];
                            if (options.defaults)
                                object.model = "";
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.requests && message.requests.length) {
                                object.requests = [];
                                for (var j = 0; j < message.requests.length; ++j)
                                    object.requests[j] = $root.google.ai.generativelanguage.v1beta.EmbedContentRequest.toObject(message.requests[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedContentsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedContentsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedContentsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest";
                        };
    
                        return BatchEmbedContentsRequest;
                    })();
    
                    v1beta.BatchEmbedContentsResponse = (function() {
    
                        /**
                         * Properties of a BatchEmbedContentsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IBatchEmbedContentsResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IContentEmbedding>|null} [embeddings] BatchEmbedContentsResponse embeddings
                         */
    
                        /**
                         * Constructs a new BatchEmbedContentsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a BatchEmbedContentsResponse.
                         * @implements IBatchEmbedContentsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsResponse=} [properties] Properties to set
                         */
                        function BatchEmbedContentsResponse(properties) {
                            this.embeddings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedContentsResponse embeddings.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IContentEmbedding>} embeddings
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
                         * @instance
                         */
                        BatchEmbedContentsResponse.prototype.embeddings = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedContentsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse} BatchEmbedContentsResponse instance
                         */
                        BatchEmbedContentsResponse.create = function create(properties) {
                            return new BatchEmbedContentsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsResponse} message BatchEmbedContentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embeddings != null && message.embeddings.length)
                                for (var i = 0; i < message.embeddings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.ContentEmbedding.encode(message.embeddings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedContentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsResponse} message BatchEmbedContentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedContentsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse} BatchEmbedContentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.embeddings && message.embeddings.length))
                                            message.embeddings = [];
                                        message.embeddings.push($root.google.ai.generativelanguage.v1beta.ContentEmbedding.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedContentsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse} BatchEmbedContentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedContentsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedContentsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedContentsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.embeddings != null && message.hasOwnProperty("embeddings")) {
                                if (!Array.isArray(message.embeddings))
                                    return "embeddings: array expected";
                                for (var i = 0; i < message.embeddings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.ContentEmbedding.verify(message.embeddings[i]);
                                    if (error)
                                        return "embeddings." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedContentsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse} BatchEmbedContentsResponse
                         */
                        BatchEmbedContentsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse();
                            if (object.embeddings) {
                                if (!Array.isArray(object.embeddings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse.embeddings: array expected");
                                message.embeddings = [];
                                for (var i = 0; i < object.embeddings.length; ++i) {
                                    if (typeof object.embeddings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse.embeddings: object expected");
                                    message.embeddings[i] = $root.google.ai.generativelanguage.v1beta.ContentEmbedding.fromObject(object.embeddings[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedContentsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse} message BatchEmbedContentsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedContentsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.embeddings = [];
                            if (message.embeddings && message.embeddings.length) {
                                object.embeddings = [];
                                for (var j = 0; j < message.embeddings.length; ++j)
                                    object.embeddings[j] = $root.google.ai.generativelanguage.v1beta.ContentEmbedding.toObject(message.embeddings[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedContentsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedContentsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedContentsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedContentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse";
                        };
    
                        return BatchEmbedContentsResponse;
                    })();
    
                    v1beta.CountTokensRequest = (function() {
    
                        /**
                         * Properties of a CountTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICountTokensRequest
                         * @property {string|null} [model] CountTokensRequest model
                         * @property {Array.<google.ai.generativelanguage.v1beta.IContent>|null} [contents] CountTokensRequest contents
                         * @property {google.ai.generativelanguage.v1beta.IGenerateContentRequest|null} [generateContentRequest] CountTokensRequest generateContentRequest
                         */
    
                        /**
                         * Constructs a new CountTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CountTokensRequest.
                         * @implements ICountTokensRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICountTokensRequest=} [properties] Properties to set
                         */
                        function CountTokensRequest(properties) {
                            this.contents = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTokensRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @instance
                         */
                        CountTokensRequest.prototype.model = "";
    
                        /**
                         * CountTokensRequest contents.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IContent>} contents
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @instance
                         */
                        CountTokensRequest.prototype.contents = $util.emptyArray;
    
                        /**
                         * CountTokensRequest generateContentRequest.
                         * @member {google.ai.generativelanguage.v1beta.IGenerateContentRequest|null|undefined} generateContentRequest
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @instance
                         */
                        CountTokensRequest.prototype.generateContentRequest = null;
    
                        /**
                         * Creates a new CountTokensRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTokensRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CountTokensRequest} CountTokensRequest instance
                         */
                        CountTokensRequest.create = function create(properties) {
                            return new CountTokensRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CountTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountTokensRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTokensRequest} message CountTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.contents != null && message.contents.length)
                                for (var i = 0; i < message.contents.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.generateContentRequest != null && Object.hasOwnProperty.call(message, "generateContentRequest"))
                                $root.google.ai.generativelanguage.v1beta.GenerateContentRequest.encode(message.generateContentRequest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountTokensRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTokensRequest} message CountTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTokensRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CountTokensRequest} CountTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CountTokensRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.contents && message.contents.length))
                                            message.contents = [];
                                        message.contents.push($root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        message.generateContentRequest = $root.google.ai.generativelanguage.v1beta.GenerateContentRequest.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTokensRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CountTokensRequest} CountTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTokensRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTokensRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.contents != null && message.hasOwnProperty("contents")) {
                                if (!Array.isArray(message.contents))
                                    return "contents: array expected";
                                for (var i = 0; i < message.contents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.contents[i]);
                                    if (error)
                                        return "contents." + error;
                                }
                            }
                            if (message.generateContentRequest != null && message.hasOwnProperty("generateContentRequest")) {
                                var error = $root.google.ai.generativelanguage.v1beta.GenerateContentRequest.verify(message.generateContentRequest);
                                if (error)
                                    return "generateContentRequest." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CountTokensRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CountTokensRequest} CountTokensRequest
                         */
                        CountTokensRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CountTokensRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CountTokensRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.contents) {
                                if (!Array.isArray(object.contents))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CountTokensRequest.contents: array expected");
                                message.contents = [];
                                for (var i = 0; i < object.contents.length; ++i) {
                                    if (typeof object.contents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.CountTokensRequest.contents: object expected");
                                    message.contents[i] = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.contents[i]);
                                }
                            }
                            if (object.generateContentRequest != null) {
                                if (typeof object.generateContentRequest !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CountTokensRequest.generateContentRequest: object expected");
                                message.generateContentRequest = $root.google.ai.generativelanguage.v1beta.GenerateContentRequest.fromObject(object.generateContentRequest);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTokensRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CountTokensRequest} message CountTokensRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTokensRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.contents = [];
                            if (options.defaults) {
                                object.model = "";
                                object.generateContentRequest = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.contents && message.contents.length) {
                                object.contents = [];
                                for (var j = 0; j < message.contents.length; ++j)
                                    object.contents[j] = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.contents[j], options);
                            }
                            if (message.generateContentRequest != null && message.hasOwnProperty("generateContentRequest"))
                                object.generateContentRequest = $root.google.ai.generativelanguage.v1beta.GenerateContentRequest.toObject(message.generateContentRequest, options);
                            return object;
                        };
    
                        /**
                         * Converts this CountTokensRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTokensRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTokensRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CountTokensRequest";
                        };
    
                        return CountTokensRequest;
                    })();
    
                    v1beta.CountTokensResponse = (function() {
    
                        /**
                         * Properties of a CountTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICountTokensResponse
                         * @property {number|null} [totalTokens] CountTokensResponse totalTokens
                         * @property {number|null} [cachedContentTokenCount] CountTokensResponse cachedContentTokenCount
                         */
    
                        /**
                         * Constructs a new CountTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CountTokensResponse.
                         * @implements ICountTokensResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICountTokensResponse=} [properties] Properties to set
                         */
                        function CountTokensResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTokensResponse totalTokens.
                         * @member {number} totalTokens
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @instance
                         */
                        CountTokensResponse.prototype.totalTokens = 0;
    
                        /**
                         * CountTokensResponse cachedContentTokenCount.
                         * @member {number} cachedContentTokenCount
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @instance
                         */
                        CountTokensResponse.prototype.cachedContentTokenCount = 0;
    
                        /**
                         * Creates a new CountTokensResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTokensResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CountTokensResponse} CountTokensResponse instance
                         */
                        CountTokensResponse.create = function create(properties) {
                            return new CountTokensResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CountTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountTokensResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTokensResponse} message CountTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.totalTokens != null && Object.hasOwnProperty.call(message, "totalTokens"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalTokens);
                            if (message.cachedContentTokenCount != null && Object.hasOwnProperty.call(message, "cachedContentTokenCount"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.cachedContentTokenCount);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountTokensResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTokensResponse} message CountTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTokensResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTokensResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CountTokensResponse} CountTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CountTokensResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.totalTokens = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.cachedContentTokenCount = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTokensResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CountTokensResponse} CountTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTokensResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTokensResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTokensResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.totalTokens != null && message.hasOwnProperty("totalTokens"))
                                if (!$util.isInteger(message.totalTokens))
                                    return "totalTokens: integer expected";
                            if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount"))
                                if (!$util.isInteger(message.cachedContentTokenCount))
                                    return "cachedContentTokenCount: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a CountTokensResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CountTokensResponse} CountTokensResponse
                         */
                        CountTokensResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CountTokensResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CountTokensResponse();
                            if (object.totalTokens != null)
                                message.totalTokens = object.totalTokens | 0;
                            if (object.cachedContentTokenCount != null)
                                message.cachedContentTokenCount = object.cachedContentTokenCount | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTokensResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CountTokensResponse} message CountTokensResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTokensResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.totalTokens = 0;
                                object.cachedContentTokenCount = 0;
                            }
                            if (message.totalTokens != null && message.hasOwnProperty("totalTokens"))
                                object.totalTokens = message.totalTokens;
                            if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount"))
                                object.cachedContentTokenCount = message.cachedContentTokenCount;
                            return object;
                        };
    
                        /**
                         * Converts this CountTokensResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTokensResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTokensResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CountTokensResponse";
                        };
    
                        return CountTokensResponse;
                    })();
    
                    v1beta.Corpus = (function() {
    
                        /**
                         * Properties of a Corpus.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICorpus
                         * @property {string|null} [name] Corpus name
                         * @property {string|null} [displayName] Corpus displayName
                         * @property {google.protobuf.ITimestamp|null} [createTime] Corpus createTime
                         * @property {google.protobuf.ITimestamp|null} [updateTime] Corpus updateTime
                         */
    
                        /**
                         * Constructs a new Corpus.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Corpus.
                         * @implements ICorpus
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICorpus=} [properties] Properties to set
                         */
                        function Corpus(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Corpus name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @instance
                         */
                        Corpus.prototype.name = "";
    
                        /**
                         * Corpus displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @instance
                         */
                        Corpus.prototype.displayName = "";
    
                        /**
                         * Corpus createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @instance
                         */
                        Corpus.prototype.createTime = null;
    
                        /**
                         * Corpus updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @instance
                         */
                        Corpus.prototype.updateTime = null;
    
                        /**
                         * Creates a new Corpus instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICorpus=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Corpus} Corpus instance
                         */
                        Corpus.create = function create(properties) {
                            return new Corpus(properties);
                        };
    
                        /**
                         * Encodes the specified Corpus message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Corpus.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICorpus} message Corpus message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Corpus.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName);
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Corpus message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Corpus.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICorpus} message Corpus message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Corpus.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Corpus message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Corpus} Corpus
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Corpus.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Corpus();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Corpus message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Corpus} Corpus
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Corpus.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Corpus message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Corpus.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Corpus message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Corpus} Corpus
                         */
                        Corpus.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Corpus)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Corpus();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Corpus.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Corpus.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Corpus message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Corpus} message Corpus
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Corpus.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.displayName = "";
                                object.createTime = null;
                                object.updateTime = null;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            return object;
                        };
    
                        /**
                         * Converts this Corpus to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Corpus.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Corpus
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Corpus
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Corpus.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Corpus";
                        };
    
                        return Corpus;
                    })();
    
                    v1beta.Document = (function() {
    
                        /**
                         * Properties of a Document.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IDocument
                         * @property {string|null} [name] Document name
                         * @property {string|null} [displayName] Document displayName
                         * @property {Array.<google.ai.generativelanguage.v1beta.ICustomMetadata>|null} [customMetadata] Document customMetadata
                         * @property {google.protobuf.ITimestamp|null} [updateTime] Document updateTime
                         * @property {google.protobuf.ITimestamp|null} [createTime] Document createTime
                         */
    
                        /**
                         * Constructs a new Document.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Document.
                         * @implements IDocument
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IDocument=} [properties] Properties to set
                         */
                        function Document(properties) {
                            this.customMetadata = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Document name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @instance
                         */
                        Document.prototype.name = "";
    
                        /**
                         * Document displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @instance
                         */
                        Document.prototype.displayName = "";
    
                        /**
                         * Document customMetadata.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ICustomMetadata>} customMetadata
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @instance
                         */
                        Document.prototype.customMetadata = $util.emptyArray;
    
                        /**
                         * Document updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @instance
                         */
                        Document.prototype.updateTime = null;
    
                        /**
                         * Document createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @instance
                         */
                        Document.prototype.createTime = null;
    
                        /**
                         * Creates a new Document instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDocument=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Document} Document instance
                         */
                        Document.create = function create(properties) {
                            return new Document(properties);
                        };
    
                        /**
                         * Encodes the specified Document message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Document.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDocument} message Document message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Document.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName);
                            if (message.customMetadata != null && message.customMetadata.length)
                                for (var i = 0; i < message.customMetadata.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.CustomMetadata.encode(message.customMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Document message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Document.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDocument} message Document message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Document.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Document message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Document} Document
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Document.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Document();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 3: {
                                        if (!(message.customMetadata && message.customMetadata.length))
                                            message.customMetadata = [];
                                        message.customMetadata.push($root.google.ai.generativelanguage.v1beta.CustomMetadata.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Document message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Document} Document
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Document.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Document message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Document.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.customMetadata != null && message.hasOwnProperty("customMetadata")) {
                                if (!Array.isArray(message.customMetadata))
                                    return "customMetadata: array expected";
                                for (var i = 0; i < message.customMetadata.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.CustomMetadata.verify(message.customMetadata[i]);
                                    if (error)
                                        return "customMetadata." + error;
                                }
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Document message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Document} Document
                         */
                        Document.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Document)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Document();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.customMetadata) {
                                if (!Array.isArray(object.customMetadata))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Document.customMetadata: array expected");
                                message.customMetadata = [];
                                for (var i = 0; i < object.customMetadata.length; ++i) {
                                    if (typeof object.customMetadata[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.Document.customMetadata: object expected");
                                    message.customMetadata[i] = $root.google.ai.generativelanguage.v1beta.CustomMetadata.fromObject(object.customMetadata[i]);
                                }
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Document.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Document.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Document message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Document} message Document
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Document.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.customMetadata = [];
                            if (options.defaults) {
                                object.name = "";
                                object.displayName = "";
                                object.updateTime = null;
                                object.createTime = null;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.customMetadata && message.customMetadata.length) {
                                object.customMetadata = [];
                                for (var j = 0; j < message.customMetadata.length; ++j)
                                    object.customMetadata[j] = $root.google.ai.generativelanguage.v1beta.CustomMetadata.toObject(message.customMetadata[j], options);
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            return object;
                        };
    
                        /**
                         * Converts this Document to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Document.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Document
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Document
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Document";
                        };
    
                        return Document;
                    })();
    
                    v1beta.StringList = (function() {
    
                        /**
                         * Properties of a StringList.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IStringList
                         * @property {Array.<string>|null} [values] StringList values
                         */
    
                        /**
                         * Constructs a new StringList.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a StringList.
                         * @implements IStringList
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IStringList=} [properties] Properties to set
                         */
                        function StringList(properties) {
                            this.values = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * StringList values.
                         * @member {Array.<string>} values
                         * @memberof google.ai.generativelanguage.v1beta.StringList
                         * @instance
                         */
                        StringList.prototype.values = $util.emptyArray;
    
                        /**
                         * Creates a new StringList instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.StringList
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IStringList=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.StringList} StringList instance
                         */
                        StringList.create = function create(properties) {
                            return new StringList(properties);
                        };
    
                        /**
                         * Encodes the specified StringList message. Does not implicitly {@link google.ai.generativelanguage.v1beta.StringList.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.StringList
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IStringList} message StringList message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        StringList.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.values != null && message.values.length)
                                for (var i = 0; i < message.values.length; ++i)
                                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified StringList message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.StringList.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.StringList
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IStringList} message StringList message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        StringList.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a StringList message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.StringList
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.StringList} StringList
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        StringList.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.StringList();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.values && message.values.length))
                                            message.values = [];
                                        message.values.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a StringList message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.StringList
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.StringList} StringList
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        StringList.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a StringList message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.StringList
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        StringList.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.values != null && message.hasOwnProperty("values")) {
                                if (!Array.isArray(message.values))
                                    return "values: array expected";
                                for (var i = 0; i < message.values.length; ++i)
                                    if (!$util.isString(message.values[i]))
                                        return "values: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a StringList message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.StringList
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.StringList} StringList
                         */
                        StringList.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.StringList)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.StringList();
                            if (object.values) {
                                if (!Array.isArray(object.values))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.StringList.values: array expected");
                                message.values = [];
                                for (var i = 0; i < object.values.length; ++i)
                                    message.values[i] = String(object.values[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a StringList message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.StringList
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.StringList} message StringList
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        StringList.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.values = [];
                            if (message.values && message.values.length) {
                                object.values = [];
                                for (var j = 0; j < message.values.length; ++j)
                                    object.values[j] = message.values[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this StringList to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.StringList
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        StringList.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for StringList
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.StringList
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        StringList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.StringList";
                        };
    
                        return StringList;
                    })();
    
                    v1beta.CustomMetadata = (function() {
    
                        /**
                         * Properties of a CustomMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICustomMetadata
                         * @property {string|null} [stringValue] CustomMetadata stringValue
                         * @property {google.ai.generativelanguage.v1beta.IStringList|null} [stringListValue] CustomMetadata stringListValue
                         * @property {number|null} [numericValue] CustomMetadata numericValue
                         * @property {string|null} [key] CustomMetadata key
                         */
    
                        /**
                         * Constructs a new CustomMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CustomMetadata.
                         * @implements ICustomMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICustomMetadata=} [properties] Properties to set
                         */
                        function CustomMetadata(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CustomMetadata stringValue.
                         * @member {string|null|undefined} stringValue
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @instance
                         */
                        CustomMetadata.prototype.stringValue = null;
    
                        /**
                         * CustomMetadata stringListValue.
                         * @member {google.ai.generativelanguage.v1beta.IStringList|null|undefined} stringListValue
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @instance
                         */
                        CustomMetadata.prototype.stringListValue = null;
    
                        /**
                         * CustomMetadata numericValue.
                         * @member {number|null|undefined} numericValue
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @instance
                         */
                        CustomMetadata.prototype.numericValue = null;
    
                        /**
                         * CustomMetadata key.
                         * @member {string} key
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @instance
                         */
                        CustomMetadata.prototype.key = "";
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CustomMetadata value.
                         * @member {"stringValue"|"stringListValue"|"numericValue"|undefined} value
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @instance
                         */
                        Object.defineProperty(CustomMetadata.prototype, "value", {
                            get: $util.oneOfGetter($oneOfFields = ["stringValue", "stringListValue", "numericValue"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CustomMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICustomMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CustomMetadata} CustomMetadata instance
                         */
                        CustomMetadata.create = function create(properties) {
                            return new CustomMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified CustomMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CustomMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICustomMetadata} message CustomMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CustomMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.key != null && Object.hasOwnProperty.call(message, "key"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);
                            if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.stringValue);
                            if (message.stringListValue != null && Object.hasOwnProperty.call(message, "stringListValue"))
                                $root.google.ai.generativelanguage.v1beta.StringList.encode(message.stringListValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                            if (message.numericValue != null && Object.hasOwnProperty.call(message, "numericValue"))
                                writer.uint32(/* id 7, wireType 5 =*/61).float(message.numericValue);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CustomMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CustomMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICustomMetadata} message CustomMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CustomMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CustomMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CustomMetadata} CustomMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CustomMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CustomMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.stringValue = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.stringListValue = $root.google.ai.generativelanguage.v1beta.StringList.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 7: {
                                        message.numericValue = reader.float();
                                        break;
                                    }
                                case 1: {
                                        message.key = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CustomMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CustomMetadata} CustomMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CustomMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CustomMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CustomMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                properties.value = 1;
                                if (!$util.isString(message.stringValue))
                                    return "stringValue: string expected";
                            }
                            if (message.stringListValue != null && message.hasOwnProperty("stringListValue")) {
                                if (properties.value === 1)
                                    return "value: multiple values";
                                properties.value = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.StringList.verify(message.stringListValue);
                                    if (error)
                                        return "stringListValue." + error;
                                }
                            }
                            if (message.numericValue != null && message.hasOwnProperty("numericValue")) {
                                if (properties.value === 1)
                                    return "value: multiple values";
                                properties.value = 1;
                                if (typeof message.numericValue !== "number")
                                    return "numericValue: number expected";
                            }
                            if (message.key != null && message.hasOwnProperty("key"))
                                if (!$util.isString(message.key))
                                    return "key: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a CustomMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CustomMetadata} CustomMetadata
                         */
                        CustomMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CustomMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CustomMetadata();
                            if (object.stringValue != null)
                                message.stringValue = String(object.stringValue);
                            if (object.stringListValue != null) {
                                if (typeof object.stringListValue !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CustomMetadata.stringListValue: object expected");
                                message.stringListValue = $root.google.ai.generativelanguage.v1beta.StringList.fromObject(object.stringListValue);
                            }
                            if (object.numericValue != null)
                                message.numericValue = Number(object.numericValue);
                            if (object.key != null)
                                message.key = String(object.key);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CustomMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CustomMetadata} message CustomMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CustomMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.key = "";
                            if (message.key != null && message.hasOwnProperty("key"))
                                object.key = message.key;
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                object.stringValue = message.stringValue;
                                if (options.oneofs)
                                    object.value = "stringValue";
                            }
                            if (message.stringListValue != null && message.hasOwnProperty("stringListValue")) {
                                object.stringListValue = $root.google.ai.generativelanguage.v1beta.StringList.toObject(message.stringListValue, options);
                                if (options.oneofs)
                                    object.value = "stringListValue";
                            }
                            if (message.numericValue != null && message.hasOwnProperty("numericValue")) {
                                object.numericValue = options.json && !isFinite(message.numericValue) ? String(message.numericValue) : message.numericValue;
                                if (options.oneofs)
                                    object.value = "numericValue";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CustomMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CustomMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CustomMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CustomMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CustomMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CustomMetadata";
                        };
    
                        return CustomMetadata;
                    })();
    
                    v1beta.MetadataFilter = (function() {
    
                        /**
                         * Properties of a MetadataFilter.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IMetadataFilter
                         * @property {string|null} [key] MetadataFilter key
                         * @property {Array.<google.ai.generativelanguage.v1beta.ICondition>|null} [conditions] MetadataFilter conditions
                         */
    
                        /**
                         * Constructs a new MetadataFilter.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a MetadataFilter.
                         * @implements IMetadataFilter
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IMetadataFilter=} [properties] Properties to set
                         */
                        function MetadataFilter(properties) {
                            this.conditions = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * MetadataFilter key.
                         * @member {string} key
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @instance
                         */
                        MetadataFilter.prototype.key = "";
    
                        /**
                         * MetadataFilter conditions.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ICondition>} conditions
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @instance
                         */
                        MetadataFilter.prototype.conditions = $util.emptyArray;
    
                        /**
                         * Creates a new MetadataFilter instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IMetadataFilter=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.MetadataFilter} MetadataFilter instance
                         */
                        MetadataFilter.create = function create(properties) {
                            return new MetadataFilter(properties);
                        };
    
                        /**
                         * Encodes the specified MetadataFilter message. Does not implicitly {@link google.ai.generativelanguage.v1beta.MetadataFilter.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IMetadataFilter} message MetadataFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MetadataFilter.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.key != null && Object.hasOwnProperty.call(message, "key"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);
                            if (message.conditions != null && message.conditions.length)
                                for (var i = 0; i < message.conditions.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Condition.encode(message.conditions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified MetadataFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.MetadataFilter.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IMetadataFilter} message MetadataFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MetadataFilter.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a MetadataFilter message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.MetadataFilter} MetadataFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MetadataFilter.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.MetadataFilter();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.key = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.conditions && message.conditions.length))
                                            message.conditions = [];
                                        message.conditions.push($root.google.ai.generativelanguage.v1beta.Condition.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a MetadataFilter message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.MetadataFilter} MetadataFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MetadataFilter.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a MetadataFilter message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        MetadataFilter.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.key != null && message.hasOwnProperty("key"))
                                if (!$util.isString(message.key))
                                    return "key: string expected";
                            if (message.conditions != null && message.hasOwnProperty("conditions")) {
                                if (!Array.isArray(message.conditions))
                                    return "conditions: array expected";
                                for (var i = 0; i < message.conditions.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Condition.verify(message.conditions[i]);
                                    if (error)
                                        return "conditions." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a MetadataFilter message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.MetadataFilter} MetadataFilter
                         */
                        MetadataFilter.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.MetadataFilter)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.MetadataFilter();
                            if (object.key != null)
                                message.key = String(object.key);
                            if (object.conditions) {
                                if (!Array.isArray(object.conditions))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.MetadataFilter.conditions: array expected");
                                message.conditions = [];
                                for (var i = 0; i < object.conditions.length; ++i) {
                                    if (typeof object.conditions[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.MetadataFilter.conditions: object expected");
                                    message.conditions[i] = $root.google.ai.generativelanguage.v1beta.Condition.fromObject(object.conditions[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a MetadataFilter message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.MetadataFilter} message MetadataFilter
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        MetadataFilter.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.conditions = [];
                            if (options.defaults)
                                object.key = "";
                            if (message.key != null && message.hasOwnProperty("key"))
                                object.key = message.key;
                            if (message.conditions && message.conditions.length) {
                                object.conditions = [];
                                for (var j = 0; j < message.conditions.length; ++j)
                                    object.conditions[j] = $root.google.ai.generativelanguage.v1beta.Condition.toObject(message.conditions[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this MetadataFilter to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        MetadataFilter.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for MetadataFilter
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.MetadataFilter
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        MetadataFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.MetadataFilter";
                        };
    
                        return MetadataFilter;
                    })();
    
                    v1beta.Condition = (function() {
    
                        /**
                         * Properties of a Condition.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICondition
                         * @property {string|null} [stringValue] Condition stringValue
                         * @property {number|null} [numericValue] Condition numericValue
                         * @property {google.ai.generativelanguage.v1beta.Condition.Operator|null} [operation] Condition operation
                         */
    
                        /**
                         * Constructs a new Condition.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Condition.
                         * @implements ICondition
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICondition=} [properties] Properties to set
                         */
                        function Condition(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Condition stringValue.
                         * @member {string|null|undefined} stringValue
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @instance
                         */
                        Condition.prototype.stringValue = null;
    
                        /**
                         * Condition numericValue.
                         * @member {number|null|undefined} numericValue
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @instance
                         */
                        Condition.prototype.numericValue = null;
    
                        /**
                         * Condition operation.
                         * @member {google.ai.generativelanguage.v1beta.Condition.Operator} operation
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @instance
                         */
                        Condition.prototype.operation = 0;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Condition value.
                         * @member {"stringValue"|"numericValue"|undefined} value
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @instance
                         */
                        Object.defineProperty(Condition.prototype, "value", {
                            get: $util.oneOfGetter($oneOfFields = ["stringValue", "numericValue"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Condition instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICondition=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Condition} Condition instance
                         */
                        Condition.create = function create(properties) {
                            return new Condition(properties);
                        };
    
                        /**
                         * Encodes the specified Condition message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Condition.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICondition} message Condition message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Condition.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue);
                            if (message.operation != null && Object.hasOwnProperty.call(message, "operation"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.operation);
                            if (message.numericValue != null && Object.hasOwnProperty.call(message, "numericValue"))
                                writer.uint32(/* id 6, wireType 5 =*/53).float(message.numericValue);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Condition.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICondition} message Condition message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Condition.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Condition message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Condition} Condition
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Condition.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Condition();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.stringValue = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.numericValue = reader.float();
                                        break;
                                    }
                                case 5: {
                                        message.operation = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Condition message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Condition} Condition
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Condition.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Condition message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Condition.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                properties.value = 1;
                                if (!$util.isString(message.stringValue))
                                    return "stringValue: string expected";
                            }
                            if (message.numericValue != null && message.hasOwnProperty("numericValue")) {
                                if (properties.value === 1)
                                    return "value: multiple values";
                                properties.value = 1;
                                if (typeof message.numericValue !== "number")
                                    return "numericValue: number expected";
                            }
                            if (message.operation != null && message.hasOwnProperty("operation"))
                                switch (message.operation) {
                                default:
                                    return "operation: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                case 7:
                                case 8:
                                    break;
                                }
                            return null;
                        };
    
                        /**
                         * Creates a Condition message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Condition} Condition
                         */
                        Condition.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Condition)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Condition();
                            if (object.stringValue != null)
                                message.stringValue = String(object.stringValue);
                            if (object.numericValue != null)
                                message.numericValue = Number(object.numericValue);
                            switch (object.operation) {
                            default:
                                if (typeof object.operation === "number") {
                                    message.operation = object.operation;
                                    break;
                                }
                                break;
                            case "OPERATOR_UNSPECIFIED":
                            case 0:
                                message.operation = 0;
                                break;
                            case "LESS":
                            case 1:
                                message.operation = 1;
                                break;
                            case "LESS_EQUAL":
                            case 2:
                                message.operation = 2;
                                break;
                            case "EQUAL":
                            case 3:
                                message.operation = 3;
                                break;
                            case "GREATER_EQUAL":
                            case 4:
                                message.operation = 4;
                                break;
                            case "GREATER":
                            case 5:
                                message.operation = 5;
                                break;
                            case "NOT_EQUAL":
                            case 6:
                                message.operation = 6;
                                break;
                            case "INCLUDES":
                            case 7:
                                message.operation = 7;
                                break;
                            case "EXCLUDES":
                            case 8:
                                message.operation = 8;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Condition message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Condition} message Condition
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Condition.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.operation = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0;
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                object.stringValue = message.stringValue;
                                if (options.oneofs)
                                    object.value = "stringValue";
                            }
                            if (message.operation != null && message.hasOwnProperty("operation"))
                                object.operation = options.enums === String ? $root.google.ai.generativelanguage.v1beta.Condition.Operator[message.operation] === undefined ? message.operation : $root.google.ai.generativelanguage.v1beta.Condition.Operator[message.operation] : message.operation;
                            if (message.numericValue != null && message.hasOwnProperty("numericValue")) {
                                object.numericValue = options.json && !isFinite(message.numericValue) ? String(message.numericValue) : message.numericValue;
                                if (options.oneofs)
                                    object.value = "numericValue";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Condition to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Condition.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Condition
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Condition
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Condition";
                        };
    
                        /**
                         * Operator enum.
                         * @name google.ai.generativelanguage.v1beta.Condition.Operator
                         * @enum {number}
                         * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value
                         * @property {number} LESS=1 LESS value
                         * @property {number} LESS_EQUAL=2 LESS_EQUAL value
                         * @property {number} EQUAL=3 EQUAL value
                         * @property {number} GREATER_EQUAL=4 GREATER_EQUAL value
                         * @property {number} GREATER=5 GREATER value
                         * @property {number} NOT_EQUAL=6 NOT_EQUAL value
                         * @property {number} INCLUDES=7 INCLUDES value
                         * @property {number} EXCLUDES=8 EXCLUDES value
                         */
                        Condition.Operator = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "LESS"] = 1;
                            values[valuesById[2] = "LESS_EQUAL"] = 2;
                            values[valuesById[3] = "EQUAL"] = 3;
                            values[valuesById[4] = "GREATER_EQUAL"] = 4;
                            values[valuesById[5] = "GREATER"] = 5;
                            values[valuesById[6] = "NOT_EQUAL"] = 6;
                            values[valuesById[7] = "INCLUDES"] = 7;
                            values[valuesById[8] = "EXCLUDES"] = 8;
                            return values;
                        })();
    
                        return Condition;
                    })();
    
                    v1beta.Chunk = (function() {
    
                        /**
                         * Properties of a Chunk.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IChunk
                         * @property {string|null} [name] Chunk name
                         * @property {google.ai.generativelanguage.v1beta.IChunkData|null} [data] Chunk data
                         * @property {Array.<google.ai.generativelanguage.v1beta.ICustomMetadata>|null} [customMetadata] Chunk customMetadata
                         * @property {google.protobuf.ITimestamp|null} [createTime] Chunk createTime
                         * @property {google.protobuf.ITimestamp|null} [updateTime] Chunk updateTime
                         * @property {google.ai.generativelanguage.v1beta.Chunk.State|null} [state] Chunk state
                         */
    
                        /**
                         * Constructs a new Chunk.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Chunk.
                         * @implements IChunk
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IChunk=} [properties] Properties to set
                         */
                        function Chunk(properties) {
                            this.customMetadata = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Chunk name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @instance
                         */
                        Chunk.prototype.name = "";
    
                        /**
                         * Chunk data.
                         * @member {google.ai.generativelanguage.v1beta.IChunkData|null|undefined} data
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @instance
                         */
                        Chunk.prototype.data = null;
    
                        /**
                         * Chunk customMetadata.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ICustomMetadata>} customMetadata
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @instance
                         */
                        Chunk.prototype.customMetadata = $util.emptyArray;
    
                        /**
                         * Chunk createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @instance
                         */
                        Chunk.prototype.createTime = null;
    
                        /**
                         * Chunk updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @instance
                         */
                        Chunk.prototype.updateTime = null;
    
                        /**
                         * Chunk state.
                         * @member {google.ai.generativelanguage.v1beta.Chunk.State} state
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @instance
                         */
                        Chunk.prototype.state = 0;
    
                        /**
                         * Creates a new Chunk instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IChunk=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Chunk} Chunk instance
                         */
                        Chunk.create = function create(properties) {
                            return new Chunk(properties);
                        };
    
                        /**
                         * Encodes the specified Chunk message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Chunk.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IChunk} message Chunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Chunk.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.data != null && Object.hasOwnProperty.call(message, "data"))
                                $root.google.ai.generativelanguage.v1beta.ChunkData.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.customMetadata != null && message.customMetadata.length)
                                for (var i = 0; i < message.customMetadata.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.CustomMetadata.encode(message.customMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Chunk.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IChunk} message Chunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Chunk.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Chunk message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Chunk} Chunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Chunk.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Chunk();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.data = $root.google.ai.generativelanguage.v1beta.ChunkData.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.customMetadata && message.customMetadata.length))
                                            message.customMetadata = [];
                                        message.customMetadata.push($root.google.ai.generativelanguage.v1beta.CustomMetadata.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 6: {
                                        message.state = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Chunk message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Chunk} Chunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Chunk.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Chunk message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Chunk.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.data != null && message.hasOwnProperty("data")) {
                                var error = $root.google.ai.generativelanguage.v1beta.ChunkData.verify(message.data);
                                if (error)
                                    return "data." + error;
                            }
                            if (message.customMetadata != null && message.hasOwnProperty("customMetadata")) {
                                if (!Array.isArray(message.customMetadata))
                                    return "customMetadata: array expected";
                                for (var i = 0; i < message.customMetadata.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.CustomMetadata.verify(message.customMetadata[i]);
                                    if (error)
                                        return "customMetadata." + error;
                                }
                            }
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            if (message.state != null && message.hasOwnProperty("state"))
                                switch (message.state) {
                                default:
                                    return "state: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 10:
                                    break;
                                }
                            return null;
                        };
    
                        /**
                         * Creates a Chunk message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Chunk} Chunk
                         */
                        Chunk.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Chunk)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Chunk();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.data != null) {
                                if (typeof object.data !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Chunk.data: object expected");
                                message.data = $root.google.ai.generativelanguage.v1beta.ChunkData.fromObject(object.data);
                            }
                            if (object.customMetadata) {
                                if (!Array.isArray(object.customMetadata))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Chunk.customMetadata: array expected");
                                message.customMetadata = [];
                                for (var i = 0; i < object.customMetadata.length; ++i) {
                                    if (typeof object.customMetadata[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.Chunk.customMetadata: object expected");
                                    message.customMetadata[i] = $root.google.ai.generativelanguage.v1beta.CustomMetadata.fromObject(object.customMetadata[i]);
                                }
                            }
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Chunk.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Chunk.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            switch (object.state) {
                            default:
                                if (typeof object.state === "number") {
                                    message.state = object.state;
                                    break;
                                }
                                break;
                            case "STATE_UNSPECIFIED":
                            case 0:
                                message.state = 0;
                                break;
                            case "STATE_PENDING_PROCESSING":
                            case 1:
                                message.state = 1;
                                break;
                            case "STATE_ACTIVE":
                            case 2:
                                message.state = 2;
                                break;
                            case "STATE_FAILED":
                            case 10:
                                message.state = 10;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Chunk message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Chunk} message Chunk
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Chunk.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.customMetadata = [];
                            if (options.defaults) {
                                object.name = "";
                                object.data = null;
                                object.createTime = null;
                                object.updateTime = null;
                                object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.data != null && message.hasOwnProperty("data"))
                                object.data = $root.google.ai.generativelanguage.v1beta.ChunkData.toObject(message.data, options);
                            if (message.customMetadata && message.customMetadata.length) {
                                object.customMetadata = [];
                                for (var j = 0; j < message.customMetadata.length; ++j)
                                    object.customMetadata[j] = $root.google.ai.generativelanguage.v1beta.CustomMetadata.toObject(message.customMetadata[j], options);
                            }
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            if (message.state != null && message.hasOwnProperty("state"))
                                object.state = options.enums === String ? $root.google.ai.generativelanguage.v1beta.Chunk.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1beta.Chunk.State[message.state] : message.state;
                            return object;
                        };
    
                        /**
                         * Converts this Chunk to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Chunk.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Chunk
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Chunk
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Chunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Chunk";
                        };
    
                        /**
                         * State enum.
                         * @name google.ai.generativelanguage.v1beta.Chunk.State
                         * @enum {number}
                         * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value
                         * @property {number} STATE_PENDING_PROCESSING=1 STATE_PENDING_PROCESSING value
                         * @property {number} STATE_ACTIVE=2 STATE_ACTIVE value
                         * @property {number} STATE_FAILED=10 STATE_FAILED value
                         */
                        Chunk.State = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "STATE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "STATE_PENDING_PROCESSING"] = 1;
                            values[valuesById[2] = "STATE_ACTIVE"] = 2;
                            values[valuesById[10] = "STATE_FAILED"] = 10;
                            return values;
                        })();
    
                        return Chunk;
                    })();
    
                    v1beta.ChunkData = (function() {
    
                        /**
                         * Properties of a ChunkData.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IChunkData
                         * @property {string|null} [stringValue] ChunkData stringValue
                         */
    
                        /**
                         * Constructs a new ChunkData.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ChunkData.
                         * @implements IChunkData
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IChunkData=} [properties] Properties to set
                         */
                        function ChunkData(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ChunkData stringValue.
                         * @member {string|null|undefined} stringValue
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @instance
                         */
                        ChunkData.prototype.stringValue = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * ChunkData data.
                         * @member {"stringValue"|undefined} data
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @instance
                         */
                        Object.defineProperty(ChunkData.prototype, "data", {
                            get: $util.oneOfGetter($oneOfFields = ["stringValue"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new ChunkData instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IChunkData=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ChunkData} ChunkData instance
                         */
                        ChunkData.create = function create(properties) {
                            return new ChunkData(properties);
                        };
    
                        /**
                         * Encodes the specified ChunkData message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ChunkData.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IChunkData} message ChunkData message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ChunkData.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ChunkData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ChunkData.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IChunkData} message ChunkData message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ChunkData.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ChunkData message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ChunkData} ChunkData
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ChunkData.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ChunkData();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.stringValue = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ChunkData message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ChunkData} ChunkData
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ChunkData.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ChunkData message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ChunkData.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                properties.data = 1;
                                if (!$util.isString(message.stringValue))
                                    return "stringValue: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a ChunkData message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ChunkData} ChunkData
                         */
                        ChunkData.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ChunkData)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ChunkData();
                            if (object.stringValue != null)
                                message.stringValue = String(object.stringValue);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ChunkData message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ChunkData} message ChunkData
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ChunkData.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                                object.stringValue = message.stringValue;
                                if (options.oneofs)
                                    object.data = "stringValue";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this ChunkData to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ChunkData.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ChunkData
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ChunkData
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ChunkData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ChunkData";
                        };
    
                        return ChunkData;
                    })();
    
                    v1beta.Model = (function() {
    
                        /**
                         * Properties of a Model.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IModel
                         * @property {string|null} [name] Model name
                         * @property {string|null} [baseModelId] Model baseModelId
                         * @property {string|null} [version] Model version
                         * @property {string|null} [displayName] Model displayName
                         * @property {string|null} [description] Model description
                         * @property {number|null} [inputTokenLimit] Model inputTokenLimit
                         * @property {number|null} [outputTokenLimit] Model outputTokenLimit
                         * @property {Array.<string>|null} [supportedGenerationMethods] Model supportedGenerationMethods
                         * @property {number|null} [temperature] Model temperature
                         * @property {number|null} [maxTemperature] Model maxTemperature
                         * @property {number|null} [topP] Model topP
                         * @property {number|null} [topK] Model topK
                         */
    
                        /**
                         * Constructs a new Model.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Model.
                         * @implements IModel
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IModel=} [properties] Properties to set
                         */
                        function Model(properties) {
                            this.supportedGenerationMethods = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Model name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.name = "";
    
                        /**
                         * Model baseModelId.
                         * @member {string} baseModelId
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.baseModelId = "";
    
                        /**
                         * Model version.
                         * @member {string} version
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.version = "";
    
                        /**
                         * Model displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.displayName = "";
    
                        /**
                         * Model description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.description = "";
    
                        /**
                         * Model inputTokenLimit.
                         * @member {number} inputTokenLimit
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.inputTokenLimit = 0;
    
                        /**
                         * Model outputTokenLimit.
                         * @member {number} outputTokenLimit
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.outputTokenLimit = 0;
    
                        /**
                         * Model supportedGenerationMethods.
                         * @member {Array.<string>} supportedGenerationMethods
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.supportedGenerationMethods = $util.emptyArray;
    
                        /**
                         * Model temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.temperature = null;
    
                        /**
                         * Model maxTemperature.
                         * @member {number|null|undefined} maxTemperature
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.maxTemperature = null;
    
                        /**
                         * Model topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.topP = null;
    
                        /**
                         * Model topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Model.prototype.topK = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Model _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _maxTemperature.
                         * @member {"maxTemperature"|undefined} _maxTemperature
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_maxTemperature", {
                            get: $util.oneOfGetter($oneOfFields = ["maxTemperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Model instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IModel=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Model} Model instance
                         */
                        Model.create = function create(properties) {
                            return new Model(properties);
                        };
    
                        /**
                         * Encodes the specified Model message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Model.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IModel} message Model message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Model.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.baseModelId != null && Object.hasOwnProperty.call(message, "baseModelId"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModelId);
                            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.version);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 5, wireType 2 =*/42).string(message.description);
                            if (message.inputTokenLimit != null && Object.hasOwnProperty.call(message, "inputTokenLimit"))
                                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.inputTokenLimit);
                            if (message.outputTokenLimit != null && Object.hasOwnProperty.call(message, "outputTokenLimit"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.outputTokenLimit);
                            if (message.supportedGenerationMethods != null && message.supportedGenerationMethods.length)
                                for (var i = 0; i < message.supportedGenerationMethods.length; ++i)
                                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.supportedGenerationMethods[i]);
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 9, wireType 5 =*/77).float(message.temperature);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 10, wireType 5 =*/85).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 11, wireType 0 =*/88).int32(message.topK);
                            if (message.maxTemperature != null && Object.hasOwnProperty.call(message, "maxTemperature"))
                                writer.uint32(/* id 13, wireType 5 =*/109).float(message.maxTemperature);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Model message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Model.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IModel} message Model message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Model.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Model message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Model} Model
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Model.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Model();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.baseModelId = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.version = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 5: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.inputTokenLimit = reader.int32();
                                        break;
                                    }
                                case 7: {
                                        message.outputTokenLimit = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        if (!(message.supportedGenerationMethods && message.supportedGenerationMethods.length))
                                            message.supportedGenerationMethods = [];
                                        message.supportedGenerationMethods.push(reader.string());
                                        break;
                                    }
                                case 9: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 13: {
                                        message.maxTemperature = reader.float();
                                        break;
                                    }
                                case 10: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 11: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Model message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Model} Model
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Model.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Model message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Model.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.baseModelId != null && message.hasOwnProperty("baseModelId"))
                                if (!$util.isString(message.baseModelId))
                                    return "baseModelId: string expected";
                            if (message.version != null && message.hasOwnProperty("version"))
                                if (!$util.isString(message.version))
                                    return "version: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit"))
                                if (!$util.isInteger(message.inputTokenLimit))
                                    return "inputTokenLimit: integer expected";
                            if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit"))
                                if (!$util.isInteger(message.outputTokenLimit))
                                    return "outputTokenLimit: integer expected";
                            if (message.supportedGenerationMethods != null && message.hasOwnProperty("supportedGenerationMethods")) {
                                if (!Array.isArray(message.supportedGenerationMethods))
                                    return "supportedGenerationMethods: array expected";
                                for (var i = 0; i < message.supportedGenerationMethods.length; ++i)
                                    if (!$util.isString(message.supportedGenerationMethods[i]))
                                        return "supportedGenerationMethods: string[] expected";
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.maxTemperature != null && message.hasOwnProperty("maxTemperature")) {
                                properties._maxTemperature = 1;
                                if (typeof message.maxTemperature !== "number")
                                    return "maxTemperature: number expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Model message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Model} Model
                         */
                        Model.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Model)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Model();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.baseModelId != null)
                                message.baseModelId = String(object.baseModelId);
                            if (object.version != null)
                                message.version = String(object.version);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.inputTokenLimit != null)
                                message.inputTokenLimit = object.inputTokenLimit | 0;
                            if (object.outputTokenLimit != null)
                                message.outputTokenLimit = object.outputTokenLimit | 0;
                            if (object.supportedGenerationMethods) {
                                if (!Array.isArray(object.supportedGenerationMethods))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Model.supportedGenerationMethods: array expected");
                                message.supportedGenerationMethods = [];
                                for (var i = 0; i < object.supportedGenerationMethods.length; ++i)
                                    message.supportedGenerationMethods[i] = String(object.supportedGenerationMethods[i]);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.maxTemperature != null)
                                message.maxTemperature = Number(object.maxTemperature);
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Model message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Model} message Model
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Model.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.supportedGenerationMethods = [];
                            if (options.defaults) {
                                object.name = "";
                                object.baseModelId = "";
                                object.version = "";
                                object.displayName = "";
                                object.description = "";
                                object.inputTokenLimit = 0;
                                object.outputTokenLimit = 0;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.baseModelId != null && message.hasOwnProperty("baseModelId"))
                                object.baseModelId = message.baseModelId;
                            if (message.version != null && message.hasOwnProperty("version"))
                                object.version = message.version;
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit"))
                                object.inputTokenLimit = message.inputTokenLimit;
                            if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit"))
                                object.outputTokenLimit = message.outputTokenLimit;
                            if (message.supportedGenerationMethods && message.supportedGenerationMethods.length) {
                                object.supportedGenerationMethods = [];
                                for (var j = 0; j < message.supportedGenerationMethods.length; ++j)
                                    object.supportedGenerationMethods[j] = message.supportedGenerationMethods[j];
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.maxTemperature != null && message.hasOwnProperty("maxTemperature")) {
                                object.maxTemperature = options.json && !isFinite(message.maxTemperature) ? String(message.maxTemperature) : message.maxTemperature;
                                if (options.oneofs)
                                    object._maxTemperature = "maxTemperature";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Model to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Model.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Model
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Model
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Model";
                        };
    
                        return Model;
                    })();
    
                    v1beta.ModelService = (function() {
    
                        /**
                         * Constructs a new ModelService service.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ModelService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function ModelService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (ModelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ModelService;
    
                        /**
                         * Creates new ModelService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {ModelService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        ModelService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.ModelService|getModel}.
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @typedef GetModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Model} [response] Model
                         */
    
                        /**
                         * Calls GetModel.
                         * @function getModel
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetModelRequest} request GetModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.ModelService.GetModelCallback} callback Node-style callback called with the error, if any, and Model
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.getModel = function getModel(request, callback) {
                            return this.rpcCall(getModel, $root.google.ai.generativelanguage.v1beta.GetModelRequest, $root.google.ai.generativelanguage.v1beta.Model, request, callback);
                        }, "name", { value: "GetModel" });
    
                        /**
                         * Calls GetModel.
                         * @function getModel
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetModelRequest} request GetModelRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Model>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.ModelService|listModels}.
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @typedef ListModelsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.ListModelsResponse} [response] ListModelsResponse
                         */
    
                        /**
                         * Calls ListModels.
                         * @function listModels
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListModelsRequest} request ListModelsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.ModelService.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.listModels = function listModels(request, callback) {
                            return this.rpcCall(listModels, $root.google.ai.generativelanguage.v1beta.ListModelsRequest, $root.google.ai.generativelanguage.v1beta.ListModelsResponse, request, callback);
                        }, "name", { value: "ListModels" });
    
                        /**
                         * Calls ListModels.
                         * @function listModels
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListModelsRequest} request ListModelsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.ListModelsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.ModelService|getTunedModel}.
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @typedef GetTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.TunedModel} [response] TunedModel
                         */
    
                        /**
                         * Calls GetTunedModel.
                         * @function getTunedModel
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetTunedModelRequest} request GetTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.ModelService.GetTunedModelCallback} callback Node-style callback called with the error, if any, and TunedModel
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.getTunedModel = function getTunedModel(request, callback) {
                            return this.rpcCall(getTunedModel, $root.google.ai.generativelanguage.v1beta.GetTunedModelRequest, $root.google.ai.generativelanguage.v1beta.TunedModel, request, callback);
                        }, "name", { value: "GetTunedModel" });
    
                        /**
                         * Calls GetTunedModel.
                         * @function getTunedModel
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetTunedModelRequest} request GetTunedModelRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.TunedModel>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.ModelService|listTunedModels}.
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @typedef ListTunedModelsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.ListTunedModelsResponse} [response] ListTunedModelsResponse
                         */
    
                        /**
                         * Calls ListTunedModels.
                         * @function listTunedModels
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListTunedModelsRequest} request ListTunedModelsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.ModelService.ListTunedModelsCallback} callback Node-style callback called with the error, if any, and ListTunedModelsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.listTunedModels = function listTunedModels(request, callback) {
                            return this.rpcCall(listTunedModels, $root.google.ai.generativelanguage.v1beta.ListTunedModelsRequest, $root.google.ai.generativelanguage.v1beta.ListTunedModelsResponse, request, callback);
                        }, "name", { value: "ListTunedModels" });
    
                        /**
                         * Calls ListTunedModels.
                         * @function listTunedModels
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListTunedModelsRequest} request ListTunedModelsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.ListTunedModelsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.ModelService|createTunedModel}.
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @typedef CreateTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.longrunning.Operation} [response] Operation
                         */
    
                        /**
                         * Calls CreateTunedModel.
                         * @function createTunedModel
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateTunedModelRequest} request CreateTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.ModelService.CreateTunedModelCallback} callback Node-style callback called with the error, if any, and Operation
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.createTunedModel = function createTunedModel(request, callback) {
                            return this.rpcCall(createTunedModel, $root.google.ai.generativelanguage.v1beta.CreateTunedModelRequest, $root.google.longrunning.Operation, request, callback);
                        }, "name", { value: "CreateTunedModel" });
    
                        /**
                         * Calls CreateTunedModel.
                         * @function createTunedModel
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateTunedModelRequest} request CreateTunedModelRequest message or plain object
                         * @returns {Promise<google.longrunning.Operation>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.ModelService|updateTunedModel}.
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @typedef UpdateTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.TunedModel} [response] TunedModel
                         */
    
                        /**
                         * Calls UpdateTunedModel.
                         * @function updateTunedModel
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdateTunedModelRequest} request UpdateTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.ModelService.UpdateTunedModelCallback} callback Node-style callback called with the error, if any, and TunedModel
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.updateTunedModel = function updateTunedModel(request, callback) {
                            return this.rpcCall(updateTunedModel, $root.google.ai.generativelanguage.v1beta.UpdateTunedModelRequest, $root.google.ai.generativelanguage.v1beta.TunedModel, request, callback);
                        }, "name", { value: "UpdateTunedModel" });
    
                        /**
                         * Calls UpdateTunedModel.
                         * @function updateTunedModel
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdateTunedModelRequest} request UpdateTunedModelRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.TunedModel>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.ModelService|deleteTunedModel}.
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @typedef DeleteTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteTunedModel.
                         * @function deleteTunedModel
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteTunedModelRequest} request DeleteTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.ModelService.DeleteTunedModelCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.deleteTunedModel = function deleteTunedModel(request, callback) {
                            return this.rpcCall(deleteTunedModel, $root.google.ai.generativelanguage.v1beta.DeleteTunedModelRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteTunedModel" });
    
                        /**
                         * Calls DeleteTunedModel.
                         * @function deleteTunedModel
                         * @memberof google.ai.generativelanguage.v1beta.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteTunedModelRequest} request DeleteTunedModelRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        return ModelService;
                    })();
    
                    v1beta.GetModelRequest = (function() {
    
                        /**
                         * Properties of a GetModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGetModelRequest
                         * @property {string|null} [name] GetModelRequest name
                         */
    
                        /**
                         * Constructs a new GetModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GetModelRequest.
                         * @implements IGetModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGetModelRequest=} [properties] Properties to set
                         */
                        function GetModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetModelRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.GetModelRequest
                         * @instance
                         */
                        GetModelRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GetModelRequest} GetModelRequest instance
                         */
                        GetModelRequest.create = function create(properties) {
                            return new GetModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetModelRequest} message GetModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetModelRequest} message GetModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GetModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GetModelRequest} GetModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GetModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GetModelRequest} GetModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GetModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GetModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GetModelRequest} GetModelRequest
                         */
                        GetModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GetModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GetModelRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GetModelRequest} message GetModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GetModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GetModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetModelRequest";
                        };
    
                        return GetModelRequest;
                    })();
    
                    v1beta.ListModelsRequest = (function() {
    
                        /**
                         * Properties of a ListModelsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListModelsRequest
                         * @property {number|null} [pageSize] ListModelsRequest pageSize
                         * @property {string|null} [pageToken] ListModelsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListModelsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListModelsRequest.
                         * @implements IListModelsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListModelsRequest=} [properties] Properties to set
                         */
                        function ListModelsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListModelsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @instance
                         */
                        ListModelsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListModelsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @instance
                         */
                        ListModelsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListModelsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListModelsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListModelsRequest} ListModelsRequest instance
                         */
                        ListModelsRequest.create = function create(properties) {
                            return new ListModelsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListModelsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListModelsRequest} message ListModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListModelsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListModelsRequest} message ListModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListModelsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListModelsRequest} ListModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListModelsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListModelsRequest} ListModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListModelsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListModelsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListModelsRequest} ListModelsRequest
                         */
                        ListModelsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListModelsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListModelsRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListModelsRequest} message ListModelsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListModelsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListModelsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListModelsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListModelsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListModelsRequest";
                        };
    
                        return ListModelsRequest;
                    })();
    
                    v1beta.ListModelsResponse = (function() {
    
                        /**
                         * Properties of a ListModelsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListModelsResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IModel>|null} [models] ListModelsResponse models
                         * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListModelsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListModelsResponse.
                         * @implements IListModelsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListModelsResponse=} [properties] Properties to set
                         */
                        function ListModelsResponse(properties) {
                            this.models = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListModelsResponse models.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IModel>} models
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @instance
                         */
                        ListModelsResponse.prototype.models = $util.emptyArray;
    
                        /**
                         * ListModelsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @instance
                         */
                        ListModelsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListModelsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListModelsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListModelsResponse} ListModelsResponse instance
                         */
                        ListModelsResponse.create = function create(properties) {
                            return new ListModelsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListModelsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListModelsResponse} message ListModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.models != null && message.models.length)
                                for (var i = 0; i < message.models.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Model.encode(message.models[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListModelsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListModelsResponse} message ListModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListModelsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListModelsResponse} ListModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListModelsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.models && message.models.length))
                                            message.models = [];
                                        message.models.push($root.google.ai.generativelanguage.v1beta.Model.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListModelsResponse} ListModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListModelsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListModelsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.models != null && message.hasOwnProperty("models")) {
                                if (!Array.isArray(message.models))
                                    return "models: array expected";
                                for (var i = 0; i < message.models.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Model.verify(message.models[i]);
                                    if (error)
                                        return "models." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListModelsResponse} ListModelsResponse
                         */
                        ListModelsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListModelsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListModelsResponse();
                            if (object.models) {
                                if (!Array.isArray(object.models))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.ListModelsResponse.models: array expected");
                                message.models = [];
                                for (var i = 0; i < object.models.length; ++i) {
                                    if (typeof object.models[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.ListModelsResponse.models: object expected");
                                    message.models[i] = $root.google.ai.generativelanguage.v1beta.Model.fromObject(object.models[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListModelsResponse} message ListModelsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListModelsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.models = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.models && message.models.length) {
                                object.models = [];
                                for (var j = 0; j < message.models.length; ++j)
                                    object.models[j] = $root.google.ai.generativelanguage.v1beta.Model.toObject(message.models[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListModelsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListModelsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListModelsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListModelsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListModelsResponse";
                        };
    
                        return ListModelsResponse;
                    })();
    
                    v1beta.GetTunedModelRequest = (function() {
    
                        /**
                         * Properties of a GetTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGetTunedModelRequest
                         * @property {string|null} [name] GetTunedModelRequest name
                         */
    
                        /**
                         * Constructs a new GetTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GetTunedModelRequest.
                         * @implements IGetTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGetTunedModelRequest=} [properties] Properties to set
                         */
                        function GetTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetTunedModelRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.GetTunedModelRequest
                         * @instance
                         */
                        GetTunedModelRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GetTunedModelRequest} GetTunedModelRequest instance
                         */
                        GetTunedModelRequest.create = function create(properties) {
                            return new GetTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetTunedModelRequest} message GetTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetTunedModelRequest} message GetTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GetTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GetTunedModelRequest} GetTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GetTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GetTunedModelRequest} GetTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GetTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GetTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GetTunedModelRequest} GetTunedModelRequest
                         */
                        GetTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GetTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GetTunedModelRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GetTunedModelRequest} message GetTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GetTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GetTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetTunedModelRequest";
                        };
    
                        return GetTunedModelRequest;
                    })();
    
                    v1beta.ListTunedModelsRequest = (function() {
    
                        /**
                         * Properties of a ListTunedModelsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListTunedModelsRequest
                         * @property {number|null} [pageSize] ListTunedModelsRequest pageSize
                         * @property {string|null} [pageToken] ListTunedModelsRequest pageToken
                         * @property {string|null} [filter] ListTunedModelsRequest filter
                         */
    
                        /**
                         * Constructs a new ListTunedModelsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListTunedModelsRequest.
                         * @implements IListTunedModelsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListTunedModelsRequest=} [properties] Properties to set
                         */
                        function ListTunedModelsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListTunedModelsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @instance
                         */
                        ListTunedModelsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListTunedModelsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @instance
                         */
                        ListTunedModelsRequest.prototype.pageToken = "";
    
                        /**
                         * ListTunedModelsRequest filter.
                         * @member {string} filter
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @instance
                         */
                        ListTunedModelsRequest.prototype.filter = "";
    
                        /**
                         * Creates a new ListTunedModelsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListTunedModelsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListTunedModelsRequest} ListTunedModelsRequest instance
                         */
                        ListTunedModelsRequest.create = function create(properties) {
                            return new ListTunedModelsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListTunedModelsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListTunedModelsRequest} message ListTunedModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken);
                            if (message.filter != null && Object.hasOwnProperty.call(message, "filter"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListTunedModelsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListTunedModelsRequest} message ListTunedModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListTunedModelsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListTunedModelsRequest} ListTunedModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListTunedModelsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.filter = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListTunedModelsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListTunedModelsRequest} ListTunedModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListTunedModelsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListTunedModelsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            if (message.filter != null && message.hasOwnProperty("filter"))
                                if (!$util.isString(message.filter))
                                    return "filter: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListTunedModelsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListTunedModelsRequest} ListTunedModelsRequest
                         */
                        ListTunedModelsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListTunedModelsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListTunedModelsRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            if (object.filter != null)
                                message.filter = String(object.filter);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListTunedModelsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListTunedModelsRequest} message ListTunedModelsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListTunedModelsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                                object.filter = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            if (message.filter != null && message.hasOwnProperty("filter"))
                                object.filter = message.filter;
                            return object;
                        };
    
                        /**
                         * Converts this ListTunedModelsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListTunedModelsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListTunedModelsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListTunedModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListTunedModelsRequest";
                        };
    
                        return ListTunedModelsRequest;
                    })();
    
                    v1beta.ListTunedModelsResponse = (function() {
    
                        /**
                         * Properties of a ListTunedModelsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListTunedModelsResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.ITunedModel>|null} [tunedModels] ListTunedModelsResponse tunedModels
                         * @property {string|null} [nextPageToken] ListTunedModelsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListTunedModelsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListTunedModelsResponse.
                         * @implements IListTunedModelsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListTunedModelsResponse=} [properties] Properties to set
                         */
                        function ListTunedModelsResponse(properties) {
                            this.tunedModels = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListTunedModelsResponse tunedModels.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ITunedModel>} tunedModels
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @instance
                         */
                        ListTunedModelsResponse.prototype.tunedModels = $util.emptyArray;
    
                        /**
                         * ListTunedModelsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @instance
                         */
                        ListTunedModelsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListTunedModelsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListTunedModelsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListTunedModelsResponse} ListTunedModelsResponse instance
                         */
                        ListTunedModelsResponse.create = function create(properties) {
                            return new ListTunedModelsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListTunedModelsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListTunedModelsResponse} message ListTunedModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModels != null && message.tunedModels.length)
                                for (var i = 0; i < message.tunedModels.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.TunedModel.encode(message.tunedModels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListTunedModelsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListTunedModelsResponse} message ListTunedModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListTunedModelsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListTunedModelsResponse} ListTunedModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListTunedModelsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.tunedModels && message.tunedModels.length))
                                            message.tunedModels = [];
                                        message.tunedModels.push($root.google.ai.generativelanguage.v1beta.TunedModel.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListTunedModelsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListTunedModelsResponse} ListTunedModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListTunedModelsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListTunedModelsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModels != null && message.hasOwnProperty("tunedModels")) {
                                if (!Array.isArray(message.tunedModels))
                                    return "tunedModels: array expected";
                                for (var i = 0; i < message.tunedModels.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.TunedModel.verify(message.tunedModels[i]);
                                    if (error)
                                        return "tunedModels." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListTunedModelsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListTunedModelsResponse} ListTunedModelsResponse
                         */
                        ListTunedModelsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListTunedModelsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListTunedModelsResponse();
                            if (object.tunedModels) {
                                if (!Array.isArray(object.tunedModels))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.ListTunedModelsResponse.tunedModels: array expected");
                                message.tunedModels = [];
                                for (var i = 0; i < object.tunedModels.length; ++i) {
                                    if (typeof object.tunedModels[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.ListTunedModelsResponse.tunedModels: object expected");
                                    message.tunedModels[i] = $root.google.ai.generativelanguage.v1beta.TunedModel.fromObject(object.tunedModels[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListTunedModelsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListTunedModelsResponse} message ListTunedModelsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListTunedModelsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.tunedModels = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.tunedModels && message.tunedModels.length) {
                                object.tunedModels = [];
                                for (var j = 0; j < message.tunedModels.length; ++j)
                                    object.tunedModels[j] = $root.google.ai.generativelanguage.v1beta.TunedModel.toObject(message.tunedModels[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListTunedModelsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListTunedModelsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListTunedModelsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListTunedModelsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListTunedModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListTunedModelsResponse";
                        };
    
                        return ListTunedModelsResponse;
                    })();
    
                    v1beta.CreateTunedModelRequest = (function() {
    
                        /**
                         * Properties of a CreateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICreateTunedModelRequest
                         * @property {string|null} [tunedModelId] CreateTunedModelRequest tunedModelId
                         * @property {google.ai.generativelanguage.v1beta.ITunedModel|null} [tunedModel] CreateTunedModelRequest tunedModel
                         */
    
                        /**
                         * Constructs a new CreateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CreateTunedModelRequest.
                         * @implements ICreateTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICreateTunedModelRequest=} [properties] Properties to set
                         */
                        function CreateTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateTunedModelRequest tunedModelId.
                         * @member {string|null|undefined} tunedModelId
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @instance
                         */
                        CreateTunedModelRequest.prototype.tunedModelId = null;
    
                        /**
                         * CreateTunedModelRequest tunedModel.
                         * @member {google.ai.generativelanguage.v1beta.ITunedModel|null|undefined} tunedModel
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @instance
                         */
                        CreateTunedModelRequest.prototype.tunedModel = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CreateTunedModelRequest _tunedModelId.
                         * @member {"tunedModelId"|undefined} _tunedModelId
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @instance
                         */
                        Object.defineProperty(CreateTunedModelRequest.prototype, "_tunedModelId", {
                            get: $util.oneOfGetter($oneOfFields = ["tunedModelId"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CreateTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CreateTunedModelRequest} CreateTunedModelRequest instance
                         */
                        CreateTunedModelRequest.create = function create(properties) {
                            return new CreateTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateTunedModelRequest} message CreateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModelId != null && Object.hasOwnProperty.call(message, "tunedModelId"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModelId);
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                $root.google.ai.generativelanguage.v1beta.TunedModel.encode(message.tunedModel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateTunedModelRequest} message CreateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CreateTunedModelRequest} CreateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CreateTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tunedModelId = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.tunedModel = $root.google.ai.generativelanguage.v1beta.TunedModel.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CreateTunedModelRequest} CreateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.tunedModelId != null && message.hasOwnProperty("tunedModelId")) {
                                properties._tunedModelId = 1;
                                if (!$util.isString(message.tunedModelId))
                                    return "tunedModelId: string expected";
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) {
                                var error = $root.google.ai.generativelanguage.v1beta.TunedModel.verify(message.tunedModel);
                                if (error)
                                    return "tunedModel." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CreateTunedModelRequest} CreateTunedModelRequest
                         */
                        CreateTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CreateTunedModelRequest();
                            if (object.tunedModelId != null)
                                message.tunedModelId = String(object.tunedModelId);
                            if (object.tunedModel != null) {
                                if (typeof object.tunedModel !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CreateTunedModelRequest.tunedModel: object expected");
                                message.tunedModel = $root.google.ai.generativelanguage.v1beta.TunedModel.fromObject(object.tunedModel);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CreateTunedModelRequest} message CreateTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.tunedModel = null;
                            if (message.tunedModelId != null && message.hasOwnProperty("tunedModelId")) {
                                object.tunedModelId = message.tunedModelId;
                                if (options.oneofs)
                                    object._tunedModelId = "tunedModelId";
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = $root.google.ai.generativelanguage.v1beta.TunedModel.toObject(message.tunedModel, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateTunedModelRequest";
                        };
    
                        return CreateTunedModelRequest;
                    })();
    
                    v1beta.CreateTunedModelMetadata = (function() {
    
                        /**
                         * Properties of a CreateTunedModelMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICreateTunedModelMetadata
                         * @property {string|null} [tunedModel] CreateTunedModelMetadata tunedModel
                         * @property {number|null} [totalSteps] CreateTunedModelMetadata totalSteps
                         * @property {number|null} [completedSteps] CreateTunedModelMetadata completedSteps
                         * @property {number|null} [completedPercent] CreateTunedModelMetadata completedPercent
                         * @property {Array.<google.ai.generativelanguage.v1beta.ITuningSnapshot>|null} [snapshots] CreateTunedModelMetadata snapshots
                         */
    
                        /**
                         * Constructs a new CreateTunedModelMetadata.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CreateTunedModelMetadata.
                         * @implements ICreateTunedModelMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICreateTunedModelMetadata=} [properties] Properties to set
                         */
                        function CreateTunedModelMetadata(properties) {
                            this.snapshots = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateTunedModelMetadata tunedModel.
                         * @member {string} tunedModel
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.tunedModel = "";
    
                        /**
                         * CreateTunedModelMetadata totalSteps.
                         * @member {number} totalSteps
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.totalSteps = 0;
    
                        /**
                         * CreateTunedModelMetadata completedSteps.
                         * @member {number} completedSteps
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.completedSteps = 0;
    
                        /**
                         * CreateTunedModelMetadata completedPercent.
                         * @member {number} completedPercent
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.completedPercent = 0;
    
                        /**
                         * CreateTunedModelMetadata snapshots.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ITuningSnapshot>} snapshots
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.snapshots = $util.emptyArray;
    
                        /**
                         * Creates a new CreateTunedModelMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateTunedModelMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CreateTunedModelMetadata} CreateTunedModelMetadata instance
                         */
                        CreateTunedModelMetadata.create = function create(properties) {
                            return new CreateTunedModelMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateTunedModelMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateTunedModelMetadata} message CreateTunedModelMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.totalSteps != null && Object.hasOwnProperty.call(message, "totalSteps"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalSteps);
                            if (message.completedSteps != null && Object.hasOwnProperty.call(message, "completedSteps"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.completedSteps);
                            if (message.completedPercent != null && Object.hasOwnProperty.call(message, "completedPercent"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.completedPercent);
                            if (message.snapshots != null && message.snapshots.length)
                                for (var i = 0; i < message.snapshots.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.TuningSnapshot.encode(message.snapshots[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                writer.uint32(/* id 5, wireType 2 =*/42).string(message.tunedModel);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateTunedModelMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateTunedModelMetadata} message CreateTunedModelMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateTunedModelMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CreateTunedModelMetadata} CreateTunedModelMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CreateTunedModelMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 5: {
                                        message.tunedModel = reader.string();
                                        break;
                                    }
                                case 1: {
                                        message.totalSteps = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.completedSteps = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.completedPercent = reader.float();
                                        break;
                                    }
                                case 4: {
                                        if (!(message.snapshots && message.snapshots.length))
                                            message.snapshots = [];
                                        message.snapshots.push($root.google.ai.generativelanguage.v1beta.TuningSnapshot.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateTunedModelMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CreateTunedModelMetadata} CreateTunedModelMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateTunedModelMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateTunedModelMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                if (!$util.isString(message.tunedModel))
                                    return "tunedModel: string expected";
                            if (message.totalSteps != null && message.hasOwnProperty("totalSteps"))
                                if (!$util.isInteger(message.totalSteps))
                                    return "totalSteps: integer expected";
                            if (message.completedSteps != null && message.hasOwnProperty("completedSteps"))
                                if (!$util.isInteger(message.completedSteps))
                                    return "completedSteps: integer expected";
                            if (message.completedPercent != null && message.hasOwnProperty("completedPercent"))
                                if (typeof message.completedPercent !== "number")
                                    return "completedPercent: number expected";
                            if (message.snapshots != null && message.hasOwnProperty("snapshots")) {
                                if (!Array.isArray(message.snapshots))
                                    return "snapshots: array expected";
                                for (var i = 0; i < message.snapshots.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.TuningSnapshot.verify(message.snapshots[i]);
                                    if (error)
                                        return "snapshots." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateTunedModelMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CreateTunedModelMetadata} CreateTunedModelMetadata
                         */
                        CreateTunedModelMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateTunedModelMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CreateTunedModelMetadata();
                            if (object.tunedModel != null)
                                message.tunedModel = String(object.tunedModel);
                            if (object.totalSteps != null)
                                message.totalSteps = object.totalSteps | 0;
                            if (object.completedSteps != null)
                                message.completedSteps = object.completedSteps | 0;
                            if (object.completedPercent != null)
                                message.completedPercent = Number(object.completedPercent);
                            if (object.snapshots) {
                                if (!Array.isArray(object.snapshots))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CreateTunedModelMetadata.snapshots: array expected");
                                message.snapshots = [];
                                for (var i = 0; i < object.snapshots.length; ++i) {
                                    if (typeof object.snapshots[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.CreateTunedModelMetadata.snapshots: object expected");
                                    message.snapshots[i] = $root.google.ai.generativelanguage.v1beta.TuningSnapshot.fromObject(object.snapshots[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateTunedModelMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CreateTunedModelMetadata} message CreateTunedModelMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateTunedModelMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.snapshots = [];
                            if (options.defaults) {
                                object.totalSteps = 0;
                                object.completedSteps = 0;
                                object.completedPercent = 0;
                                object.tunedModel = "";
                            }
                            if (message.totalSteps != null && message.hasOwnProperty("totalSteps"))
                                object.totalSteps = message.totalSteps;
                            if (message.completedSteps != null && message.hasOwnProperty("completedSteps"))
                                object.completedSteps = message.completedSteps;
                            if (message.completedPercent != null && message.hasOwnProperty("completedPercent"))
                                object.completedPercent = options.json && !isFinite(message.completedPercent) ? String(message.completedPercent) : message.completedPercent;
                            if (message.snapshots && message.snapshots.length) {
                                object.snapshots = [];
                                for (var j = 0; j < message.snapshots.length; ++j)
                                    object.snapshots[j] = $root.google.ai.generativelanguage.v1beta.TuningSnapshot.toObject(message.snapshots[j], options);
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = message.tunedModel;
                            return object;
                        };
    
                        /**
                         * Converts this CreateTunedModelMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateTunedModelMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateTunedModelMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateTunedModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateTunedModelMetadata";
                        };
    
                        return CreateTunedModelMetadata;
                    })();
    
                    v1beta.UpdateTunedModelRequest = (function() {
    
                        /**
                         * Properties of an UpdateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IUpdateTunedModelRequest
                         * @property {google.ai.generativelanguage.v1beta.ITunedModel|null} [tunedModel] UpdateTunedModelRequest tunedModel
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTunedModelRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an UpdateTunedModelRequest.
                         * @implements IUpdateTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IUpdateTunedModelRequest=} [properties] Properties to set
                         */
                        function UpdateTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdateTunedModelRequest tunedModel.
                         * @member {google.ai.generativelanguage.v1beta.ITunedModel|null|undefined} tunedModel
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @instance
                         */
                        UpdateTunedModelRequest.prototype.tunedModel = null;
    
                        /**
                         * UpdateTunedModelRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @instance
                         */
                        UpdateTunedModelRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdateTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.UpdateTunedModelRequest} UpdateTunedModelRequest instance
                         */
                        UpdateTunedModelRequest.create = function create(properties) {
                            return new UpdateTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateTunedModelRequest} message UpdateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                $root.google.ai.generativelanguage.v1beta.TunedModel.encode(message.tunedModel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateTunedModelRequest} message UpdateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdateTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.UpdateTunedModelRequest} UpdateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.UpdateTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tunedModel = $root.google.ai.generativelanguage.v1beta.TunedModel.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdateTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.UpdateTunedModelRequest} UpdateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdateTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdateTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) {
                                var error = $root.google.ai.generativelanguage.v1beta.TunedModel.verify(message.tunedModel);
                                if (error)
                                    return "tunedModel." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdateTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.UpdateTunedModelRequest} UpdateTunedModelRequest
                         */
                        UpdateTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.UpdateTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.UpdateTunedModelRequest();
                            if (object.tunedModel != null) {
                                if (typeof object.tunedModel !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdateTunedModelRequest.tunedModel: object expected");
                                message.tunedModel = $root.google.ai.generativelanguage.v1beta.TunedModel.fromObject(object.tunedModel);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdateTunedModelRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdateTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.UpdateTunedModelRequest} message UpdateTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdateTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.tunedModel = null;
                                object.updateMask = null;
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = $root.google.ai.generativelanguage.v1beta.TunedModel.toObject(message.tunedModel, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdateTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdateTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdateTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdateTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.UpdateTunedModelRequest";
                        };
    
                        return UpdateTunedModelRequest;
                    })();
    
                    v1beta.DeleteTunedModelRequest = (function() {
    
                        /**
                         * Properties of a DeleteTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IDeleteTunedModelRequest
                         * @property {string|null} [name] DeleteTunedModelRequest name
                         */
    
                        /**
                         * Constructs a new DeleteTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a DeleteTunedModelRequest.
                         * @implements IDeleteTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IDeleteTunedModelRequest=} [properties] Properties to set
                         */
                        function DeleteTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteTunedModelRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
                         * @instance
                         */
                        DeleteTunedModelRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeleteTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.DeleteTunedModelRequest} DeleteTunedModelRequest instance
                         */
                        DeleteTunedModelRequest.create = function create(properties) {
                            return new DeleteTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteTunedModelRequest} message DeleteTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteTunedModelRequest} message DeleteTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.DeleteTunedModelRequest} DeleteTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.DeleteTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.DeleteTunedModelRequest} DeleteTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.DeleteTunedModelRequest} DeleteTunedModelRequest
                         */
                        DeleteTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.DeleteTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.DeleteTunedModelRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.DeleteTunedModelRequest} message DeleteTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DeleteTunedModelRequest";
                        };
    
                        return DeleteTunedModelRequest;
                    })();
    
                    v1beta.TunedModel = (function() {
    
                        /**
                         * Properties of a TunedModel.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ITunedModel
                         * @property {google.ai.generativelanguage.v1beta.ITunedModelSource|null} [tunedModelSource] TunedModel tunedModelSource
                         * @property {string|null} [baseModel] TunedModel baseModel
                         * @property {string|null} [name] TunedModel name
                         * @property {string|null} [displayName] TunedModel displayName
                         * @property {string|null} [description] TunedModel description
                         * @property {number|null} [temperature] TunedModel temperature
                         * @property {number|null} [topP] TunedModel topP
                         * @property {number|null} [topK] TunedModel topK
                         * @property {google.ai.generativelanguage.v1beta.TunedModel.State|null} [state] TunedModel state
                         * @property {google.protobuf.ITimestamp|null} [createTime] TunedModel createTime
                         * @property {google.protobuf.ITimestamp|null} [updateTime] TunedModel updateTime
                         * @property {google.ai.generativelanguage.v1beta.ITuningTask|null} [tuningTask] TunedModel tuningTask
                         * @property {Array.<number|Long>|null} [readerProjectNumbers] TunedModel readerProjectNumbers
                         */
    
                        /**
                         * Constructs a new TunedModel.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a TunedModel.
                         * @implements ITunedModel
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ITunedModel=} [properties] Properties to set
                         */
                        function TunedModel(properties) {
                            this.readerProjectNumbers = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TunedModel tunedModelSource.
                         * @member {google.ai.generativelanguage.v1beta.ITunedModelSource|null|undefined} tunedModelSource
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.tunedModelSource = null;
    
                        /**
                         * TunedModel baseModel.
                         * @member {string|null|undefined} baseModel
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.baseModel = null;
    
                        /**
                         * TunedModel name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.name = "";
    
                        /**
                         * TunedModel displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.displayName = "";
    
                        /**
                         * TunedModel description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.description = "";
    
                        /**
                         * TunedModel temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.temperature = null;
    
                        /**
                         * TunedModel topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.topP = null;
    
                        /**
                         * TunedModel topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.topK = null;
    
                        /**
                         * TunedModel state.
                         * @member {google.ai.generativelanguage.v1beta.TunedModel.State} state
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.state = 0;
    
                        /**
                         * TunedModel createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.createTime = null;
    
                        /**
                         * TunedModel updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.updateTime = null;
    
                        /**
                         * TunedModel tuningTask.
                         * @member {google.ai.generativelanguage.v1beta.ITuningTask|null|undefined} tuningTask
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.tuningTask = null;
    
                        /**
                         * TunedModel readerProjectNumbers.
                         * @member {Array.<number|Long>} readerProjectNumbers
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.readerProjectNumbers = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TunedModel sourceModel.
                         * @member {"tunedModelSource"|"baseModel"|undefined} sourceModel
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "sourceModel", {
                            get: $util.oneOfGetter($oneOfFields = ["tunedModelSource", "baseModel"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * TunedModel _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * TunedModel _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * TunedModel _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TunedModel instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITunedModel=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.TunedModel} TunedModel instance
                         */
                        TunedModel.create = function create(properties) {
                            return new TunedModel(properties);
                        };
    
                        /**
                         * Encodes the specified TunedModel message. Does not implicitly {@link google.ai.generativelanguage.v1beta.TunedModel.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITunedModel} message TunedModel message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModel.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.tunedModelSource != null && Object.hasOwnProperty.call(message, "tunedModelSource"))
                                $root.google.ai.generativelanguage.v1beta.TunedModelSource.encode(message.tunedModelSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.baseModel);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 6, wireType 2 =*/50).string(message.description);
                            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state);
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                            if (message.tuningTask != null && Object.hasOwnProperty.call(message, "tuningTask"))
                                $root.google.ai.generativelanguage.v1beta.TuningTask.encode(message.tuningTask, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 11, wireType 5 =*/93).float(message.temperature);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 12, wireType 5 =*/101).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 13, wireType 0 =*/104).int32(message.topK);
                            if (message.readerProjectNumbers != null && message.readerProjectNumbers.length) {
                                writer.uint32(/* id 14, wireType 2 =*/114).fork();
                                for (var i = 0; i < message.readerProjectNumbers.length; ++i)
                                    writer.int64(message.readerProjectNumbers[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TunedModel message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.TunedModel.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITunedModel} message TunedModel message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModel.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TunedModel message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.TunedModel} TunedModel
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModel.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.TunedModel();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.tunedModelSource = $root.google.ai.generativelanguage.v1beta.TunedModelSource.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.baseModel = reader.string();
                                        break;
                                    }
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 5: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 11: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 12: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 13: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                case 7: {
                                        message.state = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 9: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 10: {
                                        message.tuningTask = $root.google.ai.generativelanguage.v1beta.TuningTask.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 14: {
                                        if (!(message.readerProjectNumbers && message.readerProjectNumbers.length))
                                            message.readerProjectNumbers = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.readerProjectNumbers.push(reader.int64());
                                        } else
                                            message.readerProjectNumbers.push(reader.int64());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TunedModel message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.TunedModel} TunedModel
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModel.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TunedModel message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TunedModel.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.tunedModelSource != null && message.hasOwnProperty("tunedModelSource")) {
                                properties.sourceModel = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.TunedModelSource.verify(message.tunedModelSource);
                                    if (error)
                                        return "tunedModelSource." + error;
                                }
                            }
                            if (message.baseModel != null && message.hasOwnProperty("baseModel")) {
                                if (properties.sourceModel === 1)
                                    return "sourceModel: multiple values";
                                properties.sourceModel = 1;
                                if (!$util.isString(message.baseModel))
                                    return "baseModel: string expected";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            if (message.state != null && message.hasOwnProperty("state"))
                                switch (message.state) {
                                default:
                                    return "state: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            if (message.tuningTask != null && message.hasOwnProperty("tuningTask")) {
                                var error = $root.google.ai.generativelanguage.v1beta.TuningTask.verify(message.tuningTask);
                                if (error)
                                    return "tuningTask." + error;
                            }
                            if (message.readerProjectNumbers != null && message.hasOwnProperty("readerProjectNumbers")) {
                                if (!Array.isArray(message.readerProjectNumbers))
                                    return "readerProjectNumbers: array expected";
                                for (var i = 0; i < message.readerProjectNumbers.length; ++i)
                                    if (!$util.isInteger(message.readerProjectNumbers[i]) && !(message.readerProjectNumbers[i] && $util.isInteger(message.readerProjectNumbers[i].low) && $util.isInteger(message.readerProjectNumbers[i].high)))
                                        return "readerProjectNumbers: integer|Long[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TunedModel message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.TunedModel} TunedModel
                         */
                        TunedModel.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.TunedModel)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.TunedModel();
                            if (object.tunedModelSource != null) {
                                if (typeof object.tunedModelSource !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TunedModel.tunedModelSource: object expected");
                                message.tunedModelSource = $root.google.ai.generativelanguage.v1beta.TunedModelSource.fromObject(object.tunedModelSource);
                            }
                            if (object.baseModel != null)
                                message.baseModel = String(object.baseModel);
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            switch (object.state) {
                            default:
                                if (typeof object.state === "number") {
                                    message.state = object.state;
                                    break;
                                }
                                break;
                            case "STATE_UNSPECIFIED":
                            case 0:
                                message.state = 0;
                                break;
                            case "CREATING":
                            case 1:
                                message.state = 1;
                                break;
                            case "ACTIVE":
                            case 2:
                                message.state = 2;
                                break;
                            case "FAILED":
                            case 3:
                                message.state = 3;
                                break;
                            }
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TunedModel.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TunedModel.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            if (object.tuningTask != null) {
                                if (typeof object.tuningTask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TunedModel.tuningTask: object expected");
                                message.tuningTask = $root.google.ai.generativelanguage.v1beta.TuningTask.fromObject(object.tuningTask);
                            }
                            if (object.readerProjectNumbers) {
                                if (!Array.isArray(object.readerProjectNumbers))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TunedModel.readerProjectNumbers: array expected");
                                message.readerProjectNumbers = [];
                                for (var i = 0; i < object.readerProjectNumbers.length; ++i)
                                    if ($util.Long)
                                        (message.readerProjectNumbers[i] = $util.Long.fromValue(object.readerProjectNumbers[i])).unsigned = false;
                                    else if (typeof object.readerProjectNumbers[i] === "string")
                                        message.readerProjectNumbers[i] = parseInt(object.readerProjectNumbers[i], 10);
                                    else if (typeof object.readerProjectNumbers[i] === "number")
                                        message.readerProjectNumbers[i] = object.readerProjectNumbers[i];
                                    else if (typeof object.readerProjectNumbers[i] === "object")
                                        message.readerProjectNumbers[i] = new $util.LongBits(object.readerProjectNumbers[i].low >>> 0, object.readerProjectNumbers[i].high >>> 0).toNumber();
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TunedModel message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.TunedModel} message TunedModel
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TunedModel.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.readerProjectNumbers = [];
                            if (options.defaults) {
                                object.name = "";
                                object.displayName = "";
                                object.description = "";
                                object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
                                object.createTime = null;
                                object.updateTime = null;
                                object.tuningTask = null;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.tunedModelSource != null && message.hasOwnProperty("tunedModelSource")) {
                                object.tunedModelSource = $root.google.ai.generativelanguage.v1beta.TunedModelSource.toObject(message.tunedModelSource, options);
                                if (options.oneofs)
                                    object.sourceModel = "tunedModelSource";
                            }
                            if (message.baseModel != null && message.hasOwnProperty("baseModel")) {
                                object.baseModel = message.baseModel;
                                if (options.oneofs)
                                    object.sourceModel = "baseModel";
                            }
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.state != null && message.hasOwnProperty("state"))
                                object.state = options.enums === String ? $root.google.ai.generativelanguage.v1beta.TunedModel.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1beta.TunedModel.State[message.state] : message.state;
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            if (message.tuningTask != null && message.hasOwnProperty("tuningTask"))
                                object.tuningTask = $root.google.ai.generativelanguage.v1beta.TuningTask.toObject(message.tuningTask, options);
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.readerProjectNumbers && message.readerProjectNumbers.length) {
                                object.readerProjectNumbers = [];
                                for (var j = 0; j < message.readerProjectNumbers.length; ++j)
                                    if (typeof message.readerProjectNumbers[j] === "number")
                                        object.readerProjectNumbers[j] = options.longs === String ? String(message.readerProjectNumbers[j]) : message.readerProjectNumbers[j];
                                    else
                                        object.readerProjectNumbers[j] = options.longs === String ? $util.Long.prototype.toString.call(message.readerProjectNumbers[j]) : options.longs === Number ? new $util.LongBits(message.readerProjectNumbers[j].low >>> 0, message.readerProjectNumbers[j].high >>> 0).toNumber() : message.readerProjectNumbers[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TunedModel to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TunedModel.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TunedModel
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.TunedModel
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TunedModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.TunedModel";
                        };
    
                        /**
                         * State enum.
                         * @name google.ai.generativelanguage.v1beta.TunedModel.State
                         * @enum {number}
                         * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value
                         * @property {number} CREATING=1 CREATING value
                         * @property {number} ACTIVE=2 ACTIVE value
                         * @property {number} FAILED=3 FAILED value
                         */
                        TunedModel.State = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "STATE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "CREATING"] = 1;
                            values[valuesById[2] = "ACTIVE"] = 2;
                            values[valuesById[3] = "FAILED"] = 3;
                            return values;
                        })();
    
                        return TunedModel;
                    })();
    
                    v1beta.TunedModelSource = (function() {
    
                        /**
                         * Properties of a TunedModelSource.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ITunedModelSource
                         * @property {string|null} [tunedModel] TunedModelSource tunedModel
                         * @property {string|null} [baseModel] TunedModelSource baseModel
                         */
    
                        /**
                         * Constructs a new TunedModelSource.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a TunedModelSource.
                         * @implements ITunedModelSource
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ITunedModelSource=} [properties] Properties to set
                         */
                        function TunedModelSource(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TunedModelSource tunedModel.
                         * @member {string} tunedModel
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @instance
                         */
                        TunedModelSource.prototype.tunedModel = "";
    
                        /**
                         * TunedModelSource baseModel.
                         * @member {string} baseModel
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @instance
                         */
                        TunedModelSource.prototype.baseModel = "";
    
                        /**
                         * Creates a new TunedModelSource instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITunedModelSource=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.TunedModelSource} TunedModelSource instance
                         */
                        TunedModelSource.create = function create(properties) {
                            return new TunedModelSource(properties);
                        };
    
                        /**
                         * Encodes the specified TunedModelSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta.TunedModelSource.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITunedModelSource} message TunedModelSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModelSource.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModel);
                            if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModel);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TunedModelSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.TunedModelSource.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITunedModelSource} message TunedModelSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModelSource.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TunedModelSource message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.TunedModelSource} TunedModelSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModelSource.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.TunedModelSource();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tunedModel = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.baseModel = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TunedModelSource message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.TunedModelSource} TunedModelSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModelSource.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TunedModelSource message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TunedModelSource.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                if (!$util.isString(message.tunedModel))
                                    return "tunedModel: string expected";
                            if (message.baseModel != null && message.hasOwnProperty("baseModel"))
                                if (!$util.isString(message.baseModel))
                                    return "baseModel: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TunedModelSource message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.TunedModelSource} TunedModelSource
                         */
                        TunedModelSource.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.TunedModelSource)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.TunedModelSource();
                            if (object.tunedModel != null)
                                message.tunedModel = String(object.tunedModel);
                            if (object.baseModel != null)
                                message.baseModel = String(object.baseModel);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TunedModelSource message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.TunedModelSource} message TunedModelSource
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TunedModelSource.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.tunedModel = "";
                                object.baseModel = "";
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = message.tunedModel;
                            if (message.baseModel != null && message.hasOwnProperty("baseModel"))
                                object.baseModel = message.baseModel;
                            return object;
                        };
    
                        /**
                         * Converts this TunedModelSource to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TunedModelSource.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TunedModelSource
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.TunedModelSource
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TunedModelSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.TunedModelSource";
                        };
    
                        return TunedModelSource;
                    })();
    
                    v1beta.TuningTask = (function() {
    
                        /**
                         * Properties of a TuningTask.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ITuningTask
                         * @property {google.protobuf.ITimestamp|null} [startTime] TuningTask startTime
                         * @property {google.protobuf.ITimestamp|null} [completeTime] TuningTask completeTime
                         * @property {Array.<google.ai.generativelanguage.v1beta.ITuningSnapshot>|null} [snapshots] TuningTask snapshots
                         * @property {google.ai.generativelanguage.v1beta.IDataset|null} [trainingData] TuningTask trainingData
                         * @property {google.ai.generativelanguage.v1beta.IHyperparameters|null} [hyperparameters] TuningTask hyperparameters
                         */
    
                        /**
                         * Constructs a new TuningTask.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a TuningTask.
                         * @implements ITuningTask
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ITuningTask=} [properties] Properties to set
                         */
                        function TuningTask(properties) {
                            this.snapshots = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningTask startTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} startTime
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.startTime = null;
    
                        /**
                         * TuningTask completeTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} completeTime
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.completeTime = null;
    
                        /**
                         * TuningTask snapshots.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ITuningSnapshot>} snapshots
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.snapshots = $util.emptyArray;
    
                        /**
                         * TuningTask trainingData.
                         * @member {google.ai.generativelanguage.v1beta.IDataset|null|undefined} trainingData
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.trainingData = null;
    
                        /**
                         * TuningTask hyperparameters.
                         * @member {google.ai.generativelanguage.v1beta.IHyperparameters|null|undefined} hyperparameters
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.hyperparameters = null;
    
                        /**
                         * Creates a new TuningTask instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningTask=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.TuningTask} TuningTask instance
                         */
                        TuningTask.create = function create(properties) {
                            return new TuningTask(properties);
                        };
    
                        /**
                         * Encodes the specified TuningTask message. Does not implicitly {@link google.ai.generativelanguage.v1beta.TuningTask.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningTask} message TuningTask message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningTask.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
                                $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime"))
                                $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.snapshots != null && message.snapshots.length)
                                for (var i = 0; i < message.snapshots.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.TuningSnapshot.encode(message.snapshots[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.trainingData != null && Object.hasOwnProperty.call(message, "trainingData"))
                                $root.google.ai.generativelanguage.v1beta.Dataset.encode(message.trainingData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.hyperparameters != null && Object.hasOwnProperty.call(message, "hyperparameters"))
                                $root.google.ai.generativelanguage.v1beta.Hyperparameters.encode(message.hyperparameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningTask message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.TuningTask.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningTask} message TuningTask message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningTask.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningTask message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.TuningTask} TuningTask
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningTask.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.TuningTask();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.snapshots && message.snapshots.length))
                                            message.snapshots = [];
                                        message.snapshots.push($root.google.ai.generativelanguage.v1beta.TuningSnapshot.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.trainingData = $root.google.ai.generativelanguage.v1beta.Dataset.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        message.hyperparameters = $root.google.ai.generativelanguage.v1beta.Hyperparameters.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningTask message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.TuningTask} TuningTask
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningTask.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningTask message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningTask.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.startTime != null && message.hasOwnProperty("startTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.startTime);
                                if (error)
                                    return "startTime." + error;
                            }
                            if (message.completeTime != null && message.hasOwnProperty("completeTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.completeTime);
                                if (error)
                                    return "completeTime." + error;
                            }
                            if (message.snapshots != null && message.hasOwnProperty("snapshots")) {
                                if (!Array.isArray(message.snapshots))
                                    return "snapshots: array expected";
                                for (var i = 0; i < message.snapshots.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.TuningSnapshot.verify(message.snapshots[i]);
                                    if (error)
                                        return "snapshots." + error;
                                }
                            }
                            if (message.trainingData != null && message.hasOwnProperty("trainingData")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Dataset.verify(message.trainingData);
                                if (error)
                                    return "trainingData." + error;
                            }
                            if (message.hyperparameters != null && message.hasOwnProperty("hyperparameters")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Hyperparameters.verify(message.hyperparameters);
                                if (error)
                                    return "hyperparameters." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TuningTask message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.TuningTask} TuningTask
                         */
                        TuningTask.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.TuningTask)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.TuningTask();
                            if (object.startTime != null) {
                                if (typeof object.startTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TuningTask.startTime: object expected");
                                message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime);
                            }
                            if (object.completeTime != null) {
                                if (typeof object.completeTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TuningTask.completeTime: object expected");
                                message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime);
                            }
                            if (object.snapshots) {
                                if (!Array.isArray(object.snapshots))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TuningTask.snapshots: array expected");
                                message.snapshots = [];
                                for (var i = 0; i < object.snapshots.length; ++i) {
                                    if (typeof object.snapshots[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.TuningTask.snapshots: object expected");
                                    message.snapshots[i] = $root.google.ai.generativelanguage.v1beta.TuningSnapshot.fromObject(object.snapshots[i]);
                                }
                            }
                            if (object.trainingData != null) {
                                if (typeof object.trainingData !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TuningTask.trainingData: object expected");
                                message.trainingData = $root.google.ai.generativelanguage.v1beta.Dataset.fromObject(object.trainingData);
                            }
                            if (object.hyperparameters != null) {
                                if (typeof object.hyperparameters !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TuningTask.hyperparameters: object expected");
                                message.hyperparameters = $root.google.ai.generativelanguage.v1beta.Hyperparameters.fromObject(object.hyperparameters);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningTask message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.TuningTask} message TuningTask
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningTask.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.snapshots = [];
                            if (options.defaults) {
                                object.startTime = null;
                                object.completeTime = null;
                                object.trainingData = null;
                                object.hyperparameters = null;
                            }
                            if (message.startTime != null && message.hasOwnProperty("startTime"))
                                object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options);
                            if (message.completeTime != null && message.hasOwnProperty("completeTime"))
                                object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options);
                            if (message.snapshots && message.snapshots.length) {
                                object.snapshots = [];
                                for (var j = 0; j < message.snapshots.length; ++j)
                                    object.snapshots[j] = $root.google.ai.generativelanguage.v1beta.TuningSnapshot.toObject(message.snapshots[j], options);
                            }
                            if (message.trainingData != null && message.hasOwnProperty("trainingData"))
                                object.trainingData = $root.google.ai.generativelanguage.v1beta.Dataset.toObject(message.trainingData, options);
                            if (message.hyperparameters != null && message.hasOwnProperty("hyperparameters"))
                                object.hyperparameters = $root.google.ai.generativelanguage.v1beta.Hyperparameters.toObject(message.hyperparameters, options);
                            return object;
                        };
    
                        /**
                         * Converts this TuningTask to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningTask.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningTask
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.TuningTask
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.TuningTask";
                        };
    
                        return TuningTask;
                    })();
    
                    v1beta.Hyperparameters = (function() {
    
                        /**
                         * Properties of a Hyperparameters.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IHyperparameters
                         * @property {number|null} [learningRate] Hyperparameters learningRate
                         * @property {number|null} [learningRateMultiplier] Hyperparameters learningRateMultiplier
                         * @property {number|null} [epochCount] Hyperparameters epochCount
                         * @property {number|null} [batchSize] Hyperparameters batchSize
                         */
    
                        /**
                         * Constructs a new Hyperparameters.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Hyperparameters.
                         * @implements IHyperparameters
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IHyperparameters=} [properties] Properties to set
                         */
                        function Hyperparameters(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Hyperparameters learningRate.
                         * @member {number|null|undefined} learningRate
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @instance
                         */
                        Hyperparameters.prototype.learningRate = null;
    
                        /**
                         * Hyperparameters learningRateMultiplier.
                         * @member {number|null|undefined} learningRateMultiplier
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @instance
                         */
                        Hyperparameters.prototype.learningRateMultiplier = null;
    
                        /**
                         * Hyperparameters epochCount.
                         * @member {number|null|undefined} epochCount
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @instance
                         */
                        Hyperparameters.prototype.epochCount = null;
    
                        /**
                         * Hyperparameters batchSize.
                         * @member {number|null|undefined} batchSize
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @instance
                         */
                        Hyperparameters.prototype.batchSize = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Hyperparameters learningRateOption.
                         * @member {"learningRate"|"learningRateMultiplier"|undefined} learningRateOption
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @instance
                         */
                        Object.defineProperty(Hyperparameters.prototype, "learningRateOption", {
                            get: $util.oneOfGetter($oneOfFields = ["learningRate", "learningRateMultiplier"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Hyperparameters _epochCount.
                         * @member {"epochCount"|undefined} _epochCount
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @instance
                         */
                        Object.defineProperty(Hyperparameters.prototype, "_epochCount", {
                            get: $util.oneOfGetter($oneOfFields = ["epochCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Hyperparameters _batchSize.
                         * @member {"batchSize"|undefined} _batchSize
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @instance
                         */
                        Object.defineProperty(Hyperparameters.prototype, "_batchSize", {
                            get: $util.oneOfGetter($oneOfFields = ["batchSize"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Hyperparameters instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IHyperparameters=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Hyperparameters} Hyperparameters instance
                         */
                        Hyperparameters.create = function create(properties) {
                            return new Hyperparameters(properties);
                        };
    
                        /**
                         * Encodes the specified Hyperparameters message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Hyperparameters.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IHyperparameters} message Hyperparameters message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Hyperparameters.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.epochCount != null && Object.hasOwnProperty.call(message, "epochCount"))
                                writer.uint32(/* id 14, wireType 0 =*/112).int32(message.epochCount);
                            if (message.batchSize != null && Object.hasOwnProperty.call(message, "batchSize"))
                                writer.uint32(/* id 15, wireType 0 =*/120).int32(message.batchSize);
                            if (message.learningRate != null && Object.hasOwnProperty.call(message, "learningRate"))
                                writer.uint32(/* id 16, wireType 5 =*/133).float(message.learningRate);
                            if (message.learningRateMultiplier != null && Object.hasOwnProperty.call(message, "learningRateMultiplier"))
                                writer.uint32(/* id 17, wireType 5 =*/141).float(message.learningRateMultiplier);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Hyperparameters message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Hyperparameters.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IHyperparameters} message Hyperparameters message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Hyperparameters.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Hyperparameters message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Hyperparameters} Hyperparameters
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Hyperparameters.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Hyperparameters();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 16: {
                                        message.learningRate = reader.float();
                                        break;
                                    }
                                case 17: {
                                        message.learningRateMultiplier = reader.float();
                                        break;
                                    }
                                case 14: {
                                        message.epochCount = reader.int32();
                                        break;
                                    }
                                case 15: {
                                        message.batchSize = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Hyperparameters message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Hyperparameters} Hyperparameters
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Hyperparameters.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Hyperparameters message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Hyperparameters.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.learningRate != null && message.hasOwnProperty("learningRate")) {
                                properties.learningRateOption = 1;
                                if (typeof message.learningRate !== "number")
                                    return "learningRate: number expected";
                            }
                            if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) {
                                if (properties.learningRateOption === 1)
                                    return "learningRateOption: multiple values";
                                properties.learningRateOption = 1;
                                if (typeof message.learningRateMultiplier !== "number")
                                    return "learningRateMultiplier: number expected";
                            }
                            if (message.epochCount != null && message.hasOwnProperty("epochCount")) {
                                properties._epochCount = 1;
                                if (!$util.isInteger(message.epochCount))
                                    return "epochCount: integer expected";
                            }
                            if (message.batchSize != null && message.hasOwnProperty("batchSize")) {
                                properties._batchSize = 1;
                                if (!$util.isInteger(message.batchSize))
                                    return "batchSize: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Hyperparameters message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Hyperparameters} Hyperparameters
                         */
                        Hyperparameters.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Hyperparameters)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Hyperparameters();
                            if (object.learningRate != null)
                                message.learningRate = Number(object.learningRate);
                            if (object.learningRateMultiplier != null)
                                message.learningRateMultiplier = Number(object.learningRateMultiplier);
                            if (object.epochCount != null)
                                message.epochCount = object.epochCount | 0;
                            if (object.batchSize != null)
                                message.batchSize = object.batchSize | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Hyperparameters message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Hyperparameters} message Hyperparameters
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Hyperparameters.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.epochCount != null && message.hasOwnProperty("epochCount")) {
                                object.epochCount = message.epochCount;
                                if (options.oneofs)
                                    object._epochCount = "epochCount";
                            }
                            if (message.batchSize != null && message.hasOwnProperty("batchSize")) {
                                object.batchSize = message.batchSize;
                                if (options.oneofs)
                                    object._batchSize = "batchSize";
                            }
                            if (message.learningRate != null && message.hasOwnProperty("learningRate")) {
                                object.learningRate = options.json && !isFinite(message.learningRate) ? String(message.learningRate) : message.learningRate;
                                if (options.oneofs)
                                    object.learningRateOption = "learningRate";
                            }
                            if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) {
                                object.learningRateMultiplier = options.json && !isFinite(message.learningRateMultiplier) ? String(message.learningRateMultiplier) : message.learningRateMultiplier;
                                if (options.oneofs)
                                    object.learningRateOption = "learningRateMultiplier";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Hyperparameters to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Hyperparameters.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Hyperparameters
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Hyperparameters
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Hyperparameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Hyperparameters";
                        };
    
                        return Hyperparameters;
                    })();
    
                    v1beta.Dataset = (function() {
    
                        /**
                         * Properties of a Dataset.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IDataset
                         * @property {google.ai.generativelanguage.v1beta.ITuningExamples|null} [examples] Dataset examples
                         */
    
                        /**
                         * Constructs a new Dataset.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Dataset.
                         * @implements IDataset
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IDataset=} [properties] Properties to set
                         */
                        function Dataset(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Dataset examples.
                         * @member {google.ai.generativelanguage.v1beta.ITuningExamples|null|undefined} examples
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @instance
                         */
                        Dataset.prototype.examples = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Dataset dataset.
                         * @member {"examples"|undefined} dataset
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @instance
                         */
                        Object.defineProperty(Dataset.prototype, "dataset", {
                            get: $util.oneOfGetter($oneOfFields = ["examples"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Dataset instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDataset=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Dataset} Dataset instance
                         */
                        Dataset.create = function create(properties) {
                            return new Dataset(properties);
                        };
    
                        /**
                         * Encodes the specified Dataset message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Dataset.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDataset} message Dataset message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Dataset.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.examples != null && Object.hasOwnProperty.call(message, "examples"))
                                $root.google.ai.generativelanguage.v1beta.TuningExamples.encode(message.examples, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Dataset.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDataset} message Dataset message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Dataset.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Dataset message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Dataset} Dataset
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Dataset.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Dataset();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.examples = $root.google.ai.generativelanguage.v1beta.TuningExamples.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Dataset message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Dataset} Dataset
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Dataset.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Dataset message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Dataset.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                properties.dataset = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.TuningExamples.verify(message.examples);
                                    if (error)
                                        return "examples." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Dataset message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Dataset} Dataset
                         */
                        Dataset.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Dataset)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Dataset();
                            if (object.examples != null) {
                                if (typeof object.examples !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Dataset.examples: object expected");
                                message.examples = $root.google.ai.generativelanguage.v1beta.TuningExamples.fromObject(object.examples);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Dataset message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Dataset} message Dataset
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Dataset.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                object.examples = $root.google.ai.generativelanguage.v1beta.TuningExamples.toObject(message.examples, options);
                                if (options.oneofs)
                                    object.dataset = "examples";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Dataset to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Dataset.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Dataset
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Dataset
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Dataset";
                        };
    
                        return Dataset;
                    })();
    
                    v1beta.TuningExamples = (function() {
    
                        /**
                         * Properties of a TuningExamples.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ITuningExamples
                         * @property {Array.<google.ai.generativelanguage.v1beta.ITuningExample>|null} [examples] TuningExamples examples
                         */
    
                        /**
                         * Constructs a new TuningExamples.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a TuningExamples.
                         * @implements ITuningExamples
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ITuningExamples=} [properties] Properties to set
                         */
                        function TuningExamples(properties) {
                            this.examples = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningExamples examples.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ITuningExample>} examples
                         * @memberof google.ai.generativelanguage.v1beta.TuningExamples
                         * @instance
                         */
                        TuningExamples.prototype.examples = $util.emptyArray;
    
                        /**
                         * Creates a new TuningExamples instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningExamples=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.TuningExamples} TuningExamples instance
                         */
                        TuningExamples.create = function create(properties) {
                            return new TuningExamples(properties);
                        };
    
                        /**
                         * Encodes the specified TuningExamples message. Does not implicitly {@link google.ai.generativelanguage.v1beta.TuningExamples.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningExamples} message TuningExamples message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExamples.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.examples != null && message.examples.length)
                                for (var i = 0; i < message.examples.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.TuningExample.encode(message.examples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningExamples message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.TuningExamples.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningExamples} message TuningExamples message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExamples.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningExamples message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.TuningExamples
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.TuningExamples} TuningExamples
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExamples.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.TuningExamples();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.examples && message.examples.length))
                                            message.examples = [];
                                        message.examples.push($root.google.ai.generativelanguage.v1beta.TuningExample.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningExamples message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TuningExamples
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.TuningExamples} TuningExamples
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExamples.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningExamples message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.TuningExamples
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningExamples.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                if (!Array.isArray(message.examples))
                                    return "examples: array expected";
                                for (var i = 0; i < message.examples.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.TuningExample.verify(message.examples[i]);
                                    if (error)
                                        return "examples." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TuningExamples message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.TuningExamples
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.TuningExamples} TuningExamples
                         */
                        TuningExamples.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.TuningExamples)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.TuningExamples();
                            if (object.examples) {
                                if (!Array.isArray(object.examples))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TuningExamples.examples: array expected");
                                message.examples = [];
                                for (var i = 0; i < object.examples.length; ++i) {
                                    if (typeof object.examples[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.TuningExamples.examples: object expected");
                                    message.examples[i] = $root.google.ai.generativelanguage.v1beta.TuningExample.fromObject(object.examples[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningExamples message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.TuningExamples} message TuningExamples
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningExamples.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.examples = [];
                            if (message.examples && message.examples.length) {
                                object.examples = [];
                                for (var j = 0; j < message.examples.length; ++j)
                                    object.examples[j] = $root.google.ai.generativelanguage.v1beta.TuningExample.toObject(message.examples[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TuningExamples to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.TuningExamples
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningExamples.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningExamples
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.TuningExamples
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningExamples.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.TuningExamples";
                        };
    
                        return TuningExamples;
                    })();
    
                    v1beta.TuningExample = (function() {
    
                        /**
                         * Properties of a TuningExample.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ITuningExample
                         * @property {string|null} [textInput] TuningExample textInput
                         * @property {string|null} [output] TuningExample output
                         */
    
                        /**
                         * Constructs a new TuningExample.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a TuningExample.
                         * @implements ITuningExample
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ITuningExample=} [properties] Properties to set
                         */
                        function TuningExample(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningExample textInput.
                         * @member {string|null|undefined} textInput
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @instance
                         */
                        TuningExample.prototype.textInput = null;
    
                        /**
                         * TuningExample output.
                         * @member {string} output
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @instance
                         */
                        TuningExample.prototype.output = "";
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TuningExample modelInput.
                         * @member {"textInput"|undefined} modelInput
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @instance
                         */
                        Object.defineProperty(TuningExample.prototype, "modelInput", {
                            get: $util.oneOfGetter($oneOfFields = ["textInput"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TuningExample instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningExample=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.TuningExample} TuningExample instance
                         */
                        TuningExample.create = function create(properties) {
                            return new TuningExample(properties);
                        };
    
                        /**
                         * Encodes the specified TuningExample message. Does not implicitly {@link google.ai.generativelanguage.v1beta.TuningExample.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningExample} message TuningExample message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExample.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.textInput != null && Object.hasOwnProperty.call(message, "textInput"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.textInput);
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.output);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningExample message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.TuningExample.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningExample} message TuningExample message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExample.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningExample message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.TuningExample} TuningExample
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExample.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.TuningExample();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.textInput = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.output = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningExample message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.TuningExample} TuningExample
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExample.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningExample message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningExample.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.textInput != null && message.hasOwnProperty("textInput")) {
                                properties.modelInput = 1;
                                if (!$util.isString(message.textInput))
                                    return "textInput: string expected";
                            }
                            if (message.output != null && message.hasOwnProperty("output"))
                                if (!$util.isString(message.output))
                                    return "output: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TuningExample message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.TuningExample} TuningExample
                         */
                        TuningExample.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.TuningExample)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.TuningExample();
                            if (object.textInput != null)
                                message.textInput = String(object.textInput);
                            if (object.output != null)
                                message.output = String(object.output);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningExample message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.TuningExample} message TuningExample
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningExample.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.output = "";
                            if (message.textInput != null && message.hasOwnProperty("textInput")) {
                                object.textInput = message.textInput;
                                if (options.oneofs)
                                    object.modelInput = "textInput";
                            }
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = message.output;
                            return object;
                        };
    
                        /**
                         * Converts this TuningExample to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningExample.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningExample
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.TuningExample
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningExample.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.TuningExample";
                        };
    
                        return TuningExample;
                    })();
    
                    v1beta.TuningSnapshot = (function() {
    
                        /**
                         * Properties of a TuningSnapshot.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ITuningSnapshot
                         * @property {number|null} [step] TuningSnapshot step
                         * @property {number|null} [epoch] TuningSnapshot epoch
                         * @property {number|null} [meanLoss] TuningSnapshot meanLoss
                         * @property {google.protobuf.ITimestamp|null} [computeTime] TuningSnapshot computeTime
                         */
    
                        /**
                         * Constructs a new TuningSnapshot.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a TuningSnapshot.
                         * @implements ITuningSnapshot
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ITuningSnapshot=} [properties] Properties to set
                         */
                        function TuningSnapshot(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningSnapshot step.
                         * @member {number} step
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.step = 0;
    
                        /**
                         * TuningSnapshot epoch.
                         * @member {number} epoch
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.epoch = 0;
    
                        /**
                         * TuningSnapshot meanLoss.
                         * @member {number} meanLoss
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.meanLoss = 0;
    
                        /**
                         * TuningSnapshot computeTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} computeTime
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.computeTime = null;
    
                        /**
                         * Creates a new TuningSnapshot instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningSnapshot=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.TuningSnapshot} TuningSnapshot instance
                         */
                        TuningSnapshot.create = function create(properties) {
                            return new TuningSnapshot(properties);
                        };
    
                        /**
                         * Encodes the specified TuningSnapshot message. Does not implicitly {@link google.ai.generativelanguage.v1beta.TuningSnapshot.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningSnapshot} message TuningSnapshot message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningSnapshot.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.step != null && Object.hasOwnProperty.call(message, "step"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.step);
                            if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.epoch);
                            if (message.meanLoss != null && Object.hasOwnProperty.call(message, "meanLoss"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.meanLoss);
                            if (message.computeTime != null && Object.hasOwnProperty.call(message, "computeTime"))
                                $root.google.protobuf.Timestamp.encode(message.computeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningSnapshot message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.TuningSnapshot.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITuningSnapshot} message TuningSnapshot message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningSnapshot.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningSnapshot message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.TuningSnapshot} TuningSnapshot
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningSnapshot.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.TuningSnapshot();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.step = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.epoch = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.meanLoss = reader.float();
                                        break;
                                    }
                                case 4: {
                                        message.computeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningSnapshot message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.TuningSnapshot} TuningSnapshot
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningSnapshot.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningSnapshot message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningSnapshot.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.step != null && message.hasOwnProperty("step"))
                                if (!$util.isInteger(message.step))
                                    return "step: integer expected";
                            if (message.epoch != null && message.hasOwnProperty("epoch"))
                                if (!$util.isInteger(message.epoch))
                                    return "epoch: integer expected";
                            if (message.meanLoss != null && message.hasOwnProperty("meanLoss"))
                                if (typeof message.meanLoss !== "number")
                                    return "meanLoss: number expected";
                            if (message.computeTime != null && message.hasOwnProperty("computeTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.computeTime);
                                if (error)
                                    return "computeTime." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TuningSnapshot message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.TuningSnapshot} TuningSnapshot
                         */
                        TuningSnapshot.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.TuningSnapshot)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.TuningSnapshot();
                            if (object.step != null)
                                message.step = object.step | 0;
                            if (object.epoch != null)
                                message.epoch = object.epoch | 0;
                            if (object.meanLoss != null)
                                message.meanLoss = Number(object.meanLoss);
                            if (object.computeTime != null) {
                                if (typeof object.computeTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TuningSnapshot.computeTime: object expected");
                                message.computeTime = $root.google.protobuf.Timestamp.fromObject(object.computeTime);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningSnapshot message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.TuningSnapshot} message TuningSnapshot
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningSnapshot.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.step = 0;
                                object.epoch = 0;
                                object.meanLoss = 0;
                                object.computeTime = null;
                            }
                            if (message.step != null && message.hasOwnProperty("step"))
                                object.step = message.step;
                            if (message.epoch != null && message.hasOwnProperty("epoch"))
                                object.epoch = message.epoch;
                            if (message.meanLoss != null && message.hasOwnProperty("meanLoss"))
                                object.meanLoss = options.json && !isFinite(message.meanLoss) ? String(message.meanLoss) : message.meanLoss;
                            if (message.computeTime != null && message.hasOwnProperty("computeTime"))
                                object.computeTime = $root.google.protobuf.Timestamp.toObject(message.computeTime, options);
                            return object;
                        };
    
                        /**
                         * Converts this TuningSnapshot to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningSnapshot.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningSnapshot
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.TuningSnapshot
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.TuningSnapshot";
                        };
    
                        return TuningSnapshot;
                    })();
    
                    v1beta.Permission = (function() {
    
                        /**
                         * Properties of a Permission.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IPermission
                         * @property {string|null} [name] Permission name
                         * @property {google.ai.generativelanguage.v1beta.Permission.GranteeType|null} [granteeType] Permission granteeType
                         * @property {string|null} [emailAddress] Permission emailAddress
                         * @property {google.ai.generativelanguage.v1beta.Permission.Role|null} [role] Permission role
                         */
    
                        /**
                         * Constructs a new Permission.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a Permission.
                         * @implements IPermission
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IPermission=} [properties] Properties to set
                         */
                        function Permission(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Permission name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @instance
                         */
                        Permission.prototype.name = "";
    
                        /**
                         * Permission granteeType.
                         * @member {google.ai.generativelanguage.v1beta.Permission.GranteeType|null|undefined} granteeType
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @instance
                         */
                        Permission.prototype.granteeType = null;
    
                        /**
                         * Permission emailAddress.
                         * @member {string|null|undefined} emailAddress
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @instance
                         */
                        Permission.prototype.emailAddress = null;
    
                        /**
                         * Permission role.
                         * @member {google.ai.generativelanguage.v1beta.Permission.Role|null|undefined} role
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @instance
                         */
                        Permission.prototype.role = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Permission _granteeType.
                         * @member {"granteeType"|undefined} _granteeType
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @instance
                         */
                        Object.defineProperty(Permission.prototype, "_granteeType", {
                            get: $util.oneOfGetter($oneOfFields = ["granteeType"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Permission _emailAddress.
                         * @member {"emailAddress"|undefined} _emailAddress
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @instance
                         */
                        Object.defineProperty(Permission.prototype, "_emailAddress", {
                            get: $util.oneOfGetter($oneOfFields = ["emailAddress"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Permission _role.
                         * @member {"role"|undefined} _role
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @instance
                         */
                        Object.defineProperty(Permission.prototype, "_role", {
                            get: $util.oneOfGetter($oneOfFields = ["role"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Permission instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPermission=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Permission} Permission instance
                         */
                        Permission.create = function create(properties) {
                            return new Permission(properties);
                        };
    
                        /**
                         * Encodes the specified Permission message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Permission.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPermission} message Permission message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Permission.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.granteeType != null && Object.hasOwnProperty.call(message, "granteeType"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.granteeType);
                            if (message.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.emailAddress);
                            if (message.role != null && Object.hasOwnProperty.call(message, "role"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.role);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Permission message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Permission.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPermission} message Permission message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Permission.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Permission message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Permission} Permission
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Permission.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Permission();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.granteeType = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.emailAddress = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.role = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Permission message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Permission} Permission
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Permission.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Permission message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Permission.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.granteeType != null && message.hasOwnProperty("granteeType")) {
                                properties._granteeType = 1;
                                switch (message.granteeType) {
                                default:
                                    return "granteeType: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            }
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) {
                                properties._emailAddress = 1;
                                if (!$util.isString(message.emailAddress))
                                    return "emailAddress: string expected";
                            }
                            if (message.role != null && message.hasOwnProperty("role")) {
                                properties._role = 1;
                                switch (message.role) {
                                default:
                                    return "role: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Permission message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Permission} Permission
                         */
                        Permission.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Permission)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Permission();
                            if (object.name != null)
                                message.name = String(object.name);
                            switch (object.granteeType) {
                            default:
                                if (typeof object.granteeType === "number") {
                                    message.granteeType = object.granteeType;
                                    break;
                                }
                                break;
                            case "GRANTEE_TYPE_UNSPECIFIED":
                            case 0:
                                message.granteeType = 0;
                                break;
                            case "USER":
                            case 1:
                                message.granteeType = 1;
                                break;
                            case "GROUP":
                            case 2:
                                message.granteeType = 2;
                                break;
                            case "EVERYONE":
                            case 3:
                                message.granteeType = 3;
                                break;
                            }
                            if (object.emailAddress != null)
                                message.emailAddress = String(object.emailAddress);
                            switch (object.role) {
                            default:
                                if (typeof object.role === "number") {
                                    message.role = object.role;
                                    break;
                                }
                                break;
                            case "ROLE_UNSPECIFIED":
                            case 0:
                                message.role = 0;
                                break;
                            case "OWNER":
                            case 1:
                                message.role = 1;
                                break;
                            case "WRITER":
                            case 2:
                                message.role = 2;
                                break;
                            case "READER":
                            case 3:
                                message.role = 3;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Permission message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Permission} message Permission
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Permission.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.granteeType != null && message.hasOwnProperty("granteeType")) {
                                object.granteeType = options.enums === String ? $root.google.ai.generativelanguage.v1beta.Permission.GranteeType[message.granteeType] === undefined ? message.granteeType : $root.google.ai.generativelanguage.v1beta.Permission.GranteeType[message.granteeType] : message.granteeType;
                                if (options.oneofs)
                                    object._granteeType = "granteeType";
                            }
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) {
                                object.emailAddress = message.emailAddress;
                                if (options.oneofs)
                                    object._emailAddress = "emailAddress";
                            }
                            if (message.role != null && message.hasOwnProperty("role")) {
                                object.role = options.enums === String ? $root.google.ai.generativelanguage.v1beta.Permission.Role[message.role] === undefined ? message.role : $root.google.ai.generativelanguage.v1beta.Permission.Role[message.role] : message.role;
                                if (options.oneofs)
                                    object._role = "role";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Permission to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Permission.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Permission
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Permission
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Permission.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Permission";
                        };
    
                        /**
                         * GranteeType enum.
                         * @name google.ai.generativelanguage.v1beta.Permission.GranteeType
                         * @enum {number}
                         * @property {number} GRANTEE_TYPE_UNSPECIFIED=0 GRANTEE_TYPE_UNSPECIFIED value
                         * @property {number} USER=1 USER value
                         * @property {number} GROUP=2 GROUP value
                         * @property {number} EVERYONE=3 EVERYONE value
                         */
                        Permission.GranteeType = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "GRANTEE_TYPE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "USER"] = 1;
                            values[valuesById[2] = "GROUP"] = 2;
                            values[valuesById[3] = "EVERYONE"] = 3;
                            return values;
                        })();
    
                        /**
                         * Role enum.
                         * @name google.ai.generativelanguage.v1beta.Permission.Role
                         * @enum {number}
                         * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value
                         * @property {number} OWNER=1 OWNER value
                         * @property {number} WRITER=2 WRITER value
                         * @property {number} READER=3 READER value
                         */
                        Permission.Role = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "OWNER"] = 1;
                            values[valuesById[2] = "WRITER"] = 2;
                            values[valuesById[3] = "READER"] = 3;
                            return values;
                        })();
    
                        return Permission;
                    })();
    
                    v1beta.PermissionService = (function() {
    
                        /**
                         * Constructs a new PermissionService service.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a PermissionService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function PermissionService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (PermissionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PermissionService;
    
                        /**
                         * Creates new PermissionService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {PermissionService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        PermissionService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.PermissionService|createPermission}.
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @typedef CreatePermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Permission} [response] Permission
                         */
    
                        /**
                         * Calls CreatePermission.
                         * @function createPermission
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreatePermissionRequest} request CreatePermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.PermissionService.CreatePermissionCallback} callback Node-style callback called with the error, if any, and Permission
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.createPermission = function createPermission(request, callback) {
                            return this.rpcCall(createPermission, $root.google.ai.generativelanguage.v1beta.CreatePermissionRequest, $root.google.ai.generativelanguage.v1beta.Permission, request, callback);
                        }, "name", { value: "CreatePermission" });
    
                        /**
                         * Calls CreatePermission.
                         * @function createPermission
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreatePermissionRequest} request CreatePermissionRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Permission>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.PermissionService|getPermission}.
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @typedef GetPermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Permission} [response] Permission
                         */
    
                        /**
                         * Calls GetPermission.
                         * @function getPermission
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetPermissionRequest} request GetPermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.PermissionService.GetPermissionCallback} callback Node-style callback called with the error, if any, and Permission
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.getPermission = function getPermission(request, callback) {
                            return this.rpcCall(getPermission, $root.google.ai.generativelanguage.v1beta.GetPermissionRequest, $root.google.ai.generativelanguage.v1beta.Permission, request, callback);
                        }, "name", { value: "GetPermission" });
    
                        /**
                         * Calls GetPermission.
                         * @function getPermission
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetPermissionRequest} request GetPermissionRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Permission>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.PermissionService|listPermissions}.
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @typedef ListPermissionsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.ListPermissionsResponse} [response] ListPermissionsResponse
                         */
    
                        /**
                         * Calls ListPermissions.
                         * @function listPermissions
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListPermissionsRequest} request ListPermissionsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.PermissionService.ListPermissionsCallback} callback Node-style callback called with the error, if any, and ListPermissionsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.listPermissions = function listPermissions(request, callback) {
                            return this.rpcCall(listPermissions, $root.google.ai.generativelanguage.v1beta.ListPermissionsRequest, $root.google.ai.generativelanguage.v1beta.ListPermissionsResponse, request, callback);
                        }, "name", { value: "ListPermissions" });
    
                        /**
                         * Calls ListPermissions.
                         * @function listPermissions
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListPermissionsRequest} request ListPermissionsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.ListPermissionsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.PermissionService|updatePermission}.
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @typedef UpdatePermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Permission} [response] Permission
                         */
    
                        /**
                         * Calls UpdatePermission.
                         * @function updatePermission
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdatePermissionRequest} request UpdatePermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.PermissionService.UpdatePermissionCallback} callback Node-style callback called with the error, if any, and Permission
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.updatePermission = function updatePermission(request, callback) {
                            return this.rpcCall(updatePermission, $root.google.ai.generativelanguage.v1beta.UpdatePermissionRequest, $root.google.ai.generativelanguage.v1beta.Permission, request, callback);
                        }, "name", { value: "UpdatePermission" });
    
                        /**
                         * Calls UpdatePermission.
                         * @function updatePermission
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdatePermissionRequest} request UpdatePermissionRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Permission>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.PermissionService|deletePermission}.
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @typedef DeletePermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeletePermission.
                         * @function deletePermission
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeletePermissionRequest} request DeletePermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.PermissionService.DeletePermissionCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.deletePermission = function deletePermission(request, callback) {
                            return this.rpcCall(deletePermission, $root.google.ai.generativelanguage.v1beta.DeletePermissionRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeletePermission" });
    
                        /**
                         * Calls DeletePermission.
                         * @function deletePermission
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeletePermissionRequest} request DeletePermissionRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.PermissionService|transferOwnership}.
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @typedef TransferOwnershipCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.TransferOwnershipResponse} [response] TransferOwnershipResponse
                         */
    
                        /**
                         * Calls TransferOwnership.
                         * @function transferOwnership
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ITransferOwnershipRequest} request TransferOwnershipRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.PermissionService.TransferOwnershipCallback} callback Node-style callback called with the error, if any, and TransferOwnershipResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.transferOwnership = function transferOwnership(request, callback) {
                            return this.rpcCall(transferOwnership, $root.google.ai.generativelanguage.v1beta.TransferOwnershipRequest, $root.google.ai.generativelanguage.v1beta.TransferOwnershipResponse, request, callback);
                        }, "name", { value: "TransferOwnership" });
    
                        /**
                         * Calls TransferOwnership.
                         * @function transferOwnership
                         * @memberof google.ai.generativelanguage.v1beta.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ITransferOwnershipRequest} request TransferOwnershipRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.TransferOwnershipResponse>} Promise
                         * @variation 2
                         */
    
                        return PermissionService;
                    })();
    
                    v1beta.CreatePermissionRequest = (function() {
    
                        /**
                         * Properties of a CreatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICreatePermissionRequest
                         * @property {string|null} [parent] CreatePermissionRequest parent
                         * @property {google.ai.generativelanguage.v1beta.IPermission|null} [permission] CreatePermissionRequest permission
                         */
    
                        /**
                         * Constructs a new CreatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CreatePermissionRequest.
                         * @implements ICreatePermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICreatePermissionRequest=} [properties] Properties to set
                         */
                        function CreatePermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreatePermissionRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @instance
                         */
                        CreatePermissionRequest.prototype.parent = "";
    
                        /**
                         * CreatePermissionRequest permission.
                         * @member {google.ai.generativelanguage.v1beta.IPermission|null|undefined} permission
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @instance
                         */
                        CreatePermissionRequest.prototype.permission = null;
    
                        /**
                         * Creates a new CreatePermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreatePermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CreatePermissionRequest} CreatePermissionRequest instance
                         */
                        CreatePermissionRequest.create = function create(properties) {
                            return new CreatePermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreatePermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreatePermissionRequest} message CreatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreatePermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.permission != null && Object.hasOwnProperty.call(message, "permission"))
                                $root.google.ai.generativelanguage.v1beta.Permission.encode(message.permission, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreatePermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreatePermissionRequest} message CreatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreatePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreatePermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CreatePermissionRequest} CreatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreatePermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CreatePermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.permission = $root.google.ai.generativelanguage.v1beta.Permission.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreatePermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CreatePermissionRequest} CreatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreatePermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreatePermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreatePermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.permission != null && message.hasOwnProperty("permission")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Permission.verify(message.permission);
                                if (error)
                                    return "permission." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreatePermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CreatePermissionRequest} CreatePermissionRequest
                         */
                        CreatePermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CreatePermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CreatePermissionRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.permission != null) {
                                if (typeof object.permission !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CreatePermissionRequest.permission: object expected");
                                message.permission = $root.google.ai.generativelanguage.v1beta.Permission.fromObject(object.permission);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreatePermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CreatePermissionRequest} message CreatePermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreatePermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.permission = null;
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.permission != null && message.hasOwnProperty("permission"))
                                object.permission = $root.google.ai.generativelanguage.v1beta.Permission.toObject(message.permission, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreatePermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreatePermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreatePermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CreatePermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreatePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreatePermissionRequest";
                        };
    
                        return CreatePermissionRequest;
                    })();
    
                    v1beta.GetPermissionRequest = (function() {
    
                        /**
                         * Properties of a GetPermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGetPermissionRequest
                         * @property {string|null} [name] GetPermissionRequest name
                         */
    
                        /**
                         * Constructs a new GetPermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GetPermissionRequest.
                         * @implements IGetPermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGetPermissionRequest=} [properties] Properties to set
                         */
                        function GetPermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetPermissionRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.GetPermissionRequest
                         * @instance
                         */
                        GetPermissionRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetPermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetPermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GetPermissionRequest} GetPermissionRequest instance
                         */
                        GetPermissionRequest.create = function create(properties) {
                            return new GetPermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetPermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetPermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetPermissionRequest} message GetPermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetPermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetPermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetPermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetPermissionRequest} message GetPermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetPermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetPermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GetPermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GetPermissionRequest} GetPermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetPermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GetPermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetPermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetPermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GetPermissionRequest} GetPermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetPermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetPermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GetPermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetPermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetPermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GetPermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GetPermissionRequest} GetPermissionRequest
                         */
                        GetPermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GetPermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GetPermissionRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetPermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GetPermissionRequest} message GetPermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetPermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetPermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GetPermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetPermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetPermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GetPermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetPermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetPermissionRequest";
                        };
    
                        return GetPermissionRequest;
                    })();
    
                    v1beta.ListPermissionsRequest = (function() {
    
                        /**
                         * Properties of a ListPermissionsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListPermissionsRequest
                         * @property {string|null} [parent] ListPermissionsRequest parent
                         * @property {number|null} [pageSize] ListPermissionsRequest pageSize
                         * @property {string|null} [pageToken] ListPermissionsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListPermissionsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListPermissionsRequest.
                         * @implements IListPermissionsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListPermissionsRequest=} [properties] Properties to set
                         */
                        function ListPermissionsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListPermissionsRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @instance
                         */
                        ListPermissionsRequest.prototype.parent = "";
    
                        /**
                         * ListPermissionsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @instance
                         */
                        ListPermissionsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListPermissionsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @instance
                         */
                        ListPermissionsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListPermissionsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListPermissionsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListPermissionsRequest} ListPermissionsRequest instance
                         */
                        ListPermissionsRequest.create = function create(properties) {
                            return new ListPermissionsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListPermissionsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListPermissionsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListPermissionsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListPermissionsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListPermissionsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListPermissionsRequest} ListPermissionsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListPermissionsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListPermissionsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListPermissionsRequest} ListPermissionsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListPermissionsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListPermissionsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListPermissionsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListPermissionsRequest} ListPermissionsRequest
                         */
                        ListPermissionsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListPermissionsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListPermissionsRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListPermissionsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListPermissionsRequest} message ListPermissionsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListPermissionsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListPermissionsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListPermissionsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListPermissionsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListPermissionsRequest";
                        };
    
                        return ListPermissionsRequest;
                    })();
    
                    v1beta.ListPermissionsResponse = (function() {
    
                        /**
                         * Properties of a ListPermissionsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListPermissionsResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IPermission>|null} [permissions] ListPermissionsResponse permissions
                         * @property {string|null} [nextPageToken] ListPermissionsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListPermissionsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListPermissionsResponse.
                         * @implements IListPermissionsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListPermissionsResponse=} [properties] Properties to set
                         */
                        function ListPermissionsResponse(properties) {
                            this.permissions = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListPermissionsResponse permissions.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IPermission>} permissions
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @instance
                         */
                        ListPermissionsResponse.prototype.permissions = $util.emptyArray;
    
                        /**
                         * ListPermissionsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @instance
                         */
                        ListPermissionsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListPermissionsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListPermissionsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListPermissionsResponse} ListPermissionsResponse instance
                         */
                        ListPermissionsResponse.create = function create(properties) {
                            return new ListPermissionsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListPermissionsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListPermissionsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.permissions != null && message.permissions.length)
                                for (var i = 0; i < message.permissions.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Permission.encode(message.permissions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListPermissionsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListPermissionsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListPermissionsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListPermissionsResponse} ListPermissionsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListPermissionsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.permissions && message.permissions.length))
                                            message.permissions = [];
                                        message.permissions.push($root.google.ai.generativelanguage.v1beta.Permission.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListPermissionsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListPermissionsResponse} ListPermissionsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListPermissionsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListPermissionsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.permissions != null && message.hasOwnProperty("permissions")) {
                                if (!Array.isArray(message.permissions))
                                    return "permissions: array expected";
                                for (var i = 0; i < message.permissions.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Permission.verify(message.permissions[i]);
                                    if (error)
                                        return "permissions." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListPermissionsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListPermissionsResponse} ListPermissionsResponse
                         */
                        ListPermissionsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListPermissionsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListPermissionsResponse();
                            if (object.permissions) {
                                if (!Array.isArray(object.permissions))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.ListPermissionsResponse.permissions: array expected");
                                message.permissions = [];
                                for (var i = 0; i < object.permissions.length; ++i) {
                                    if (typeof object.permissions[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.ListPermissionsResponse.permissions: object expected");
                                    message.permissions[i] = $root.google.ai.generativelanguage.v1beta.Permission.fromObject(object.permissions[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListPermissionsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListPermissionsResponse} message ListPermissionsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListPermissionsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.permissions = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.permissions && message.permissions.length) {
                                object.permissions = [];
                                for (var j = 0; j < message.permissions.length; ++j)
                                    object.permissions[j] = $root.google.ai.generativelanguage.v1beta.Permission.toObject(message.permissions[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListPermissionsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListPermissionsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListPermissionsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListPermissionsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListPermissionsResponse";
                        };
    
                        return ListPermissionsResponse;
                    })();
    
                    v1beta.UpdatePermissionRequest = (function() {
    
                        /**
                         * Properties of an UpdatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IUpdatePermissionRequest
                         * @property {google.ai.generativelanguage.v1beta.IPermission|null} [permission] UpdatePermissionRequest permission
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePermissionRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an UpdatePermissionRequest.
                         * @implements IUpdatePermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IUpdatePermissionRequest=} [properties] Properties to set
                         */
                        function UpdatePermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdatePermissionRequest permission.
                         * @member {google.ai.generativelanguage.v1beta.IPermission|null|undefined} permission
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @instance
                         */
                        UpdatePermissionRequest.prototype.permission = null;
    
                        /**
                         * UpdatePermissionRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @instance
                         */
                        UpdatePermissionRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdatePermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdatePermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.UpdatePermissionRequest} UpdatePermissionRequest instance
                         */
                        UpdatePermissionRequest.create = function create(properties) {
                            return new UpdatePermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdatePermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdatePermissionRequest} message UpdatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdatePermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.permission != null && Object.hasOwnProperty.call(message, "permission"))
                                $root.google.ai.generativelanguage.v1beta.Permission.encode(message.permission, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdatePermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdatePermissionRequest} message UpdatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdatePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdatePermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.UpdatePermissionRequest} UpdatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdatePermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.UpdatePermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.permission = $root.google.ai.generativelanguage.v1beta.Permission.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdatePermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.UpdatePermissionRequest} UpdatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdatePermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdatePermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdatePermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.permission != null && message.hasOwnProperty("permission")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Permission.verify(message.permission);
                                if (error)
                                    return "permission." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdatePermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.UpdatePermissionRequest} UpdatePermissionRequest
                         */
                        UpdatePermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.UpdatePermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.UpdatePermissionRequest();
                            if (object.permission != null) {
                                if (typeof object.permission !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdatePermissionRequest.permission: object expected");
                                message.permission = $root.google.ai.generativelanguage.v1beta.Permission.fromObject(object.permission);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdatePermissionRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdatePermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.UpdatePermissionRequest} message UpdatePermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdatePermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.permission = null;
                                object.updateMask = null;
                            }
                            if (message.permission != null && message.hasOwnProperty("permission"))
                                object.permission = $root.google.ai.generativelanguage.v1beta.Permission.toObject(message.permission, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdatePermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdatePermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdatePermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.UpdatePermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdatePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.UpdatePermissionRequest";
                        };
    
                        return UpdatePermissionRequest;
                    })();
    
                    v1beta.DeletePermissionRequest = (function() {
    
                        /**
                         * Properties of a DeletePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IDeletePermissionRequest
                         * @property {string|null} [name] DeletePermissionRequest name
                         */
    
                        /**
                         * Constructs a new DeletePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a DeletePermissionRequest.
                         * @implements IDeletePermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IDeletePermissionRequest=} [properties] Properties to set
                         */
                        function DeletePermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeletePermissionRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.DeletePermissionRequest
                         * @instance
                         */
                        DeletePermissionRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeletePermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeletePermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.DeletePermissionRequest} DeletePermissionRequest instance
                         */
                        DeletePermissionRequest.create = function create(properties) {
                            return new DeletePermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeletePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeletePermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeletePermissionRequest} message DeletePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeletePermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeletePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeletePermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeletePermissionRequest} message DeletePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeletePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeletePermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.DeletePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.DeletePermissionRequest} DeletePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeletePermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.DeletePermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeletePermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeletePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.DeletePermissionRequest} DeletePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeletePermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeletePermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.DeletePermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeletePermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeletePermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.DeletePermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.DeletePermissionRequest} DeletePermissionRequest
                         */
                        DeletePermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.DeletePermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.DeletePermissionRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeletePermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.DeletePermissionRequest} message DeletePermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeletePermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeletePermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.DeletePermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeletePermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeletePermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.DeletePermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeletePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DeletePermissionRequest";
                        };
    
                        return DeletePermissionRequest;
                    })();
    
                    v1beta.TransferOwnershipRequest = (function() {
    
                        /**
                         * Properties of a TransferOwnershipRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ITransferOwnershipRequest
                         * @property {string|null} [name] TransferOwnershipRequest name
                         * @property {string|null} [emailAddress] TransferOwnershipRequest emailAddress
                         */
    
                        /**
                         * Constructs a new TransferOwnershipRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a TransferOwnershipRequest.
                         * @implements ITransferOwnershipRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ITransferOwnershipRequest=} [properties] Properties to set
                         */
                        function TransferOwnershipRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TransferOwnershipRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @instance
                         */
                        TransferOwnershipRequest.prototype.name = "";
    
                        /**
                         * TransferOwnershipRequest emailAddress.
                         * @member {string} emailAddress
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @instance
                         */
                        TransferOwnershipRequest.prototype.emailAddress = "";
    
                        /**
                         * Creates a new TransferOwnershipRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITransferOwnershipRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.TransferOwnershipRequest} TransferOwnershipRequest instance
                         */
                        TransferOwnershipRequest.create = function create(properties) {
                            return new TransferOwnershipRequest(properties);
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.TransferOwnershipRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITransferOwnershipRequest} message TransferOwnershipRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.emailAddress);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.TransferOwnershipRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITransferOwnershipRequest} message TransferOwnershipRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TransferOwnershipRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.TransferOwnershipRequest} TransferOwnershipRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.TransferOwnershipRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.emailAddress = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TransferOwnershipRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.TransferOwnershipRequest} TransferOwnershipRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TransferOwnershipRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TransferOwnershipRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress"))
                                if (!$util.isString(message.emailAddress))
                                    return "emailAddress: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TransferOwnershipRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.TransferOwnershipRequest} TransferOwnershipRequest
                         */
                        TransferOwnershipRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.TransferOwnershipRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.TransferOwnershipRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.emailAddress != null)
                                message.emailAddress = String(object.emailAddress);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TransferOwnershipRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.TransferOwnershipRequest} message TransferOwnershipRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TransferOwnershipRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.emailAddress = "";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress"))
                                object.emailAddress = message.emailAddress;
                            return object;
                        };
    
                        /**
                         * Converts this TransferOwnershipRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TransferOwnershipRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TransferOwnershipRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TransferOwnershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.TransferOwnershipRequest";
                        };
    
                        return TransferOwnershipRequest;
                    })();
    
                    v1beta.TransferOwnershipResponse = (function() {
    
                        /**
                         * Properties of a TransferOwnershipResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ITransferOwnershipResponse
                         */
    
                        /**
                         * Constructs a new TransferOwnershipResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a TransferOwnershipResponse.
                         * @implements ITransferOwnershipResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ITransferOwnershipResponse=} [properties] Properties to set
                         */
                        function TransferOwnershipResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Creates a new TransferOwnershipResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITransferOwnershipResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.TransferOwnershipResponse} TransferOwnershipResponse instance
                         */
                        TransferOwnershipResponse.create = function create(properties) {
                            return new TransferOwnershipResponse(properties);
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.TransferOwnershipResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITransferOwnershipResponse} message TransferOwnershipResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.TransferOwnershipResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITransferOwnershipResponse} message TransferOwnershipResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TransferOwnershipResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.TransferOwnershipResponse} TransferOwnershipResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.TransferOwnershipResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TransferOwnershipResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.TransferOwnershipResponse} TransferOwnershipResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TransferOwnershipResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TransferOwnershipResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            return null;
                        };
    
                        /**
                         * Creates a TransferOwnershipResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.TransferOwnershipResponse} TransferOwnershipResponse
                         */
                        TransferOwnershipResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.TransferOwnershipResponse)
                                return object;
                            return new $root.google.ai.generativelanguage.v1beta.TransferOwnershipResponse();
                        };
    
                        /**
                         * Creates a plain object from a TransferOwnershipResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.TransferOwnershipResponse} message TransferOwnershipResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TransferOwnershipResponse.toObject = function toObject() {
                            return {};
                        };
    
                        /**
                         * Converts this TransferOwnershipResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TransferOwnershipResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TransferOwnershipResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.TransferOwnershipResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TransferOwnershipResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.TransferOwnershipResponse";
                        };
    
                        return TransferOwnershipResponse;
                    })();
    
                    v1beta.PredictionService = (function() {
    
                        /**
                         * Constructs a new PredictionService service.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a PredictionService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function PredictionService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService;
    
                        /**
                         * Creates new PredictionService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.PredictionService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {PredictionService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.PredictionService|predict}.
                         * @memberof google.ai.generativelanguage.v1beta.PredictionService
                         * @typedef PredictCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.PredictResponse} [response] PredictResponse
                         */
    
                        /**
                         * Calls Predict.
                         * @function predict
                         * @memberof google.ai.generativelanguage.v1beta.PredictionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IPredictRequest} request PredictRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) {
                            return this.rpcCall(predict, $root.google.ai.generativelanguage.v1beta.PredictRequest, $root.google.ai.generativelanguage.v1beta.PredictResponse, request, callback);
                        }, "name", { value: "Predict" });
    
                        /**
                         * Calls Predict.
                         * @function predict
                         * @memberof google.ai.generativelanguage.v1beta.PredictionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IPredictRequest} request PredictRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.PredictResponse>} Promise
                         * @variation 2
                         */
    
                        return PredictionService;
                    })();
    
                    v1beta.PredictRequest = (function() {
    
                        /**
                         * Properties of a PredictRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IPredictRequest
                         * @property {string|null} [model] PredictRequest model
                         * @property {Array.<google.protobuf.IValue>|null} [instances] PredictRequest instances
                         * @property {google.protobuf.IValue|null} [parameters] PredictRequest parameters
                         */
    
                        /**
                         * Constructs a new PredictRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a PredictRequest.
                         * @implements IPredictRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IPredictRequest=} [properties] Properties to set
                         */
                        function PredictRequest(properties) {
                            this.instances = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * PredictRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @instance
                         */
                        PredictRequest.prototype.model = "";
    
                        /**
                         * PredictRequest instances.
                         * @member {Array.<google.protobuf.IValue>} instances
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @instance
                         */
                        PredictRequest.prototype.instances = $util.emptyArray;
    
                        /**
                         * PredictRequest parameters.
                         * @member {google.protobuf.IValue|null|undefined} parameters
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @instance
                         */
                        PredictRequest.prototype.parameters = null;
    
                        /**
                         * Creates a new PredictRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPredictRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.PredictRequest} PredictRequest instance
                         */
                        PredictRequest.create = function create(properties) {
                            return new PredictRequest(properties);
                        };
    
                        /**
                         * Encodes the specified PredictRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.PredictRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPredictRequest} message PredictRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PredictRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.instances != null && message.instances.length)
                                for (var i = 0; i < message.instances.length; ++i)
                                    $root.google.protobuf.Value.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters"))
                                $root.google.protobuf.Value.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.PredictRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPredictRequest} message PredictRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PredictRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a PredictRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.PredictRequest} PredictRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PredictRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.PredictRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.instances && message.instances.length))
                                            message.instances = [];
                                        message.instances.push($root.google.protobuf.Value.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        message.parameters = $root.google.protobuf.Value.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a PredictRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.PredictRequest} PredictRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PredictRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a PredictRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        PredictRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.instances != null && message.hasOwnProperty("instances")) {
                                if (!Array.isArray(message.instances))
                                    return "instances: array expected";
                                for (var i = 0; i < message.instances.length; ++i) {
                                    var error = $root.google.protobuf.Value.verify(message.instances[i]);
                                    if (error)
                                        return "instances." + error;
                                }
                            }
                            if (message.parameters != null && message.hasOwnProperty("parameters")) {
                                var error = $root.google.protobuf.Value.verify(message.parameters);
                                if (error)
                                    return "parameters." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.PredictRequest} PredictRequest
                         */
                        PredictRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.PredictRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.PredictRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.instances) {
                                if (!Array.isArray(object.instances))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.PredictRequest.instances: array expected");
                                message.instances = [];
                                for (var i = 0; i < object.instances.length; ++i) {
                                    if (typeof object.instances[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.PredictRequest.instances: object expected");
                                    message.instances[i] = $root.google.protobuf.Value.fromObject(object.instances[i]);
                                }
                            }
                            if (object.parameters != null) {
                                if (typeof object.parameters !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.PredictRequest.parameters: object expected");
                                message.parameters = $root.google.protobuf.Value.fromObject(object.parameters);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a PredictRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.PredictRequest} message PredictRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        PredictRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.instances = [];
                            if (options.defaults) {
                                object.model = "";
                                object.parameters = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.instances && message.instances.length) {
                                object.instances = [];
                                for (var j = 0; j < message.instances.length; ++j)
                                    object.instances[j] = $root.google.protobuf.Value.toObject(message.instances[j], options);
                            }
                            if (message.parameters != null && message.hasOwnProperty("parameters"))
                                object.parameters = $root.google.protobuf.Value.toObject(message.parameters, options);
                            return object;
                        };
    
                        /**
                         * Converts this PredictRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        PredictRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for PredictRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.PredictRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        PredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.PredictRequest";
                        };
    
                        return PredictRequest;
                    })();
    
                    v1beta.PredictResponse = (function() {
    
                        /**
                         * Properties of a PredictResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IPredictResponse
                         * @property {Array.<google.protobuf.IValue>|null} [predictions] PredictResponse predictions
                         */
    
                        /**
                         * Constructs a new PredictResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a PredictResponse.
                         * @implements IPredictResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IPredictResponse=} [properties] Properties to set
                         */
                        function PredictResponse(properties) {
                            this.predictions = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * PredictResponse predictions.
                         * @member {Array.<google.protobuf.IValue>} predictions
                         * @memberof google.ai.generativelanguage.v1beta.PredictResponse
                         * @instance
                         */
                        PredictResponse.prototype.predictions = $util.emptyArray;
    
                        /**
                         * Creates a new PredictResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.PredictResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPredictResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.PredictResponse} PredictResponse instance
                         */
                        PredictResponse.create = function create(properties) {
                            return new PredictResponse(properties);
                        };
    
                        /**
                         * Encodes the specified PredictResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.PredictResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.PredictResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPredictResponse} message PredictResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PredictResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.predictions != null && message.predictions.length)
                                for (var i = 0; i < message.predictions.length; ++i)
                                    $root.google.protobuf.Value.encode(message.predictions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.PredictResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.PredictResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IPredictResponse} message PredictResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        PredictResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a PredictResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.PredictResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.PredictResponse} PredictResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PredictResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.PredictResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.predictions && message.predictions.length))
                                            message.predictions = [];
                                        message.predictions.push($root.google.protobuf.Value.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a PredictResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.PredictResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.PredictResponse} PredictResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        PredictResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a PredictResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.PredictResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        PredictResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.predictions != null && message.hasOwnProperty("predictions")) {
                                if (!Array.isArray(message.predictions))
                                    return "predictions: array expected";
                                for (var i = 0; i < message.predictions.length; ++i) {
                                    var error = $root.google.protobuf.Value.verify(message.predictions[i]);
                                    if (error)
                                        return "predictions." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.PredictResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.PredictResponse} PredictResponse
                         */
                        PredictResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.PredictResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.PredictResponse();
                            if (object.predictions) {
                                if (!Array.isArray(object.predictions))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.PredictResponse.predictions: array expected");
                                message.predictions = [];
                                for (var i = 0; i < object.predictions.length; ++i) {
                                    if (typeof object.predictions[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.PredictResponse.predictions: object expected");
                                    message.predictions[i] = $root.google.protobuf.Value.fromObject(object.predictions[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a PredictResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.PredictResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.PredictResponse} message PredictResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        PredictResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.predictions = [];
                            if (message.predictions && message.predictions.length) {
                                object.predictions = [];
                                for (var j = 0; j < message.predictions.length; ++j)
                                    object.predictions[j] = $root.google.protobuf.Value.toObject(message.predictions[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this PredictResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.PredictResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        PredictResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for PredictResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.PredictResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        PredictResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.PredictResponse";
                        };
    
                        return PredictResponse;
                    })();
    
                    v1beta.RetrieverService = (function() {
    
                        /**
                         * Constructs a new RetrieverService service.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a RetrieverService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function RetrieverService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (RetrieverService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RetrieverService;
    
                        /**
                         * Creates new RetrieverService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {RetrieverService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        RetrieverService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|createCorpus}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef CreateCorpusCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Corpus} [response] Corpus
                         */
    
                        /**
                         * Calls CreateCorpus.
                         * @function createCorpus
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateCorpusRequest} request CreateCorpusRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.CreateCorpusCallback} callback Node-style callback called with the error, if any, and Corpus
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.createCorpus = function createCorpus(request, callback) {
                            return this.rpcCall(createCorpus, $root.google.ai.generativelanguage.v1beta.CreateCorpusRequest, $root.google.ai.generativelanguage.v1beta.Corpus, request, callback);
                        }, "name", { value: "CreateCorpus" });
    
                        /**
                         * Calls CreateCorpus.
                         * @function createCorpus
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateCorpusRequest} request CreateCorpusRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Corpus>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|getCorpus}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef GetCorpusCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Corpus} [response] Corpus
                         */
    
                        /**
                         * Calls GetCorpus.
                         * @function getCorpus
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetCorpusRequest} request GetCorpusRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.GetCorpusCallback} callback Node-style callback called with the error, if any, and Corpus
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.getCorpus = function getCorpus(request, callback) {
                            return this.rpcCall(getCorpus, $root.google.ai.generativelanguage.v1beta.GetCorpusRequest, $root.google.ai.generativelanguage.v1beta.Corpus, request, callback);
                        }, "name", { value: "GetCorpus" });
    
                        /**
                         * Calls GetCorpus.
                         * @function getCorpus
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetCorpusRequest} request GetCorpusRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Corpus>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|updateCorpus}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef UpdateCorpusCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Corpus} [response] Corpus
                         */
    
                        /**
                         * Calls UpdateCorpus.
                         * @function updateCorpus
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCorpusRequest} request UpdateCorpusRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.UpdateCorpusCallback} callback Node-style callback called with the error, if any, and Corpus
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.updateCorpus = function updateCorpus(request, callback) {
                            return this.rpcCall(updateCorpus, $root.google.ai.generativelanguage.v1beta.UpdateCorpusRequest, $root.google.ai.generativelanguage.v1beta.Corpus, request, callback);
                        }, "name", { value: "UpdateCorpus" });
    
                        /**
                         * Calls UpdateCorpus.
                         * @function updateCorpus
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCorpusRequest} request UpdateCorpusRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Corpus>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|deleteCorpus}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef DeleteCorpusCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteCorpus.
                         * @function deleteCorpus
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCorpusRequest} request DeleteCorpusRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.DeleteCorpusCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.deleteCorpus = function deleteCorpus(request, callback) {
                            return this.rpcCall(deleteCorpus, $root.google.ai.generativelanguage.v1beta.DeleteCorpusRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteCorpus" });
    
                        /**
                         * Calls DeleteCorpus.
                         * @function deleteCorpus
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCorpusRequest} request DeleteCorpusRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|listCorpora}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef ListCorporaCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.ListCorporaResponse} [response] ListCorporaResponse
                         */
    
                        /**
                         * Calls ListCorpora.
                         * @function listCorpora
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListCorporaRequest} request ListCorporaRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.ListCorporaCallback} callback Node-style callback called with the error, if any, and ListCorporaResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.listCorpora = function listCorpora(request, callback) {
                            return this.rpcCall(listCorpora, $root.google.ai.generativelanguage.v1beta.ListCorporaRequest, $root.google.ai.generativelanguage.v1beta.ListCorporaResponse, request, callback);
                        }, "name", { value: "ListCorpora" });
    
                        /**
                         * Calls ListCorpora.
                         * @function listCorpora
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListCorporaRequest} request ListCorporaRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.ListCorporaResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|queryCorpus}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef QueryCorpusCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.QueryCorpusResponse} [response] QueryCorpusResponse
                         */
    
                        /**
                         * Calls QueryCorpus.
                         * @function queryCorpus
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IQueryCorpusRequest} request QueryCorpusRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.QueryCorpusCallback} callback Node-style callback called with the error, if any, and QueryCorpusResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.queryCorpus = function queryCorpus(request, callback) {
                            return this.rpcCall(queryCorpus, $root.google.ai.generativelanguage.v1beta.QueryCorpusRequest, $root.google.ai.generativelanguage.v1beta.QueryCorpusResponse, request, callback);
                        }, "name", { value: "QueryCorpus" });
    
                        /**
                         * Calls QueryCorpus.
                         * @function queryCorpus
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IQueryCorpusRequest} request QueryCorpusRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.QueryCorpusResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|createDocument}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef CreateDocumentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Document} [response] Document
                         */
    
                        /**
                         * Calls CreateDocument.
                         * @function createDocument
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateDocumentRequest} request CreateDocumentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.CreateDocumentCallback} callback Node-style callback called with the error, if any, and Document
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.createDocument = function createDocument(request, callback) {
                            return this.rpcCall(createDocument, $root.google.ai.generativelanguage.v1beta.CreateDocumentRequest, $root.google.ai.generativelanguage.v1beta.Document, request, callback);
                        }, "name", { value: "CreateDocument" });
    
                        /**
                         * Calls CreateDocument.
                         * @function createDocument
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateDocumentRequest} request CreateDocumentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Document>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|getDocument}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef GetDocumentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Document} [response] Document
                         */
    
                        /**
                         * Calls GetDocument.
                         * @function getDocument
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetDocumentRequest} request GetDocumentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.GetDocumentCallback} callback Node-style callback called with the error, if any, and Document
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.getDocument = function getDocument(request, callback) {
                            return this.rpcCall(getDocument, $root.google.ai.generativelanguage.v1beta.GetDocumentRequest, $root.google.ai.generativelanguage.v1beta.Document, request, callback);
                        }, "name", { value: "GetDocument" });
    
                        /**
                         * Calls GetDocument.
                         * @function getDocument
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetDocumentRequest} request GetDocumentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Document>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|updateDocument}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef UpdateDocumentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Document} [response] Document
                         */
    
                        /**
                         * Calls UpdateDocument.
                         * @function updateDocument
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.UpdateDocumentCallback} callback Node-style callback called with the error, if any, and Document
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.updateDocument = function updateDocument(request, callback) {
                            return this.rpcCall(updateDocument, $root.google.ai.generativelanguage.v1beta.UpdateDocumentRequest, $root.google.ai.generativelanguage.v1beta.Document, request, callback);
                        }, "name", { value: "UpdateDocument" });
    
                        /**
                         * Calls UpdateDocument.
                         * @function updateDocument
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Document>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|deleteDocument}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef DeleteDocumentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteDocument.
                         * @function deleteDocument
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.DeleteDocumentCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.deleteDocument = function deleteDocument(request, callback) {
                            return this.rpcCall(deleteDocument, $root.google.ai.generativelanguage.v1beta.DeleteDocumentRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteDocument" });
    
                        /**
                         * Calls DeleteDocument.
                         * @function deleteDocument
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|listDocuments}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef ListDocumentsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.ListDocumentsResponse} [response] ListDocumentsResponse
                         */
    
                        /**
                         * Calls ListDocuments.
                         * @function listDocuments
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListDocumentsRequest} request ListDocumentsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.ListDocumentsCallback} callback Node-style callback called with the error, if any, and ListDocumentsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.listDocuments = function listDocuments(request, callback) {
                            return this.rpcCall(listDocuments, $root.google.ai.generativelanguage.v1beta.ListDocumentsRequest, $root.google.ai.generativelanguage.v1beta.ListDocumentsResponse, request, callback);
                        }, "name", { value: "ListDocuments" });
    
                        /**
                         * Calls ListDocuments.
                         * @function listDocuments
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListDocumentsRequest} request ListDocumentsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.ListDocumentsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|queryDocument}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef QueryDocumentCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.QueryDocumentResponse} [response] QueryDocumentResponse
                         */
    
                        /**
                         * Calls QueryDocument.
                         * @function queryDocument
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IQueryDocumentRequest} request QueryDocumentRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.QueryDocumentCallback} callback Node-style callback called with the error, if any, and QueryDocumentResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.queryDocument = function queryDocument(request, callback) {
                            return this.rpcCall(queryDocument, $root.google.ai.generativelanguage.v1beta.QueryDocumentRequest, $root.google.ai.generativelanguage.v1beta.QueryDocumentResponse, request, callback);
                        }, "name", { value: "QueryDocument" });
    
                        /**
                         * Calls QueryDocument.
                         * @function queryDocument
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IQueryDocumentRequest} request QueryDocumentRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.QueryDocumentResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|createChunk}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef CreateChunkCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Chunk} [response] Chunk
                         */
    
                        /**
                         * Calls CreateChunk.
                         * @function createChunk
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateChunkRequest} request CreateChunkRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.CreateChunkCallback} callback Node-style callback called with the error, if any, and Chunk
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.createChunk = function createChunk(request, callback) {
                            return this.rpcCall(createChunk, $root.google.ai.generativelanguage.v1beta.CreateChunkRequest, $root.google.ai.generativelanguage.v1beta.Chunk, request, callback);
                        }, "name", { value: "CreateChunk" });
    
                        /**
                         * Calls CreateChunk.
                         * @function createChunk
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICreateChunkRequest} request CreateChunkRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Chunk>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|batchCreateChunks}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef BatchCreateChunksCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.BatchCreateChunksResponse} [response] BatchCreateChunksResponse
                         */
    
                        /**
                         * Calls BatchCreateChunks.
                         * @function batchCreateChunks
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IBatchCreateChunksRequest} request BatchCreateChunksRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.BatchCreateChunksCallback} callback Node-style callback called with the error, if any, and BatchCreateChunksResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.batchCreateChunks = function batchCreateChunks(request, callback) {
                            return this.rpcCall(batchCreateChunks, $root.google.ai.generativelanguage.v1beta.BatchCreateChunksRequest, $root.google.ai.generativelanguage.v1beta.BatchCreateChunksResponse, request, callback);
                        }, "name", { value: "BatchCreateChunks" });
    
                        /**
                         * Calls BatchCreateChunks.
                         * @function batchCreateChunks
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IBatchCreateChunksRequest} request BatchCreateChunksRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.BatchCreateChunksResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|getChunk}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef GetChunkCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Chunk} [response] Chunk
                         */
    
                        /**
                         * Calls GetChunk.
                         * @function getChunk
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetChunkRequest} request GetChunkRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.GetChunkCallback} callback Node-style callback called with the error, if any, and Chunk
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.getChunk = function getChunk(request, callback) {
                            return this.rpcCall(getChunk, $root.google.ai.generativelanguage.v1beta.GetChunkRequest, $root.google.ai.generativelanguage.v1beta.Chunk, request, callback);
                        }, "name", { value: "GetChunk" });
    
                        /**
                         * Calls GetChunk.
                         * @function getChunk
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGetChunkRequest} request GetChunkRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Chunk>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|updateChunk}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef UpdateChunkCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.Chunk} [response] Chunk
                         */
    
                        /**
                         * Calls UpdateChunk.
                         * @function updateChunk
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdateChunkRequest} request UpdateChunkRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.UpdateChunkCallback} callback Node-style callback called with the error, if any, and Chunk
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.updateChunk = function updateChunk(request, callback) {
                            return this.rpcCall(updateChunk, $root.google.ai.generativelanguage.v1beta.UpdateChunkRequest, $root.google.ai.generativelanguage.v1beta.Chunk, request, callback);
                        }, "name", { value: "UpdateChunk" });
    
                        /**
                         * Calls UpdateChunk.
                         * @function updateChunk
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IUpdateChunkRequest} request UpdateChunkRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.Chunk>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|batchUpdateChunks}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef BatchUpdateChunksCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse} [response] BatchUpdateChunksResponse
                         */
    
                        /**
                         * Calls BatchUpdateChunks.
                         * @function batchUpdateChunks
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IBatchUpdateChunksRequest} request BatchUpdateChunksRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.BatchUpdateChunksCallback} callback Node-style callback called with the error, if any, and BatchUpdateChunksResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.batchUpdateChunks = function batchUpdateChunks(request, callback) {
                            return this.rpcCall(batchUpdateChunks, $root.google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest, $root.google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse, request, callback);
                        }, "name", { value: "BatchUpdateChunks" });
    
                        /**
                         * Calls BatchUpdateChunks.
                         * @function batchUpdateChunks
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IBatchUpdateChunksRequest} request BatchUpdateChunksRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|deleteChunk}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef DeleteChunkCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteChunk.
                         * @function deleteChunk
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteChunkRequest} request DeleteChunkRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.DeleteChunkCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.deleteChunk = function deleteChunk(request, callback) {
                            return this.rpcCall(deleteChunk, $root.google.ai.generativelanguage.v1beta.DeleteChunkRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteChunk" });
    
                        /**
                         * Calls DeleteChunk.
                         * @function deleteChunk
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IDeleteChunkRequest} request DeleteChunkRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|batchDeleteChunks}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef BatchDeleteChunksCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls BatchDeleteChunks.
                         * @function batchDeleteChunks
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IBatchDeleteChunksRequest} request BatchDeleteChunksRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.BatchDeleteChunksCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.batchDeleteChunks = function batchDeleteChunks(request, callback) {
                            return this.rpcCall(batchDeleteChunks, $root.google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "BatchDeleteChunks" });
    
                        /**
                         * Calls BatchDeleteChunks.
                         * @function batchDeleteChunks
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IBatchDeleteChunksRequest} request BatchDeleteChunksRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.RetrieverService|listChunks}.
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @typedef ListChunksCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.ListChunksResponse} [response] ListChunksResponse
                         */
    
                        /**
                         * Calls ListChunks.
                         * @function listChunks
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListChunksRequest} request ListChunksRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.RetrieverService.ListChunksCallback} callback Node-style callback called with the error, if any, and ListChunksResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(RetrieverService.prototype.listChunks = function listChunks(request, callback) {
                            return this.rpcCall(listChunks, $root.google.ai.generativelanguage.v1beta.ListChunksRequest, $root.google.ai.generativelanguage.v1beta.ListChunksResponse, request, callback);
                        }, "name", { value: "ListChunks" });
    
                        /**
                         * Calls ListChunks.
                         * @function listChunks
                         * @memberof google.ai.generativelanguage.v1beta.RetrieverService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IListChunksRequest} request ListChunksRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.ListChunksResponse>} Promise
                         * @variation 2
                         */
    
                        return RetrieverService;
                    })();
    
                    v1beta.CreateCorpusRequest = (function() {
    
                        /**
                         * Properties of a CreateCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICreateCorpusRequest
                         * @property {google.ai.generativelanguage.v1beta.ICorpus|null} [corpus] CreateCorpusRequest corpus
                         */
    
                        /**
                         * Constructs a new CreateCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CreateCorpusRequest.
                         * @implements ICreateCorpusRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICreateCorpusRequest=} [properties] Properties to set
                         */
                        function CreateCorpusRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateCorpusRequest corpus.
                         * @member {google.ai.generativelanguage.v1beta.ICorpus|null|undefined} corpus
                         * @memberof google.ai.generativelanguage.v1beta.CreateCorpusRequest
                         * @instance
                         */
                        CreateCorpusRequest.prototype.corpus = null;
    
                        /**
                         * Creates a new CreateCorpusRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CreateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateCorpusRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CreateCorpusRequest} CreateCorpusRequest instance
                         */
                        CreateCorpusRequest.create = function create(properties) {
                            return new CreateCorpusRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateCorpusRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CreateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateCorpusRequest} message CreateCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateCorpusRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.corpus != null && Object.hasOwnProperty.call(message, "corpus"))
                                $root.google.ai.generativelanguage.v1beta.Corpus.encode(message.corpus, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateCorpusRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateCorpusRequest} message CreateCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateCorpusRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CreateCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CreateCorpusRequest} CreateCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateCorpusRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CreateCorpusRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.corpus = $root.google.ai.generativelanguage.v1beta.Corpus.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateCorpusRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CreateCorpusRequest} CreateCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateCorpusRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateCorpusRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CreateCorpusRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateCorpusRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.corpus != null && message.hasOwnProperty("corpus")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Corpus.verify(message.corpus);
                                if (error)
                                    return "corpus." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateCorpusRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateCorpusRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CreateCorpusRequest} CreateCorpusRequest
                         */
                        CreateCorpusRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateCorpusRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CreateCorpusRequest();
                            if (object.corpus != null) {
                                if (typeof object.corpus !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CreateCorpusRequest.corpus: object expected");
                                message.corpus = $root.google.ai.generativelanguage.v1beta.Corpus.fromObject(object.corpus);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateCorpusRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CreateCorpusRequest} message CreateCorpusRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateCorpusRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.corpus = null;
                            if (message.corpus != null && message.hasOwnProperty("corpus"))
                                object.corpus = $root.google.ai.generativelanguage.v1beta.Corpus.toObject(message.corpus, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateCorpusRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CreateCorpusRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateCorpusRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateCorpusRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CreateCorpusRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateCorpusRequest";
                        };
    
                        return CreateCorpusRequest;
                    })();
    
                    v1beta.GetCorpusRequest = (function() {
    
                        /**
                         * Properties of a GetCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGetCorpusRequest
                         * @property {string|null} [name] GetCorpusRequest name
                         */
    
                        /**
                         * Constructs a new GetCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GetCorpusRequest.
                         * @implements IGetCorpusRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGetCorpusRequest=} [properties] Properties to set
                         */
                        function GetCorpusRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetCorpusRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.GetCorpusRequest
                         * @instance
                         */
                        GetCorpusRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetCorpusRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GetCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetCorpusRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GetCorpusRequest} GetCorpusRequest instance
                         */
                        GetCorpusRequest.create = function create(properties) {
                            return new GetCorpusRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetCorpusRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GetCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetCorpusRequest} message GetCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetCorpusRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetCorpusRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetCorpusRequest} message GetCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetCorpusRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GetCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GetCorpusRequest} GetCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetCorpusRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GetCorpusRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetCorpusRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GetCorpusRequest} GetCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetCorpusRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetCorpusRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GetCorpusRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetCorpusRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetCorpusRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GetCorpusRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GetCorpusRequest} GetCorpusRequest
                         */
                        GetCorpusRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GetCorpusRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GetCorpusRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetCorpusRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GetCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GetCorpusRequest} message GetCorpusRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetCorpusRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetCorpusRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GetCorpusRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetCorpusRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetCorpusRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GetCorpusRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetCorpusRequest";
                        };
    
                        return GetCorpusRequest;
                    })();
    
                    v1beta.UpdateCorpusRequest = (function() {
    
                        /**
                         * Properties of an UpdateCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IUpdateCorpusRequest
                         * @property {google.ai.generativelanguage.v1beta.ICorpus|null} [corpus] UpdateCorpusRequest corpus
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCorpusRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdateCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an UpdateCorpusRequest.
                         * @implements IUpdateCorpusRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCorpusRequest=} [properties] Properties to set
                         */
                        function UpdateCorpusRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdateCorpusRequest corpus.
                         * @member {google.ai.generativelanguage.v1beta.ICorpus|null|undefined} corpus
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @instance
                         */
                        UpdateCorpusRequest.prototype.corpus = null;
    
                        /**
                         * UpdateCorpusRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @instance
                         */
                        UpdateCorpusRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdateCorpusRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCorpusRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.UpdateCorpusRequest} UpdateCorpusRequest instance
                         */
                        UpdateCorpusRequest.create = function create(properties) {
                            return new UpdateCorpusRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdateCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateCorpusRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCorpusRequest} message UpdateCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateCorpusRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.corpus != null && Object.hasOwnProperty.call(message, "corpus"))
                                $root.google.ai.generativelanguage.v1beta.Corpus.encode(message.corpus, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdateCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateCorpusRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateCorpusRequest} message UpdateCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdateCorpusRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.UpdateCorpusRequest} UpdateCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateCorpusRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.UpdateCorpusRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.corpus = $root.google.ai.generativelanguage.v1beta.Corpus.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdateCorpusRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.UpdateCorpusRequest} UpdateCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateCorpusRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdateCorpusRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdateCorpusRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.corpus != null && message.hasOwnProperty("corpus")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Corpus.verify(message.corpus);
                                if (error)
                                    return "corpus." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdateCorpusRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.UpdateCorpusRequest} UpdateCorpusRequest
                         */
                        UpdateCorpusRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.UpdateCorpusRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.UpdateCorpusRequest();
                            if (object.corpus != null) {
                                if (typeof object.corpus !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdateCorpusRequest.corpus: object expected");
                                message.corpus = $root.google.ai.generativelanguage.v1beta.Corpus.fromObject(object.corpus);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdateCorpusRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdateCorpusRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.UpdateCorpusRequest} message UpdateCorpusRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdateCorpusRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.corpus = null;
                                object.updateMask = null;
                            }
                            if (message.corpus != null && message.hasOwnProperty("corpus"))
                                object.corpus = $root.google.ai.generativelanguage.v1beta.Corpus.toObject(message.corpus, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdateCorpusRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdateCorpusRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdateCorpusRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.UpdateCorpusRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdateCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.UpdateCorpusRequest";
                        };
    
                        return UpdateCorpusRequest;
                    })();
    
                    v1beta.DeleteCorpusRequest = (function() {
    
                        /**
                         * Properties of a DeleteCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IDeleteCorpusRequest
                         * @property {string|null} [name] DeleteCorpusRequest name
                         * @property {boolean|null} [force] DeleteCorpusRequest force
                         */
    
                        /**
                         * Constructs a new DeleteCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a DeleteCorpusRequest.
                         * @implements IDeleteCorpusRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCorpusRequest=} [properties] Properties to set
                         */
                        function DeleteCorpusRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteCorpusRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @instance
                         */
                        DeleteCorpusRequest.prototype.name = "";
    
                        /**
                         * DeleteCorpusRequest force.
                         * @member {boolean} force
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @instance
                         */
                        DeleteCorpusRequest.prototype.force = false;
    
                        /**
                         * Creates a new DeleteCorpusRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCorpusRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.DeleteCorpusRequest} DeleteCorpusRequest instance
                         */
                        DeleteCorpusRequest.create = function create(properties) {
                            return new DeleteCorpusRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteCorpusRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCorpusRequest} message DeleteCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteCorpusRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.force != null && Object.hasOwnProperty.call(message, "force"))
                                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteCorpusRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteCorpusRequest} message DeleteCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteCorpusRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.DeleteCorpusRequest} DeleteCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteCorpusRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.DeleteCorpusRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.force = reader.bool();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteCorpusRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.DeleteCorpusRequest} DeleteCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteCorpusRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteCorpusRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteCorpusRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.force != null && message.hasOwnProperty("force"))
                                if (typeof message.force !== "boolean")
                                    return "force: boolean expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteCorpusRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.DeleteCorpusRequest} DeleteCorpusRequest
                         */
                        DeleteCorpusRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.DeleteCorpusRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.DeleteCorpusRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.force != null)
                                message.force = Boolean(object.force);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteCorpusRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.DeleteCorpusRequest} message DeleteCorpusRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteCorpusRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.force = false;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.force != null && message.hasOwnProperty("force"))
                                object.force = message.force;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteCorpusRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteCorpusRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteCorpusRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.DeleteCorpusRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DeleteCorpusRequest";
                        };
    
                        return DeleteCorpusRequest;
                    })();
    
                    v1beta.ListCorporaRequest = (function() {
    
                        /**
                         * Properties of a ListCorporaRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListCorporaRequest
                         * @property {number|null} [pageSize] ListCorporaRequest pageSize
                         * @property {string|null} [pageToken] ListCorporaRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListCorporaRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListCorporaRequest.
                         * @implements IListCorporaRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListCorporaRequest=} [properties] Properties to set
                         */
                        function ListCorporaRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListCorporaRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @instance
                         */
                        ListCorporaRequest.prototype.pageSize = 0;
    
                        /**
                         * ListCorporaRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @instance
                         */
                        ListCorporaRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListCorporaRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCorporaRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListCorporaRequest} ListCorporaRequest instance
                         */
                        ListCorporaRequest.create = function create(properties) {
                            return new ListCorporaRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListCorporaRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCorporaRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCorporaRequest} message ListCorporaRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCorporaRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListCorporaRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCorporaRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCorporaRequest} message ListCorporaRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCorporaRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListCorporaRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListCorporaRequest} ListCorporaRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCorporaRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListCorporaRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListCorporaRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListCorporaRequest} ListCorporaRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCorporaRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListCorporaRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListCorporaRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListCorporaRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListCorporaRequest} ListCorporaRequest
                         */
                        ListCorporaRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListCorporaRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListCorporaRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListCorporaRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListCorporaRequest} message ListCorporaRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListCorporaRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListCorporaRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListCorporaRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListCorporaRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListCorporaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListCorporaRequest";
                        };
    
                        return ListCorporaRequest;
                    })();
    
                    v1beta.ListCorporaResponse = (function() {
    
                        /**
                         * Properties of a ListCorporaResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListCorporaResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.ICorpus>|null} [corpora] ListCorporaResponse corpora
                         * @property {string|null} [nextPageToken] ListCorporaResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListCorporaResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListCorporaResponse.
                         * @implements IListCorporaResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListCorporaResponse=} [properties] Properties to set
                         */
                        function ListCorporaResponse(properties) {
                            this.corpora = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListCorporaResponse corpora.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ICorpus>} corpora
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @instance
                         */
                        ListCorporaResponse.prototype.corpora = $util.emptyArray;
    
                        /**
                         * ListCorporaResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @instance
                         */
                        ListCorporaResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListCorporaResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCorporaResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListCorporaResponse} ListCorporaResponse instance
                         */
                        ListCorporaResponse.create = function create(properties) {
                            return new ListCorporaResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListCorporaResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCorporaResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCorporaResponse} message ListCorporaResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCorporaResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.corpora != null && message.corpora.length)
                                for (var i = 0; i < message.corpora.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Corpus.encode(message.corpora[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListCorporaResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCorporaResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListCorporaResponse} message ListCorporaResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListCorporaResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListCorporaResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListCorporaResponse} ListCorporaResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCorporaResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListCorporaResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.corpora && message.corpora.length))
                                            message.corpora = [];
                                        message.corpora.push($root.google.ai.generativelanguage.v1beta.Corpus.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListCorporaResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListCorporaResponse} ListCorporaResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListCorporaResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListCorporaResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListCorporaResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.corpora != null && message.hasOwnProperty("corpora")) {
                                if (!Array.isArray(message.corpora))
                                    return "corpora: array expected";
                                for (var i = 0; i < message.corpora.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Corpus.verify(message.corpora[i]);
                                    if (error)
                                        return "corpora." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListCorporaResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListCorporaResponse} ListCorporaResponse
                         */
                        ListCorporaResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListCorporaResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListCorporaResponse();
                            if (object.corpora) {
                                if (!Array.isArray(object.corpora))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.ListCorporaResponse.corpora: array expected");
                                message.corpora = [];
                                for (var i = 0; i < object.corpora.length; ++i) {
                                    if (typeof object.corpora[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.ListCorporaResponse.corpora: object expected");
                                    message.corpora[i] = $root.google.ai.generativelanguage.v1beta.Corpus.fromObject(object.corpora[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListCorporaResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListCorporaResponse} message ListCorporaResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListCorporaResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.corpora = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.corpora && message.corpora.length) {
                                object.corpora = [];
                                for (var j = 0; j < message.corpora.length; ++j)
                                    object.corpora[j] = $root.google.ai.generativelanguage.v1beta.Corpus.toObject(message.corpora[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListCorporaResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListCorporaResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListCorporaResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListCorporaResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListCorporaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListCorporaResponse";
                        };
    
                        return ListCorporaResponse;
                    })();
    
                    v1beta.QueryCorpusRequest = (function() {
    
                        /**
                         * Properties of a QueryCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IQueryCorpusRequest
                         * @property {string|null} [name] QueryCorpusRequest name
                         * @property {string|null} [query] QueryCorpusRequest query
                         * @property {Array.<google.ai.generativelanguage.v1beta.IMetadataFilter>|null} [metadataFilters] QueryCorpusRequest metadataFilters
                         * @property {number|null} [resultsCount] QueryCorpusRequest resultsCount
                         */
    
                        /**
                         * Constructs a new QueryCorpusRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a QueryCorpusRequest.
                         * @implements IQueryCorpusRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IQueryCorpusRequest=} [properties] Properties to set
                         */
                        function QueryCorpusRequest(properties) {
                            this.metadataFilters = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * QueryCorpusRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @instance
                         */
                        QueryCorpusRequest.prototype.name = "";
    
                        /**
                         * QueryCorpusRequest query.
                         * @member {string} query
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @instance
                         */
                        QueryCorpusRequest.prototype.query = "";
    
                        /**
                         * QueryCorpusRequest metadataFilters.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IMetadataFilter>} metadataFilters
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @instance
                         */
                        QueryCorpusRequest.prototype.metadataFilters = $util.emptyArray;
    
                        /**
                         * QueryCorpusRequest resultsCount.
                         * @member {number} resultsCount
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @instance
                         */
                        QueryCorpusRequest.prototype.resultsCount = 0;
    
                        /**
                         * Creates a new QueryCorpusRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryCorpusRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.QueryCorpusRequest} QueryCorpusRequest instance
                         */
                        QueryCorpusRequest.create = function create(properties) {
                            return new QueryCorpusRequest(properties);
                        };
    
                        /**
                         * Encodes the specified QueryCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.QueryCorpusRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryCorpusRequest} message QueryCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryCorpusRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.query != null && Object.hasOwnProperty.call(message, "query"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.query);
                            if (message.metadataFilters != null && message.metadataFilters.length)
                                for (var i = 0; i < message.metadataFilters.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.MetadataFilter.encode(message.metadataFilters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.resultsCount != null && Object.hasOwnProperty.call(message, "resultsCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.resultsCount);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified QueryCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.QueryCorpusRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryCorpusRequest} message QueryCorpusRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a QueryCorpusRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.QueryCorpusRequest} QueryCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryCorpusRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.QueryCorpusRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.query = reader.string();
                                        break;
                                    }
                                case 3: {
                                        if (!(message.metadataFilters && message.metadataFilters.length))
                                            message.metadataFilters = [];
                                        message.metadataFilters.push($root.google.ai.generativelanguage.v1beta.MetadataFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.resultsCount = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a QueryCorpusRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.QueryCorpusRequest} QueryCorpusRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryCorpusRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a QueryCorpusRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        QueryCorpusRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.query != null && message.hasOwnProperty("query"))
                                if (!$util.isString(message.query))
                                    return "query: string expected";
                            if (message.metadataFilters != null && message.hasOwnProperty("metadataFilters")) {
                                if (!Array.isArray(message.metadataFilters))
                                    return "metadataFilters: array expected";
                                for (var i = 0; i < message.metadataFilters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.MetadataFilter.verify(message.metadataFilters[i]);
                                    if (error)
                                        return "metadataFilters." + error;
                                }
                            }
                            if (message.resultsCount != null && message.hasOwnProperty("resultsCount"))
                                if (!$util.isInteger(message.resultsCount))
                                    return "resultsCount: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a QueryCorpusRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.QueryCorpusRequest} QueryCorpusRequest
                         */
                        QueryCorpusRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.QueryCorpusRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.QueryCorpusRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.query != null)
                                message.query = String(object.query);
                            if (object.metadataFilters) {
                                if (!Array.isArray(object.metadataFilters))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.QueryCorpusRequest.metadataFilters: array expected");
                                message.metadataFilters = [];
                                for (var i = 0; i < object.metadataFilters.length; ++i) {
                                    if (typeof object.metadataFilters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.QueryCorpusRequest.metadataFilters: object expected");
                                    message.metadataFilters[i] = $root.google.ai.generativelanguage.v1beta.MetadataFilter.fromObject(object.metadataFilters[i]);
                                }
                            }
                            if (object.resultsCount != null)
                                message.resultsCount = object.resultsCount | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a QueryCorpusRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.QueryCorpusRequest} message QueryCorpusRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        QueryCorpusRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.metadataFilters = [];
                            if (options.defaults) {
                                object.name = "";
                                object.query = "";
                                object.resultsCount = 0;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.query != null && message.hasOwnProperty("query"))
                                object.query = message.query;
                            if (message.metadataFilters && message.metadataFilters.length) {
                                object.metadataFilters = [];
                                for (var j = 0; j < message.metadataFilters.length; ++j)
                                    object.metadataFilters[j] = $root.google.ai.generativelanguage.v1beta.MetadataFilter.toObject(message.metadataFilters[j], options);
                            }
                            if (message.resultsCount != null && message.hasOwnProperty("resultsCount"))
                                object.resultsCount = message.resultsCount;
                            return object;
                        };
    
                        /**
                         * Converts this QueryCorpusRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        QueryCorpusRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for QueryCorpusRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        QueryCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.QueryCorpusRequest";
                        };
    
                        return QueryCorpusRequest;
                    })();
    
                    v1beta.QueryCorpusResponse = (function() {
    
                        /**
                         * Properties of a QueryCorpusResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IQueryCorpusResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IRelevantChunk>|null} [relevantChunks] QueryCorpusResponse relevantChunks
                         */
    
                        /**
                         * Constructs a new QueryCorpusResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a QueryCorpusResponse.
                         * @implements IQueryCorpusResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IQueryCorpusResponse=} [properties] Properties to set
                         */
                        function QueryCorpusResponse(properties) {
                            this.relevantChunks = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * QueryCorpusResponse relevantChunks.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IRelevantChunk>} relevantChunks
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusResponse
                         * @instance
                         */
                        QueryCorpusResponse.prototype.relevantChunks = $util.emptyArray;
    
                        /**
                         * Creates a new QueryCorpusResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryCorpusResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.QueryCorpusResponse} QueryCorpusResponse instance
                         */
                        QueryCorpusResponse.create = function create(properties) {
                            return new QueryCorpusResponse(properties);
                        };
    
                        /**
                         * Encodes the specified QueryCorpusResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.QueryCorpusResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryCorpusResponse} message QueryCorpusResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryCorpusResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.relevantChunks != null && message.relevantChunks.length)
                                for (var i = 0; i < message.relevantChunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.RelevantChunk.encode(message.relevantChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified QueryCorpusResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.QueryCorpusResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryCorpusResponse} message QueryCorpusResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryCorpusResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a QueryCorpusResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.QueryCorpusResponse} QueryCorpusResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryCorpusResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.QueryCorpusResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.relevantChunks && message.relevantChunks.length))
                                            message.relevantChunks = [];
                                        message.relevantChunks.push($root.google.ai.generativelanguage.v1beta.RelevantChunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a QueryCorpusResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.QueryCorpusResponse} QueryCorpusResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryCorpusResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a QueryCorpusResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        QueryCorpusResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.relevantChunks != null && message.hasOwnProperty("relevantChunks")) {
                                if (!Array.isArray(message.relevantChunks))
                                    return "relevantChunks: array expected";
                                for (var i = 0; i < message.relevantChunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.RelevantChunk.verify(message.relevantChunks[i]);
                                    if (error)
                                        return "relevantChunks." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a QueryCorpusResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.QueryCorpusResponse} QueryCorpusResponse
                         */
                        QueryCorpusResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.QueryCorpusResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.QueryCorpusResponse();
                            if (object.relevantChunks) {
                                if (!Array.isArray(object.relevantChunks))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.QueryCorpusResponse.relevantChunks: array expected");
                                message.relevantChunks = [];
                                for (var i = 0; i < object.relevantChunks.length; ++i) {
                                    if (typeof object.relevantChunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.QueryCorpusResponse.relevantChunks: object expected");
                                    message.relevantChunks[i] = $root.google.ai.generativelanguage.v1beta.RelevantChunk.fromObject(object.relevantChunks[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a QueryCorpusResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.QueryCorpusResponse} message QueryCorpusResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        QueryCorpusResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.relevantChunks = [];
                            if (message.relevantChunks && message.relevantChunks.length) {
                                object.relevantChunks = [];
                                for (var j = 0; j < message.relevantChunks.length; ++j)
                                    object.relevantChunks[j] = $root.google.ai.generativelanguage.v1beta.RelevantChunk.toObject(message.relevantChunks[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this QueryCorpusResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        QueryCorpusResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for QueryCorpusResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.QueryCorpusResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        QueryCorpusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.QueryCorpusResponse";
                        };
    
                        return QueryCorpusResponse;
                    })();
    
                    v1beta.RelevantChunk = (function() {
    
                        /**
                         * Properties of a RelevantChunk.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IRelevantChunk
                         * @property {number|null} [chunkRelevanceScore] RelevantChunk chunkRelevanceScore
                         * @property {google.ai.generativelanguage.v1beta.IChunk|null} [chunk] RelevantChunk chunk
                         */
    
                        /**
                         * Constructs a new RelevantChunk.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a RelevantChunk.
                         * @implements IRelevantChunk
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IRelevantChunk=} [properties] Properties to set
                         */
                        function RelevantChunk(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * RelevantChunk chunkRelevanceScore.
                         * @member {number} chunkRelevanceScore
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @instance
                         */
                        RelevantChunk.prototype.chunkRelevanceScore = 0;
    
                        /**
                         * RelevantChunk chunk.
                         * @member {google.ai.generativelanguage.v1beta.IChunk|null|undefined} chunk
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @instance
                         */
                        RelevantChunk.prototype.chunk = null;
    
                        /**
                         * Creates a new RelevantChunk instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IRelevantChunk=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.RelevantChunk} RelevantChunk instance
                         */
                        RelevantChunk.create = function create(properties) {
                            return new RelevantChunk(properties);
                        };
    
                        /**
                         * Encodes the specified RelevantChunk message. Does not implicitly {@link google.ai.generativelanguage.v1beta.RelevantChunk.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IRelevantChunk} message RelevantChunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        RelevantChunk.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.chunkRelevanceScore != null && Object.hasOwnProperty.call(message, "chunkRelevanceScore"))
                                writer.uint32(/* id 1, wireType 5 =*/13).float(message.chunkRelevanceScore);
                            if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk"))
                                $root.google.ai.generativelanguage.v1beta.Chunk.encode(message.chunk, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified RelevantChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.RelevantChunk.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IRelevantChunk} message RelevantChunk message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        RelevantChunk.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a RelevantChunk message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.RelevantChunk} RelevantChunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        RelevantChunk.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.RelevantChunk();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.chunkRelevanceScore = reader.float();
                                        break;
                                    }
                                case 2: {
                                        message.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a RelevantChunk message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.RelevantChunk} RelevantChunk
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        RelevantChunk.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a RelevantChunk message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        RelevantChunk.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.chunkRelevanceScore != null && message.hasOwnProperty("chunkRelevanceScore"))
                                if (typeof message.chunkRelevanceScore !== "number")
                                    return "chunkRelevanceScore: number expected";
                            if (message.chunk != null && message.hasOwnProperty("chunk")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Chunk.verify(message.chunk);
                                if (error)
                                    return "chunk." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a RelevantChunk message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.RelevantChunk} RelevantChunk
                         */
                        RelevantChunk.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.RelevantChunk)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.RelevantChunk();
                            if (object.chunkRelevanceScore != null)
                                message.chunkRelevanceScore = Number(object.chunkRelevanceScore);
                            if (object.chunk != null) {
                                if (typeof object.chunk !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.RelevantChunk.chunk: object expected");
                                message.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.fromObject(object.chunk);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a RelevantChunk message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.RelevantChunk} message RelevantChunk
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        RelevantChunk.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.chunkRelevanceScore = 0;
                                object.chunk = null;
                            }
                            if (message.chunkRelevanceScore != null && message.hasOwnProperty("chunkRelevanceScore"))
                                object.chunkRelevanceScore = options.json && !isFinite(message.chunkRelevanceScore) ? String(message.chunkRelevanceScore) : message.chunkRelevanceScore;
                            if (message.chunk != null && message.hasOwnProperty("chunk"))
                                object.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.toObject(message.chunk, options);
                            return object;
                        };
    
                        /**
                         * Converts this RelevantChunk to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        RelevantChunk.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for RelevantChunk
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.RelevantChunk
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        RelevantChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.RelevantChunk";
                        };
    
                        return RelevantChunk;
                    })();
    
                    v1beta.CreateDocumentRequest = (function() {
    
                        /**
                         * Properties of a CreateDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICreateDocumentRequest
                         * @property {string|null} [parent] CreateDocumentRequest parent
                         * @property {google.ai.generativelanguage.v1beta.IDocument|null} [document] CreateDocumentRequest document
                         */
    
                        /**
                         * Constructs a new CreateDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CreateDocumentRequest.
                         * @implements ICreateDocumentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICreateDocumentRequest=} [properties] Properties to set
                         */
                        function CreateDocumentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateDocumentRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @instance
                         */
                        CreateDocumentRequest.prototype.parent = "";
    
                        /**
                         * CreateDocumentRequest document.
                         * @member {google.ai.generativelanguage.v1beta.IDocument|null|undefined} document
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @instance
                         */
                        CreateDocumentRequest.prototype.document = null;
    
                        /**
                         * Creates a new CreateDocumentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateDocumentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CreateDocumentRequest} CreateDocumentRequest instance
                         */
                        CreateDocumentRequest.create = function create(properties) {
                            return new CreateDocumentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateDocumentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateDocumentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.document != null && Object.hasOwnProperty.call(message, "document"))
                                $root.google.ai.generativelanguage.v1beta.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateDocumentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateDocumentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CreateDocumentRequest} CreateDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateDocumentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CreateDocumentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.document = $root.google.ai.generativelanguage.v1beta.Document.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CreateDocumentRequest} CreateDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateDocumentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateDocumentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateDocumentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.document != null && message.hasOwnProperty("document")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Document.verify(message.document);
                                if (error)
                                    return "document." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CreateDocumentRequest} CreateDocumentRequest
                         */
                        CreateDocumentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateDocumentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CreateDocumentRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.document != null) {
                                if (typeof object.document !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CreateDocumentRequest.document: object expected");
                                message.document = $root.google.ai.generativelanguage.v1beta.Document.fromObject(object.document);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CreateDocumentRequest} message CreateDocumentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateDocumentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.document = null;
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.document != null && message.hasOwnProperty("document"))
                                object.document = $root.google.ai.generativelanguage.v1beta.Document.toObject(message.document, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateDocumentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateDocumentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateDocumentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CreateDocumentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateDocumentRequest";
                        };
    
                        return CreateDocumentRequest;
                    })();
    
                    v1beta.GetDocumentRequest = (function() {
    
                        /**
                         * Properties of a GetDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGetDocumentRequest
                         * @property {string|null} [name] GetDocumentRequest name
                         */
    
                        /**
                         * Constructs a new GetDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GetDocumentRequest.
                         * @implements IGetDocumentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGetDocumentRequest=} [properties] Properties to set
                         */
                        function GetDocumentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetDocumentRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.GetDocumentRequest
                         * @instance
                         */
                        GetDocumentRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetDocumentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GetDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetDocumentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GetDocumentRequest} GetDocumentRequest instance
                         */
                        GetDocumentRequest.create = function create(properties) {
                            return new GetDocumentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetDocumentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GetDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetDocumentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetDocumentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetDocumentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GetDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GetDocumentRequest} GetDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetDocumentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GetDocumentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GetDocumentRequest} GetDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetDocumentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetDocumentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GetDocumentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetDocumentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GetDocumentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GetDocumentRequest} GetDocumentRequest
                         */
                        GetDocumentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GetDocumentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GetDocumentRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GetDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GetDocumentRequest} message GetDocumentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetDocumentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetDocumentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GetDocumentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetDocumentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetDocumentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GetDocumentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetDocumentRequest";
                        };
    
                        return GetDocumentRequest;
                    })();
    
                    v1beta.UpdateDocumentRequest = (function() {
    
                        /**
                         * Properties of an UpdateDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IUpdateDocumentRequest
                         * @property {google.ai.generativelanguage.v1beta.IDocument|null} [document] UpdateDocumentRequest document
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDocumentRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdateDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an UpdateDocumentRequest.
                         * @implements IUpdateDocumentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IUpdateDocumentRequest=} [properties] Properties to set
                         */
                        function UpdateDocumentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdateDocumentRequest document.
                         * @member {google.ai.generativelanguage.v1beta.IDocument|null|undefined} document
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @instance
                         */
                        UpdateDocumentRequest.prototype.document = null;
    
                        /**
                         * UpdateDocumentRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @instance
                         */
                        UpdateDocumentRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdateDocumentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateDocumentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.UpdateDocumentRequest} UpdateDocumentRequest instance
                         */
                        UpdateDocumentRequest.create = function create(properties) {
                            return new UpdateDocumentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateDocumentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateDocumentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.document != null && Object.hasOwnProperty.call(message, "document"))
                                $root.google.ai.generativelanguage.v1beta.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateDocumentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdateDocumentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.UpdateDocumentRequest} UpdateDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateDocumentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.UpdateDocumentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.document = $root.google.ai.generativelanguage.v1beta.Document.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.UpdateDocumentRequest} UpdateDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateDocumentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdateDocumentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdateDocumentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.document != null && message.hasOwnProperty("document")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Document.verify(message.document);
                                if (error)
                                    return "document." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.UpdateDocumentRequest} UpdateDocumentRequest
                         */
                        UpdateDocumentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.UpdateDocumentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.UpdateDocumentRequest();
                            if (object.document != null) {
                                if (typeof object.document !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdateDocumentRequest.document: object expected");
                                message.document = $root.google.ai.generativelanguage.v1beta.Document.fromObject(object.document);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdateDocumentRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.UpdateDocumentRequest} message UpdateDocumentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdateDocumentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.document = null;
                                object.updateMask = null;
                            }
                            if (message.document != null && message.hasOwnProperty("document"))
                                object.document = $root.google.ai.generativelanguage.v1beta.Document.toObject(message.document, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdateDocumentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdateDocumentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdateDocumentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.UpdateDocumentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.UpdateDocumentRequest";
                        };
    
                        return UpdateDocumentRequest;
                    })();
    
                    v1beta.DeleteDocumentRequest = (function() {
    
                        /**
                         * Properties of a DeleteDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IDeleteDocumentRequest
                         * @property {string|null} [name] DeleteDocumentRequest name
                         * @property {boolean|null} [force] DeleteDocumentRequest force
                         */
    
                        /**
                         * Constructs a new DeleteDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a DeleteDocumentRequest.
                         * @implements IDeleteDocumentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IDeleteDocumentRequest=} [properties] Properties to set
                         */
                        function DeleteDocumentRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteDocumentRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @instance
                         */
                        DeleteDocumentRequest.prototype.name = "";
    
                        /**
                         * DeleteDocumentRequest force.
                         * @member {boolean} force
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @instance
                         */
                        DeleteDocumentRequest.prototype.force = false;
    
                        /**
                         * Creates a new DeleteDocumentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteDocumentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.DeleteDocumentRequest} DeleteDocumentRequest instance
                         */
                        DeleteDocumentRequest.create = function create(properties) {
                            return new DeleteDocumentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteDocumentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteDocumentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.force != null && Object.hasOwnProperty.call(message, "force"))
                                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteDocumentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteDocumentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.DeleteDocumentRequest} DeleteDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteDocumentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.DeleteDocumentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.force = reader.bool();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.DeleteDocumentRequest} DeleteDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteDocumentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteDocumentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteDocumentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.force != null && message.hasOwnProperty("force"))
                                if (typeof message.force !== "boolean")
                                    return "force: boolean expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.DeleteDocumentRequest} DeleteDocumentRequest
                         */
                        DeleteDocumentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.DeleteDocumentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.DeleteDocumentRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.force != null)
                                message.force = Boolean(object.force);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.DeleteDocumentRequest} message DeleteDocumentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteDocumentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.force = false;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.force != null && message.hasOwnProperty("force"))
                                object.force = message.force;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteDocumentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteDocumentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteDocumentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.DeleteDocumentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DeleteDocumentRequest";
                        };
    
                        return DeleteDocumentRequest;
                    })();
    
                    v1beta.ListDocumentsRequest = (function() {
    
                        /**
                         * Properties of a ListDocumentsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListDocumentsRequest
                         * @property {string|null} [parent] ListDocumentsRequest parent
                         * @property {number|null} [pageSize] ListDocumentsRequest pageSize
                         * @property {string|null} [pageToken] ListDocumentsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListDocumentsRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListDocumentsRequest.
                         * @implements IListDocumentsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListDocumentsRequest=} [properties] Properties to set
                         */
                        function ListDocumentsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListDocumentsRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @instance
                         */
                        ListDocumentsRequest.prototype.parent = "";
    
                        /**
                         * ListDocumentsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @instance
                         */
                        ListDocumentsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListDocumentsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @instance
                         */
                        ListDocumentsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListDocumentsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListDocumentsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListDocumentsRequest} ListDocumentsRequest instance
                         */
                        ListDocumentsRequest.create = function create(properties) {
                            return new ListDocumentsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListDocumentsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListDocumentsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListDocumentsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListDocumentsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListDocumentsRequest} ListDocumentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListDocumentsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListDocumentsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListDocumentsRequest} ListDocumentsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListDocumentsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListDocumentsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListDocumentsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListDocumentsRequest} ListDocumentsRequest
                         */
                        ListDocumentsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListDocumentsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListDocumentsRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListDocumentsRequest} message ListDocumentsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListDocumentsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListDocumentsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListDocumentsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListDocumentsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListDocumentsRequest";
                        };
    
                        return ListDocumentsRequest;
                    })();
    
                    v1beta.ListDocumentsResponse = (function() {
    
                        /**
                         * Properties of a ListDocumentsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListDocumentsResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IDocument>|null} [documents] ListDocumentsResponse documents
                         * @property {string|null} [nextPageToken] ListDocumentsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListDocumentsResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListDocumentsResponse.
                         * @implements IListDocumentsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListDocumentsResponse=} [properties] Properties to set
                         */
                        function ListDocumentsResponse(properties) {
                            this.documents = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListDocumentsResponse documents.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IDocument>} documents
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @instance
                         */
                        ListDocumentsResponse.prototype.documents = $util.emptyArray;
    
                        /**
                         * ListDocumentsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @instance
                         */
                        ListDocumentsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListDocumentsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListDocumentsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListDocumentsResponse} ListDocumentsResponse instance
                         */
                        ListDocumentsResponse.create = function create(properties) {
                            return new ListDocumentsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListDocumentsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListDocumentsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.documents != null && message.documents.length)
                                for (var i = 0; i < message.documents.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListDocumentsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListDocumentsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListDocumentsResponse} ListDocumentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListDocumentsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListDocumentsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.documents && message.documents.length))
                                            message.documents = [];
                                        message.documents.push($root.google.ai.generativelanguage.v1beta.Document.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListDocumentsResponse} ListDocumentsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListDocumentsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListDocumentsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListDocumentsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.documents != null && message.hasOwnProperty("documents")) {
                                if (!Array.isArray(message.documents))
                                    return "documents: array expected";
                                for (var i = 0; i < message.documents.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Document.verify(message.documents[i]);
                                    if (error)
                                        return "documents." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListDocumentsResponse} ListDocumentsResponse
                         */
                        ListDocumentsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListDocumentsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListDocumentsResponse();
                            if (object.documents) {
                                if (!Array.isArray(object.documents))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.ListDocumentsResponse.documents: array expected");
                                message.documents = [];
                                for (var i = 0; i < object.documents.length; ++i) {
                                    if (typeof object.documents[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.ListDocumentsResponse.documents: object expected");
                                    message.documents[i] = $root.google.ai.generativelanguage.v1beta.Document.fromObject(object.documents[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListDocumentsResponse} message ListDocumentsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListDocumentsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.documents = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.documents && message.documents.length) {
                                object.documents = [];
                                for (var j = 0; j < message.documents.length; ++j)
                                    object.documents[j] = $root.google.ai.generativelanguage.v1beta.Document.toObject(message.documents[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListDocumentsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListDocumentsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListDocumentsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListDocumentsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListDocumentsResponse";
                        };
    
                        return ListDocumentsResponse;
                    })();
    
                    v1beta.QueryDocumentRequest = (function() {
    
                        /**
                         * Properties of a QueryDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IQueryDocumentRequest
                         * @property {string|null} [name] QueryDocumentRequest name
                         * @property {string|null} [query] QueryDocumentRequest query
                         * @property {number|null} [resultsCount] QueryDocumentRequest resultsCount
                         * @property {Array.<google.ai.generativelanguage.v1beta.IMetadataFilter>|null} [metadataFilters] QueryDocumentRequest metadataFilters
                         */
    
                        /**
                         * Constructs a new QueryDocumentRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a QueryDocumentRequest.
                         * @implements IQueryDocumentRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IQueryDocumentRequest=} [properties] Properties to set
                         */
                        function QueryDocumentRequest(properties) {
                            this.metadataFilters = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * QueryDocumentRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @instance
                         */
                        QueryDocumentRequest.prototype.name = "";
    
                        /**
                         * QueryDocumentRequest query.
                         * @member {string} query
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @instance
                         */
                        QueryDocumentRequest.prototype.query = "";
    
                        /**
                         * QueryDocumentRequest resultsCount.
                         * @member {number} resultsCount
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @instance
                         */
                        QueryDocumentRequest.prototype.resultsCount = 0;
    
                        /**
                         * QueryDocumentRequest metadataFilters.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IMetadataFilter>} metadataFilters
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @instance
                         */
                        QueryDocumentRequest.prototype.metadataFilters = $util.emptyArray;
    
                        /**
                         * Creates a new QueryDocumentRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryDocumentRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.QueryDocumentRequest} QueryDocumentRequest instance
                         */
                        QueryDocumentRequest.create = function create(properties) {
                            return new QueryDocumentRequest(properties);
                        };
    
                        /**
                         * Encodes the specified QueryDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.QueryDocumentRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryDocumentRequest} message QueryDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryDocumentRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.query != null && Object.hasOwnProperty.call(message, "query"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.query);
                            if (message.resultsCount != null && Object.hasOwnProperty.call(message, "resultsCount"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.resultsCount);
                            if (message.metadataFilters != null && message.metadataFilters.length)
                                for (var i = 0; i < message.metadataFilters.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.MetadataFilter.encode(message.metadataFilters[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified QueryDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.QueryDocumentRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryDocumentRequest} message QueryDocumentRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a QueryDocumentRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.QueryDocumentRequest} QueryDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryDocumentRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.QueryDocumentRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.query = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.resultsCount = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        if (!(message.metadataFilters && message.metadataFilters.length))
                                            message.metadataFilters = [];
                                        message.metadataFilters.push($root.google.ai.generativelanguage.v1beta.MetadataFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a QueryDocumentRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.QueryDocumentRequest} QueryDocumentRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryDocumentRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a QueryDocumentRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        QueryDocumentRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.query != null && message.hasOwnProperty("query"))
                                if (!$util.isString(message.query))
                                    return "query: string expected";
                            if (message.resultsCount != null && message.hasOwnProperty("resultsCount"))
                                if (!$util.isInteger(message.resultsCount))
                                    return "resultsCount: integer expected";
                            if (message.metadataFilters != null && message.hasOwnProperty("metadataFilters")) {
                                if (!Array.isArray(message.metadataFilters))
                                    return "metadataFilters: array expected";
                                for (var i = 0; i < message.metadataFilters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.MetadataFilter.verify(message.metadataFilters[i]);
                                    if (error)
                                        return "metadataFilters." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a QueryDocumentRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.QueryDocumentRequest} QueryDocumentRequest
                         */
                        QueryDocumentRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.QueryDocumentRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.QueryDocumentRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.query != null)
                                message.query = String(object.query);
                            if (object.resultsCount != null)
                                message.resultsCount = object.resultsCount | 0;
                            if (object.metadataFilters) {
                                if (!Array.isArray(object.metadataFilters))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.QueryDocumentRequest.metadataFilters: array expected");
                                message.metadataFilters = [];
                                for (var i = 0; i < object.metadataFilters.length; ++i) {
                                    if (typeof object.metadataFilters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.QueryDocumentRequest.metadataFilters: object expected");
                                    message.metadataFilters[i] = $root.google.ai.generativelanguage.v1beta.MetadataFilter.fromObject(object.metadataFilters[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a QueryDocumentRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.QueryDocumentRequest} message QueryDocumentRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        QueryDocumentRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.metadataFilters = [];
                            if (options.defaults) {
                                object.name = "";
                                object.query = "";
                                object.resultsCount = 0;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.query != null && message.hasOwnProperty("query"))
                                object.query = message.query;
                            if (message.resultsCount != null && message.hasOwnProperty("resultsCount"))
                                object.resultsCount = message.resultsCount;
                            if (message.metadataFilters && message.metadataFilters.length) {
                                object.metadataFilters = [];
                                for (var j = 0; j < message.metadataFilters.length; ++j)
                                    object.metadataFilters[j] = $root.google.ai.generativelanguage.v1beta.MetadataFilter.toObject(message.metadataFilters[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this QueryDocumentRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        QueryDocumentRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for QueryDocumentRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        QueryDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.QueryDocumentRequest";
                        };
    
                        return QueryDocumentRequest;
                    })();
    
                    v1beta.QueryDocumentResponse = (function() {
    
                        /**
                         * Properties of a QueryDocumentResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IQueryDocumentResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IRelevantChunk>|null} [relevantChunks] QueryDocumentResponse relevantChunks
                         */
    
                        /**
                         * Constructs a new QueryDocumentResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a QueryDocumentResponse.
                         * @implements IQueryDocumentResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IQueryDocumentResponse=} [properties] Properties to set
                         */
                        function QueryDocumentResponse(properties) {
                            this.relevantChunks = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * QueryDocumentResponse relevantChunks.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IRelevantChunk>} relevantChunks
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentResponse
                         * @instance
                         */
                        QueryDocumentResponse.prototype.relevantChunks = $util.emptyArray;
    
                        /**
                         * Creates a new QueryDocumentResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryDocumentResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.QueryDocumentResponse} QueryDocumentResponse instance
                         */
                        QueryDocumentResponse.create = function create(properties) {
                            return new QueryDocumentResponse(properties);
                        };
    
                        /**
                         * Encodes the specified QueryDocumentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.QueryDocumentResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryDocumentResponse} message QueryDocumentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryDocumentResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.relevantChunks != null && message.relevantChunks.length)
                                for (var i = 0; i < message.relevantChunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.RelevantChunk.encode(message.relevantChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified QueryDocumentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.QueryDocumentResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IQueryDocumentResponse} message QueryDocumentResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        QueryDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a QueryDocumentResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.QueryDocumentResponse} QueryDocumentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryDocumentResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.QueryDocumentResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.relevantChunks && message.relevantChunks.length))
                                            message.relevantChunks = [];
                                        message.relevantChunks.push($root.google.ai.generativelanguage.v1beta.RelevantChunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a QueryDocumentResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.QueryDocumentResponse} QueryDocumentResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        QueryDocumentResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a QueryDocumentResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        QueryDocumentResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.relevantChunks != null && message.hasOwnProperty("relevantChunks")) {
                                if (!Array.isArray(message.relevantChunks))
                                    return "relevantChunks: array expected";
                                for (var i = 0; i < message.relevantChunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.RelevantChunk.verify(message.relevantChunks[i]);
                                    if (error)
                                        return "relevantChunks." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a QueryDocumentResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.QueryDocumentResponse} QueryDocumentResponse
                         */
                        QueryDocumentResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.QueryDocumentResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.QueryDocumentResponse();
                            if (object.relevantChunks) {
                                if (!Array.isArray(object.relevantChunks))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.QueryDocumentResponse.relevantChunks: array expected");
                                message.relevantChunks = [];
                                for (var i = 0; i < object.relevantChunks.length; ++i) {
                                    if (typeof object.relevantChunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.QueryDocumentResponse.relevantChunks: object expected");
                                    message.relevantChunks[i] = $root.google.ai.generativelanguage.v1beta.RelevantChunk.fromObject(object.relevantChunks[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a QueryDocumentResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.QueryDocumentResponse} message QueryDocumentResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        QueryDocumentResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.relevantChunks = [];
                            if (message.relevantChunks && message.relevantChunks.length) {
                                object.relevantChunks = [];
                                for (var j = 0; j < message.relevantChunks.length; ++j)
                                    object.relevantChunks[j] = $root.google.ai.generativelanguage.v1beta.RelevantChunk.toObject(message.relevantChunks[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this QueryDocumentResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        QueryDocumentResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for QueryDocumentResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.QueryDocumentResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        QueryDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.QueryDocumentResponse";
                        };
    
                        return QueryDocumentResponse;
                    })();
    
                    v1beta.CreateChunkRequest = (function() {
    
                        /**
                         * Properties of a CreateChunkRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICreateChunkRequest
                         * @property {string|null} [parent] CreateChunkRequest parent
                         * @property {google.ai.generativelanguage.v1beta.IChunk|null} [chunk] CreateChunkRequest chunk
                         */
    
                        /**
                         * Constructs a new CreateChunkRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CreateChunkRequest.
                         * @implements ICreateChunkRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICreateChunkRequest=} [properties] Properties to set
                         */
                        function CreateChunkRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateChunkRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @instance
                         */
                        CreateChunkRequest.prototype.parent = "";
    
                        /**
                         * CreateChunkRequest chunk.
                         * @member {google.ai.generativelanguage.v1beta.IChunk|null|undefined} chunk
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @instance
                         */
                        CreateChunkRequest.prototype.chunk = null;
    
                        /**
                         * Creates a new CreateChunkRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateChunkRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CreateChunkRequest} CreateChunkRequest instance
                         */
                        CreateChunkRequest.create = function create(properties) {
                            return new CreateChunkRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateChunkRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateChunkRequest} message CreateChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateChunkRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk"))
                                $root.google.ai.generativelanguage.v1beta.Chunk.encode(message.chunk, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateChunkRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICreateChunkRequest} message CreateChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateChunkRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateChunkRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CreateChunkRequest} CreateChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateChunkRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CreateChunkRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateChunkRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CreateChunkRequest} CreateChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateChunkRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateChunkRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateChunkRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.chunk != null && message.hasOwnProperty("chunk")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Chunk.verify(message.chunk);
                                if (error)
                                    return "chunk." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateChunkRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CreateChunkRequest} CreateChunkRequest
                         */
                        CreateChunkRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateChunkRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CreateChunkRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.chunk != null) {
                                if (typeof object.chunk !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CreateChunkRequest.chunk: object expected");
                                message.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.fromObject(object.chunk);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateChunkRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CreateChunkRequest} message CreateChunkRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateChunkRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.chunk = null;
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.chunk != null && message.hasOwnProperty("chunk"))
                                object.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.toObject(message.chunk, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateChunkRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateChunkRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateChunkRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CreateChunkRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateChunkRequest";
                        };
    
                        return CreateChunkRequest;
                    })();
    
                    v1beta.BatchCreateChunksRequest = (function() {
    
                        /**
                         * Properties of a BatchCreateChunksRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IBatchCreateChunksRequest
                         * @property {string|null} [parent] BatchCreateChunksRequest parent
                         * @property {Array.<google.ai.generativelanguage.v1beta.ICreateChunkRequest>|null} [requests] BatchCreateChunksRequest requests
                         */
    
                        /**
                         * Constructs a new BatchCreateChunksRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a BatchCreateChunksRequest.
                         * @implements IBatchCreateChunksRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IBatchCreateChunksRequest=} [properties] Properties to set
                         */
                        function BatchCreateChunksRequest(properties) {
                            this.requests = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchCreateChunksRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @instance
                         */
                        BatchCreateChunksRequest.prototype.parent = "";
    
                        /**
                         * BatchCreateChunksRequest requests.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ICreateChunkRequest>} requests
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @instance
                         */
                        BatchCreateChunksRequest.prototype.requests = $util.emptyArray;
    
                        /**
                         * Creates a new BatchCreateChunksRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchCreateChunksRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.BatchCreateChunksRequest} BatchCreateChunksRequest instance
                         */
                        BatchCreateChunksRequest.create = function create(properties) {
                            return new BatchCreateChunksRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchCreateChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchCreateChunksRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchCreateChunksRequest} message BatchCreateChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchCreateChunksRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.requests != null && message.requests.length)
                                for (var i = 0; i < message.requests.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.CreateChunkRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchCreateChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchCreateChunksRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchCreateChunksRequest} message BatchCreateChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchCreateChunksRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchCreateChunksRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.BatchCreateChunksRequest} BatchCreateChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchCreateChunksRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.BatchCreateChunksRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.requests && message.requests.length))
                                            message.requests = [];
                                        message.requests.push($root.google.ai.generativelanguage.v1beta.CreateChunkRequest.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchCreateChunksRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.BatchCreateChunksRequest} BatchCreateChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchCreateChunksRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchCreateChunksRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchCreateChunksRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.requests != null && message.hasOwnProperty("requests")) {
                                if (!Array.isArray(message.requests))
                                    return "requests: array expected";
                                for (var i = 0; i < message.requests.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.CreateChunkRequest.verify(message.requests[i]);
                                    if (error)
                                        return "requests." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchCreateChunksRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.BatchCreateChunksRequest} BatchCreateChunksRequest
                         */
                        BatchCreateChunksRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.BatchCreateChunksRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.BatchCreateChunksRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.requests) {
                                if (!Array.isArray(object.requests))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.BatchCreateChunksRequest.requests: array expected");
                                message.requests = [];
                                for (var i = 0; i < object.requests.length; ++i) {
                                    if (typeof object.requests[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.BatchCreateChunksRequest.requests: object expected");
                                    message.requests[i] = $root.google.ai.generativelanguage.v1beta.CreateChunkRequest.fromObject(object.requests[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchCreateChunksRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.BatchCreateChunksRequest} message BatchCreateChunksRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchCreateChunksRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.requests = [];
                            if (options.defaults)
                                object.parent = "";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.requests && message.requests.length) {
                                object.requests = [];
                                for (var j = 0; j < message.requests.length; ++j)
                                    object.requests[j] = $root.google.ai.generativelanguage.v1beta.CreateChunkRequest.toObject(message.requests[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchCreateChunksRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchCreateChunksRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchCreateChunksRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchCreateChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.BatchCreateChunksRequest";
                        };
    
                        return BatchCreateChunksRequest;
                    })();
    
                    v1beta.BatchCreateChunksResponse = (function() {
    
                        /**
                         * Properties of a BatchCreateChunksResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IBatchCreateChunksResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IChunk>|null} [chunks] BatchCreateChunksResponse chunks
                         */
    
                        /**
                         * Constructs a new BatchCreateChunksResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a BatchCreateChunksResponse.
                         * @implements IBatchCreateChunksResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IBatchCreateChunksResponse=} [properties] Properties to set
                         */
                        function BatchCreateChunksResponse(properties) {
                            this.chunks = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchCreateChunksResponse chunks.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IChunk>} chunks
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
                         * @instance
                         */
                        BatchCreateChunksResponse.prototype.chunks = $util.emptyArray;
    
                        /**
                         * Creates a new BatchCreateChunksResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchCreateChunksResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.BatchCreateChunksResponse} BatchCreateChunksResponse instance
                         */
                        BatchCreateChunksResponse.create = function create(properties) {
                            return new BatchCreateChunksResponse(properties);
                        };
    
                        /**
                         * Encodes the specified BatchCreateChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchCreateChunksResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchCreateChunksResponse} message BatchCreateChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchCreateChunksResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.chunks != null && message.chunks.length)
                                for (var i = 0; i < message.chunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Chunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchCreateChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchCreateChunksResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchCreateChunksResponse} message BatchCreateChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchCreateChunksResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchCreateChunksResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.BatchCreateChunksResponse} BatchCreateChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchCreateChunksResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.BatchCreateChunksResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.chunks && message.chunks.length))
                                            message.chunks = [];
                                        message.chunks.push($root.google.ai.generativelanguage.v1beta.Chunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchCreateChunksResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.BatchCreateChunksResponse} BatchCreateChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchCreateChunksResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchCreateChunksResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchCreateChunksResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.chunks != null && message.hasOwnProperty("chunks")) {
                                if (!Array.isArray(message.chunks))
                                    return "chunks: array expected";
                                for (var i = 0; i < message.chunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Chunk.verify(message.chunks[i]);
                                    if (error)
                                        return "chunks." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchCreateChunksResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.BatchCreateChunksResponse} BatchCreateChunksResponse
                         */
                        BatchCreateChunksResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.BatchCreateChunksResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.BatchCreateChunksResponse();
                            if (object.chunks) {
                                if (!Array.isArray(object.chunks))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.BatchCreateChunksResponse.chunks: array expected");
                                message.chunks = [];
                                for (var i = 0; i < object.chunks.length; ++i) {
                                    if (typeof object.chunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.BatchCreateChunksResponse.chunks: object expected");
                                    message.chunks[i] = $root.google.ai.generativelanguage.v1beta.Chunk.fromObject(object.chunks[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchCreateChunksResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.BatchCreateChunksResponse} message BatchCreateChunksResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchCreateChunksResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.chunks = [];
                            if (message.chunks && message.chunks.length) {
                                object.chunks = [];
                                for (var j = 0; j < message.chunks.length; ++j)
                                    object.chunks[j] = $root.google.ai.generativelanguage.v1beta.Chunk.toObject(message.chunks[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchCreateChunksResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchCreateChunksResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchCreateChunksResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchCreateChunksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.BatchCreateChunksResponse";
                        };
    
                        return BatchCreateChunksResponse;
                    })();
    
                    v1beta.GetChunkRequest = (function() {
    
                        /**
                         * Properties of a GetChunkRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGetChunkRequest
                         * @property {string|null} [name] GetChunkRequest name
                         */
    
                        /**
                         * Constructs a new GetChunkRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GetChunkRequest.
                         * @implements IGetChunkRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGetChunkRequest=} [properties] Properties to set
                         */
                        function GetChunkRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetChunkRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.GetChunkRequest
                         * @instance
                         */
                        GetChunkRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetChunkRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GetChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetChunkRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GetChunkRequest} GetChunkRequest instance
                         */
                        GetChunkRequest.create = function create(properties) {
                            return new GetChunkRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetChunkRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GetChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetChunkRequest} message GetChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetChunkRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetChunkRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGetChunkRequest} message GetChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetChunkRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetChunkRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GetChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GetChunkRequest} GetChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetChunkRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GetChunkRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetChunkRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GetChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GetChunkRequest} GetChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetChunkRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetChunkRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GetChunkRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetChunkRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetChunkRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GetChunkRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GetChunkRequest} GetChunkRequest
                         */
                        GetChunkRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GetChunkRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GetChunkRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetChunkRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GetChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GetChunkRequest} message GetChunkRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetChunkRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetChunkRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GetChunkRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetChunkRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetChunkRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GetChunkRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetChunkRequest";
                        };
    
                        return GetChunkRequest;
                    })();
    
                    v1beta.UpdateChunkRequest = (function() {
    
                        /**
                         * Properties of an UpdateChunkRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IUpdateChunkRequest
                         * @property {google.ai.generativelanguage.v1beta.IChunk|null} [chunk] UpdateChunkRequest chunk
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateChunkRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdateChunkRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an UpdateChunkRequest.
                         * @implements IUpdateChunkRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IUpdateChunkRequest=} [properties] Properties to set
                         */
                        function UpdateChunkRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdateChunkRequest chunk.
                         * @member {google.ai.generativelanguage.v1beta.IChunk|null|undefined} chunk
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @instance
                         */
                        UpdateChunkRequest.prototype.chunk = null;
    
                        /**
                         * UpdateChunkRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @instance
                         */
                        UpdateChunkRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdateChunkRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateChunkRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.UpdateChunkRequest} UpdateChunkRequest instance
                         */
                        UpdateChunkRequest.create = function create(properties) {
                            return new UpdateChunkRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdateChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateChunkRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateChunkRequest} message UpdateChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateChunkRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk"))
                                $root.google.ai.generativelanguage.v1beta.Chunk.encode(message.chunk, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdateChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateChunkRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IUpdateChunkRequest} message UpdateChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateChunkRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdateChunkRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.UpdateChunkRequest} UpdateChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateChunkRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.UpdateChunkRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdateChunkRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.UpdateChunkRequest} UpdateChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateChunkRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdateChunkRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdateChunkRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.chunk != null && message.hasOwnProperty("chunk")) {
                                var error = $root.google.ai.generativelanguage.v1beta.Chunk.verify(message.chunk);
                                if (error)
                                    return "chunk." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdateChunkRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.UpdateChunkRequest} UpdateChunkRequest
                         */
                        UpdateChunkRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.UpdateChunkRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.UpdateChunkRequest();
                            if (object.chunk != null) {
                                if (typeof object.chunk !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdateChunkRequest.chunk: object expected");
                                message.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.fromObject(object.chunk);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.UpdateChunkRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdateChunkRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.UpdateChunkRequest} message UpdateChunkRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdateChunkRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.chunk = null;
                                object.updateMask = null;
                            }
                            if (message.chunk != null && message.hasOwnProperty("chunk"))
                                object.chunk = $root.google.ai.generativelanguage.v1beta.Chunk.toObject(message.chunk, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdateChunkRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdateChunkRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdateChunkRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.UpdateChunkRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdateChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.UpdateChunkRequest";
                        };
    
                        return UpdateChunkRequest;
                    })();
    
                    v1beta.BatchUpdateChunksRequest = (function() {
    
                        /**
                         * Properties of a BatchUpdateChunksRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IBatchUpdateChunksRequest
                         * @property {string|null} [parent] BatchUpdateChunksRequest parent
                         * @property {Array.<google.ai.generativelanguage.v1beta.IUpdateChunkRequest>|null} [requests] BatchUpdateChunksRequest requests
                         */
    
                        /**
                         * Constructs a new BatchUpdateChunksRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a BatchUpdateChunksRequest.
                         * @implements IBatchUpdateChunksRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IBatchUpdateChunksRequest=} [properties] Properties to set
                         */
                        function BatchUpdateChunksRequest(properties) {
                            this.requests = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchUpdateChunksRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @instance
                         */
                        BatchUpdateChunksRequest.prototype.parent = "";
    
                        /**
                         * BatchUpdateChunksRequest requests.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IUpdateChunkRequest>} requests
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @instance
                         */
                        BatchUpdateChunksRequest.prototype.requests = $util.emptyArray;
    
                        /**
                         * Creates a new BatchUpdateChunksRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchUpdateChunksRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest} BatchUpdateChunksRequest instance
                         */
                        BatchUpdateChunksRequest.create = function create(properties) {
                            return new BatchUpdateChunksRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchUpdateChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchUpdateChunksRequest} message BatchUpdateChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchUpdateChunksRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.requests != null && message.requests.length)
                                for (var i = 0; i < message.requests.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.UpdateChunkRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchUpdateChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchUpdateChunksRequest} message BatchUpdateChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchUpdateChunksRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchUpdateChunksRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest} BatchUpdateChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchUpdateChunksRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.requests && message.requests.length))
                                            message.requests = [];
                                        message.requests.push($root.google.ai.generativelanguage.v1beta.UpdateChunkRequest.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchUpdateChunksRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest} BatchUpdateChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchUpdateChunksRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchUpdateChunksRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchUpdateChunksRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.requests != null && message.hasOwnProperty("requests")) {
                                if (!Array.isArray(message.requests))
                                    return "requests: array expected";
                                for (var i = 0; i < message.requests.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.UpdateChunkRequest.verify(message.requests[i]);
                                    if (error)
                                        return "requests." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchUpdateChunksRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest} BatchUpdateChunksRequest
                         */
                        BatchUpdateChunksRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.requests) {
                                if (!Array.isArray(object.requests))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest.requests: array expected");
                                message.requests = [];
                                for (var i = 0; i < object.requests.length; ++i) {
                                    if (typeof object.requests[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest.requests: object expected");
                                    message.requests[i] = $root.google.ai.generativelanguage.v1beta.UpdateChunkRequest.fromObject(object.requests[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchUpdateChunksRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest} message BatchUpdateChunksRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchUpdateChunksRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.requests = [];
                            if (options.defaults)
                                object.parent = "";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.requests && message.requests.length) {
                                object.requests = [];
                                for (var j = 0; j < message.requests.length; ++j)
                                    object.requests[j] = $root.google.ai.generativelanguage.v1beta.UpdateChunkRequest.toObject(message.requests[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchUpdateChunksRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchUpdateChunksRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchUpdateChunksRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchUpdateChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest";
                        };
    
                        return BatchUpdateChunksRequest;
                    })();
    
                    v1beta.BatchUpdateChunksResponse = (function() {
    
                        /**
                         * Properties of a BatchUpdateChunksResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IBatchUpdateChunksResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IChunk>|null} [chunks] BatchUpdateChunksResponse chunks
                         */
    
                        /**
                         * Constructs a new BatchUpdateChunksResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a BatchUpdateChunksResponse.
                         * @implements IBatchUpdateChunksResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IBatchUpdateChunksResponse=} [properties] Properties to set
                         */
                        function BatchUpdateChunksResponse(properties) {
                            this.chunks = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchUpdateChunksResponse chunks.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IChunk>} chunks
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
                         * @instance
                         */
                        BatchUpdateChunksResponse.prototype.chunks = $util.emptyArray;
    
                        /**
                         * Creates a new BatchUpdateChunksResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchUpdateChunksResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse} BatchUpdateChunksResponse instance
                         */
                        BatchUpdateChunksResponse.create = function create(properties) {
                            return new BatchUpdateChunksResponse(properties);
                        };
    
                        /**
                         * Encodes the specified BatchUpdateChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchUpdateChunksResponse} message BatchUpdateChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchUpdateChunksResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.chunks != null && message.chunks.length)
                                for (var i = 0; i < message.chunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Chunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchUpdateChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchUpdateChunksResponse} message BatchUpdateChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchUpdateChunksResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchUpdateChunksResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse} BatchUpdateChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchUpdateChunksResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.chunks && message.chunks.length))
                                            message.chunks = [];
                                        message.chunks.push($root.google.ai.generativelanguage.v1beta.Chunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchUpdateChunksResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse} BatchUpdateChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchUpdateChunksResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchUpdateChunksResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchUpdateChunksResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.chunks != null && message.hasOwnProperty("chunks")) {
                                if (!Array.isArray(message.chunks))
                                    return "chunks: array expected";
                                for (var i = 0; i < message.chunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Chunk.verify(message.chunks[i]);
                                    if (error)
                                        return "chunks." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchUpdateChunksResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse} BatchUpdateChunksResponse
                         */
                        BatchUpdateChunksResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse();
                            if (object.chunks) {
                                if (!Array.isArray(object.chunks))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse.chunks: array expected");
                                message.chunks = [];
                                for (var i = 0; i < object.chunks.length; ++i) {
                                    if (typeof object.chunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse.chunks: object expected");
                                    message.chunks[i] = $root.google.ai.generativelanguage.v1beta.Chunk.fromObject(object.chunks[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchUpdateChunksResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse} message BatchUpdateChunksResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchUpdateChunksResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.chunks = [];
                            if (message.chunks && message.chunks.length) {
                                object.chunks = [];
                                for (var j = 0; j < message.chunks.length; ++j)
                                    object.chunks[j] = $root.google.ai.generativelanguage.v1beta.Chunk.toObject(message.chunks[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchUpdateChunksResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchUpdateChunksResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchUpdateChunksResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchUpdateChunksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse";
                        };
    
                        return BatchUpdateChunksResponse;
                    })();
    
                    v1beta.DeleteChunkRequest = (function() {
    
                        /**
                         * Properties of a DeleteChunkRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IDeleteChunkRequest
                         * @property {string|null} [name] DeleteChunkRequest name
                         */
    
                        /**
                         * Constructs a new DeleteChunkRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a DeleteChunkRequest.
                         * @implements IDeleteChunkRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IDeleteChunkRequest=} [properties] Properties to set
                         */
                        function DeleteChunkRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteChunkRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta.DeleteChunkRequest
                         * @instance
                         */
                        DeleteChunkRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeleteChunkRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.DeleteChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteChunkRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.DeleteChunkRequest} DeleteChunkRequest instance
                         */
                        DeleteChunkRequest.create = function create(properties) {
                            return new DeleteChunkRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteChunkRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteChunkRequest} message DeleteChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteChunkRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteChunkRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IDeleteChunkRequest} message DeleteChunkRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteChunkRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteChunkRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.DeleteChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.DeleteChunkRequest} DeleteChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteChunkRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.DeleteChunkRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteChunkRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.DeleteChunkRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.DeleteChunkRequest} DeleteChunkRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteChunkRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteChunkRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.DeleteChunkRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteChunkRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteChunkRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteChunkRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.DeleteChunkRequest} DeleteChunkRequest
                         */
                        DeleteChunkRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.DeleteChunkRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.DeleteChunkRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteChunkRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.DeleteChunkRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.DeleteChunkRequest} message DeleteChunkRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteChunkRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteChunkRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.DeleteChunkRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteChunkRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteChunkRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.DeleteChunkRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DeleteChunkRequest";
                        };
    
                        return DeleteChunkRequest;
                    })();
    
                    v1beta.BatchDeleteChunksRequest = (function() {
    
                        /**
                         * Properties of a BatchDeleteChunksRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IBatchDeleteChunksRequest
                         * @property {string|null} [parent] BatchDeleteChunksRequest parent
                         * @property {Array.<google.ai.generativelanguage.v1beta.IDeleteChunkRequest>|null} [requests] BatchDeleteChunksRequest requests
                         */
    
                        /**
                         * Constructs a new BatchDeleteChunksRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a BatchDeleteChunksRequest.
                         * @implements IBatchDeleteChunksRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IBatchDeleteChunksRequest=} [properties] Properties to set
                         */
                        function BatchDeleteChunksRequest(properties) {
                            this.requests = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchDeleteChunksRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @instance
                         */
                        BatchDeleteChunksRequest.prototype.parent = "";
    
                        /**
                         * BatchDeleteChunksRequest requests.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IDeleteChunkRequest>} requests
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @instance
                         */
                        BatchDeleteChunksRequest.prototype.requests = $util.emptyArray;
    
                        /**
                         * Creates a new BatchDeleteChunksRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchDeleteChunksRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest} BatchDeleteChunksRequest instance
                         */
                        BatchDeleteChunksRequest.create = function create(properties) {
                            return new BatchDeleteChunksRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchDeleteChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchDeleteChunksRequest} message BatchDeleteChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchDeleteChunksRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.requests != null && message.requests.length)
                                for (var i = 0; i < message.requests.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.DeleteChunkRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchDeleteChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchDeleteChunksRequest} message BatchDeleteChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchDeleteChunksRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchDeleteChunksRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest} BatchDeleteChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchDeleteChunksRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.requests && message.requests.length))
                                            message.requests = [];
                                        message.requests.push($root.google.ai.generativelanguage.v1beta.DeleteChunkRequest.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchDeleteChunksRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest} BatchDeleteChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchDeleteChunksRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchDeleteChunksRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchDeleteChunksRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.requests != null && message.hasOwnProperty("requests")) {
                                if (!Array.isArray(message.requests))
                                    return "requests: array expected";
                                for (var i = 0; i < message.requests.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.DeleteChunkRequest.verify(message.requests[i]);
                                    if (error)
                                        return "requests." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchDeleteChunksRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest} BatchDeleteChunksRequest
                         */
                        BatchDeleteChunksRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.requests) {
                                if (!Array.isArray(object.requests))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest.requests: array expected");
                                message.requests = [];
                                for (var i = 0; i < object.requests.length; ++i) {
                                    if (typeof object.requests[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest.requests: object expected");
                                    message.requests[i] = $root.google.ai.generativelanguage.v1beta.DeleteChunkRequest.fromObject(object.requests[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchDeleteChunksRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest} message BatchDeleteChunksRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchDeleteChunksRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.requests = [];
                            if (options.defaults)
                                object.parent = "";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.requests && message.requests.length) {
                                object.requests = [];
                                for (var j = 0; j < message.requests.length; ++j)
                                    object.requests[j] = $root.google.ai.generativelanguage.v1beta.DeleteChunkRequest.toObject(message.requests[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchDeleteChunksRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchDeleteChunksRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchDeleteChunksRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchDeleteChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest";
                        };
    
                        return BatchDeleteChunksRequest;
                    })();
    
                    v1beta.ListChunksRequest = (function() {
    
                        /**
                         * Properties of a ListChunksRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListChunksRequest
                         * @property {string|null} [parent] ListChunksRequest parent
                         * @property {number|null} [pageSize] ListChunksRequest pageSize
                         * @property {string|null} [pageToken] ListChunksRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListChunksRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListChunksRequest.
                         * @implements IListChunksRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListChunksRequest=} [properties] Properties to set
                         */
                        function ListChunksRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListChunksRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @instance
                         */
                        ListChunksRequest.prototype.parent = "";
    
                        /**
                         * ListChunksRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @instance
                         */
                        ListChunksRequest.prototype.pageSize = 0;
    
                        /**
                         * ListChunksRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @instance
                         */
                        ListChunksRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListChunksRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListChunksRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListChunksRequest} ListChunksRequest instance
                         */
                        ListChunksRequest.create = function create(properties) {
                            return new ListChunksRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListChunksRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListChunksRequest} message ListChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListChunksRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListChunksRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListChunksRequest} message ListChunksRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListChunksRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListChunksRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListChunksRequest} ListChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListChunksRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListChunksRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListChunksRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListChunksRequest} ListChunksRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListChunksRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListChunksRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListChunksRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListChunksRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListChunksRequest} ListChunksRequest
                         */
                        ListChunksRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListChunksRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListChunksRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListChunksRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListChunksRequest} message ListChunksRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListChunksRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListChunksRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListChunksRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListChunksRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListChunksRequest";
                        };
    
                        return ListChunksRequest;
                    })();
    
                    v1beta.ListChunksResponse = (function() {
    
                        /**
                         * Properties of a ListChunksResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IListChunksResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IChunk>|null} [chunks] ListChunksResponse chunks
                         * @property {string|null} [nextPageToken] ListChunksResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListChunksResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a ListChunksResponse.
                         * @implements IListChunksResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IListChunksResponse=} [properties] Properties to set
                         */
                        function ListChunksResponse(properties) {
                            this.chunks = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListChunksResponse chunks.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IChunk>} chunks
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @instance
                         */
                        ListChunksResponse.prototype.chunks = $util.emptyArray;
    
                        /**
                         * ListChunksResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @instance
                         */
                        ListChunksResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListChunksResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListChunksResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.ListChunksResponse} ListChunksResponse instance
                         */
                        ListChunksResponse.create = function create(properties) {
                            return new ListChunksResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListChunksResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListChunksResponse} message ListChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListChunksResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.chunks != null && message.chunks.length)
                                for (var i = 0; i < message.chunks.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Chunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListChunksResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IListChunksResponse} message ListChunksResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListChunksResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListChunksResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.ListChunksResponse} ListChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListChunksResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListChunksResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.chunks && message.chunks.length))
                                            message.chunks = [];
                                        message.chunks.push($root.google.ai.generativelanguage.v1beta.Chunk.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListChunksResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.ListChunksResponse} ListChunksResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListChunksResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListChunksResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListChunksResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.chunks != null && message.hasOwnProperty("chunks")) {
                                if (!Array.isArray(message.chunks))
                                    return "chunks: array expected";
                                for (var i = 0; i < message.chunks.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Chunk.verify(message.chunks[i]);
                                    if (error)
                                        return "chunks." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListChunksResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.ListChunksResponse} ListChunksResponse
                         */
                        ListChunksResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.ListChunksResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.ListChunksResponse();
                            if (object.chunks) {
                                if (!Array.isArray(object.chunks))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.ListChunksResponse.chunks: array expected");
                                message.chunks = [];
                                for (var i = 0; i < object.chunks.length; ++i) {
                                    if (typeof object.chunks[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.ListChunksResponse.chunks: object expected");
                                    message.chunks[i] = $root.google.ai.generativelanguage.v1beta.Chunk.fromObject(object.chunks[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListChunksResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ListChunksResponse} message ListChunksResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListChunksResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.chunks = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.chunks && message.chunks.length) {
                                object.chunks = [];
                                for (var j = 0; j < message.chunks.length; ++j)
                                    object.chunks[j] = $root.google.ai.generativelanguage.v1beta.Chunk.toObject(message.chunks[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListChunksResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListChunksResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListChunksResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.ListChunksResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListChunksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListChunksResponse";
                        };
    
                        return ListChunksResponse;
                    })();
    
                    v1beta.TextService = (function() {
    
                        /**
                         * Constructs a new TextService service.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a TextService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function TextService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (TextService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TextService;
    
                        /**
                         * Creates new TextService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {TextService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        TextService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.TextService|generateText}.
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @typedef GenerateTextCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.GenerateTextResponse} [response] GenerateTextResponse
                         */
    
                        /**
                         * Calls GenerateText.
                         * @function generateText
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGenerateTextRequest} request GenerateTextRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.TextService.GenerateTextCallback} callback Node-style callback called with the error, if any, and GenerateTextResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.generateText = function generateText(request, callback) {
                            return this.rpcCall(generateText, $root.google.ai.generativelanguage.v1beta.GenerateTextRequest, $root.google.ai.generativelanguage.v1beta.GenerateTextResponse, request, callback);
                        }, "name", { value: "GenerateText" });
    
                        /**
                         * Calls GenerateText.
                         * @function generateText
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IGenerateTextRequest} request GenerateTextRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.GenerateTextResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.TextService|embedText}.
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @typedef EmbedTextCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.EmbedTextResponse} [response] EmbedTextResponse
                         */
    
                        /**
                         * Calls EmbedText.
                         * @function embedText
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IEmbedTextRequest} request EmbedTextRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.TextService.EmbedTextCallback} callback Node-style callback called with the error, if any, and EmbedTextResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.embedText = function embedText(request, callback) {
                            return this.rpcCall(embedText, $root.google.ai.generativelanguage.v1beta.EmbedTextRequest, $root.google.ai.generativelanguage.v1beta.EmbedTextResponse, request, callback);
                        }, "name", { value: "EmbedText" });
    
                        /**
                         * Calls EmbedText.
                         * @function embedText
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IEmbedTextRequest} request EmbedTextRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.EmbedTextResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.TextService|batchEmbedText}.
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @typedef BatchEmbedTextCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.BatchEmbedTextResponse} [response] BatchEmbedTextResponse
                         */
    
                        /**
                         * Calls BatchEmbedText.
                         * @function batchEmbedText
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedTextRequest} request BatchEmbedTextRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.TextService.BatchEmbedTextCallback} callback Node-style callback called with the error, if any, and BatchEmbedTextResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.batchEmbedText = function batchEmbedText(request, callback) {
                            return this.rpcCall(batchEmbedText, $root.google.ai.generativelanguage.v1beta.BatchEmbedTextRequest, $root.google.ai.generativelanguage.v1beta.BatchEmbedTextResponse, request, callback);
                        }, "name", { value: "BatchEmbedText" });
    
                        /**
                         * Calls BatchEmbedText.
                         * @function batchEmbedText
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedTextRequest} request BatchEmbedTextRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.BatchEmbedTextResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta.TextService|countTextTokens}.
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @typedef CountTextTokensCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta.CountTextTokensResponse} [response] CountTextTokensResponse
                         */
    
                        /**
                         * Calls CountTextTokens.
                         * @function countTextTokens
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICountTextTokensRequest} request CountTextTokensRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta.TextService.CountTextTokensCallback} callback Node-style callback called with the error, if any, and CountTextTokensResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.countTextTokens = function countTextTokens(request, callback) {
                            return this.rpcCall(countTextTokens, $root.google.ai.generativelanguage.v1beta.CountTextTokensRequest, $root.google.ai.generativelanguage.v1beta.CountTextTokensResponse, request, callback);
                        }, "name", { value: "CountTextTokens" });
    
                        /**
                         * Calls CountTextTokens.
                         * @function countTextTokens
                         * @memberof google.ai.generativelanguage.v1beta.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta.ICountTextTokensRequest} request CountTextTokensRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta.CountTextTokensResponse>} Promise
                         * @variation 2
                         */
    
                        return TextService;
                    })();
    
                    v1beta.GenerateTextRequest = (function() {
    
                        /**
                         * Properties of a GenerateTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGenerateTextRequest
                         * @property {string|null} [model] GenerateTextRequest model
                         * @property {google.ai.generativelanguage.v1beta.ITextPrompt|null} [prompt] GenerateTextRequest prompt
                         * @property {number|null} [temperature] GenerateTextRequest temperature
                         * @property {number|null} [candidateCount] GenerateTextRequest candidateCount
                         * @property {number|null} [maxOutputTokens] GenerateTextRequest maxOutputTokens
                         * @property {number|null} [topP] GenerateTextRequest topP
                         * @property {number|null} [topK] GenerateTextRequest topK
                         * @property {Array.<google.ai.generativelanguage.v1beta.ISafetySetting>|null} [safetySettings] GenerateTextRequest safetySettings
                         * @property {Array.<string>|null} [stopSequences] GenerateTextRequest stopSequences
                         */
    
                        /**
                         * Constructs a new GenerateTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GenerateTextRequest.
                         * @implements IGenerateTextRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGenerateTextRequest=} [properties] Properties to set
                         */
                        function GenerateTextRequest(properties) {
                            this.safetySettings = [];
                            this.stopSequences = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateTextRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.model = "";
    
                        /**
                         * GenerateTextRequest prompt.
                         * @member {google.ai.generativelanguage.v1beta.ITextPrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.prompt = null;
    
                        /**
                         * GenerateTextRequest temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.temperature = null;
    
                        /**
                         * GenerateTextRequest candidateCount.
                         * @member {number|null|undefined} candidateCount
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.candidateCount = null;
    
                        /**
                         * GenerateTextRequest maxOutputTokens.
                         * @member {number|null|undefined} maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.maxOutputTokens = null;
    
                        /**
                         * GenerateTextRequest topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.topP = null;
    
                        /**
                         * GenerateTextRequest topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.topK = null;
    
                        /**
                         * GenerateTextRequest safetySettings.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ISafetySetting>} safetySettings
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.safetySettings = $util.emptyArray;
    
                        /**
                         * GenerateTextRequest stopSequences.
                         * @member {Array.<string>} stopSequences
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.stopSequences = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateTextRequest _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _candidateCount.
                         * @member {"candidateCount"|undefined} _candidateCount
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_candidateCount", {
                            get: $util.oneOfGetter($oneOfFields = ["candidateCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _maxOutputTokens.
                         * @member {"maxOutputTokens"|undefined} _maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_maxOutputTokens", {
                            get: $util.oneOfGetter($oneOfFields = ["maxOutputTokens"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateTextRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateTextRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GenerateTextRequest} GenerateTextRequest instance
                         */
                        GenerateTextRequest.create = function create(properties) {
                            return new GenerateTextRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateTextRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1beta.TextPrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature);
                            if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount);
                            if (message.maxOutputTokens != null && Object.hasOwnProperty.call(message, "maxOutputTokens"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxOutputTokens);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 6, wireType 5 =*/53).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.topK);
                            if (message.safetySettings != null && message.safetySettings.length)
                                for (var i = 0; i < message.safetySettings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.stopSequences != null && message.stopSequences.length)
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    writer.uint32(/* id 9, wireType 2 =*/74).string(message.stopSequences[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateTextRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateTextRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GenerateTextRequest} GenerateTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateTextRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1beta.TextPrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 4: {
                                        message.candidateCount = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.maxOutputTokens = reader.int32();
                                        break;
                                    }
                                case 6: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 7: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        if (!(message.safetySettings && message.safetySettings.length))
                                            message.safetySettings = [];
                                        message.safetySettings.push($root.google.ai.generativelanguage.v1beta.SafetySetting.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 9: {
                                        if (!(message.stopSequences && message.stopSequences.length))
                                            message.stopSequences = [];
                                        message.stopSequences.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateTextRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GenerateTextRequest} GenerateTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateTextRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateTextRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1beta.TextPrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                properties._candidateCount = 1;
                                if (!$util.isInteger(message.candidateCount))
                                    return "candidateCount: integer expected";
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                properties._maxOutputTokens = 1;
                                if (!$util.isInteger(message.maxOutputTokens))
                                    return "maxOutputTokens: integer expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) {
                                if (!Array.isArray(message.safetySettings))
                                    return "safetySettings: array expected";
                                for (var i = 0; i < message.safetySettings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.SafetySetting.verify(message.safetySettings[i]);
                                    if (error)
                                        return "safetySettings." + error;
                                }
                            }
                            if (message.stopSequences != null && message.hasOwnProperty("stopSequences")) {
                                if (!Array.isArray(message.stopSequences))
                                    return "stopSequences: array expected";
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    if (!$util.isString(message.stopSequences[i]))
                                        return "stopSequences: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateTextRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GenerateTextRequest} GenerateTextRequest
                         */
                        GenerateTextRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateTextRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GenerateTextRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateTextRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1beta.TextPrompt.fromObject(object.prompt);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.candidateCount != null)
                                message.candidateCount = object.candidateCount | 0;
                            if (object.maxOutputTokens != null)
                                message.maxOutputTokens = object.maxOutputTokens | 0;
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            if (object.safetySettings) {
                                if (!Array.isArray(object.safetySettings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateTextRequest.safetySettings: array expected");
                                message.safetySettings = [];
                                for (var i = 0; i < object.safetySettings.length; ++i) {
                                    if (typeof object.safetySettings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateTextRequest.safetySettings: object expected");
                                    message.safetySettings[i] = $root.google.ai.generativelanguage.v1beta.SafetySetting.fromObject(object.safetySettings[i]);
                                }
                            }
                            if (object.stopSequences) {
                                if (!Array.isArray(object.stopSequences))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateTextRequest.stopSequences: array expected");
                                message.stopSequences = [];
                                for (var i = 0; i < object.stopSequences.length; ++i)
                                    message.stopSequences[i] = String(object.stopSequences[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateTextRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GenerateTextRequest} message GenerateTextRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateTextRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.safetySettings = [];
                                object.stopSequences = [];
                            }
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1beta.TextPrompt.toObject(message.prompt, options);
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                object.candidateCount = message.candidateCount;
                                if (options.oneofs)
                                    object._candidateCount = "candidateCount";
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                object.maxOutputTokens = message.maxOutputTokens;
                                if (options.oneofs)
                                    object._maxOutputTokens = "maxOutputTokens";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.safetySettings && message.safetySettings.length) {
                                object.safetySettings = [];
                                for (var j = 0; j < message.safetySettings.length; ++j)
                                    object.safetySettings[j] = $root.google.ai.generativelanguage.v1beta.SafetySetting.toObject(message.safetySettings[j], options);
                            }
                            if (message.stopSequences && message.stopSequences.length) {
                                object.stopSequences = [];
                                for (var j = 0; j < message.stopSequences.length; ++j)
                                    object.stopSequences[j] = message.stopSequences[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateTextRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateTextRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateTextRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateTextRequest";
                        };
    
                        return GenerateTextRequest;
                    })();
    
                    v1beta.GenerateTextResponse = (function() {
    
                        /**
                         * Properties of a GenerateTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IGenerateTextResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.ITextCompletion>|null} [candidates] GenerateTextResponse candidates
                         * @property {Array.<google.ai.generativelanguage.v1beta.IContentFilter>|null} [filters] GenerateTextResponse filters
                         * @property {Array.<google.ai.generativelanguage.v1beta.ISafetyFeedback>|null} [safetyFeedback] GenerateTextResponse safetyFeedback
                         */
    
                        /**
                         * Constructs a new GenerateTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a GenerateTextResponse.
                         * @implements IGenerateTextResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IGenerateTextResponse=} [properties] Properties to set
                         */
                        function GenerateTextResponse(properties) {
                            this.candidates = [];
                            this.filters = [];
                            this.safetyFeedback = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateTextResponse candidates.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ITextCompletion>} candidates
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.candidates = $util.emptyArray;
    
                        /**
                         * GenerateTextResponse filters.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IContentFilter>} filters
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.filters = $util.emptyArray;
    
                        /**
                         * GenerateTextResponse safetyFeedback.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ISafetyFeedback>} safetyFeedback
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.safetyFeedback = $util.emptyArray;
    
                        /**
                         * Creates a new GenerateTextResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateTextResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.GenerateTextResponse} GenerateTextResponse instance
                         */
                        GenerateTextResponse.create = function create(properties) {
                            return new GenerateTextResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateTextResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidates != null && message.candidates.length)
                                for (var i = 0; i < message.candidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.TextCompletion.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.filters != null && message.filters.length)
                                for (var i = 0; i < message.filters.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.safetyFeedback != null && message.safetyFeedback.length)
                                for (var i = 0; i < message.safetyFeedback.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.SafetyFeedback.encode(message.safetyFeedback[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateTextResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateTextResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.GenerateTextResponse} GenerateTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateTextResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.candidates && message.candidates.length))
                                            message.candidates = [];
                                        message.candidates.push($root.google.ai.generativelanguage.v1beta.TextCompletion.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.filters && message.filters.length))
                                            message.filters = [];
                                        message.filters.push($root.google.ai.generativelanguage.v1beta.ContentFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        if (!(message.safetyFeedback && message.safetyFeedback.length))
                                            message.safetyFeedback = [];
                                        message.safetyFeedback.push($root.google.ai.generativelanguage.v1beta.SafetyFeedback.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateTextResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.GenerateTextResponse} GenerateTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateTextResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateTextResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                if (!Array.isArray(message.candidates))
                                    return "candidates: array expected";
                                for (var i = 0; i < message.candidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.TextCompletion.verify(message.candidates[i]);
                                    if (error)
                                        return "candidates." + error;
                                }
                            }
                            if (message.filters != null && message.hasOwnProperty("filters")) {
                                if (!Array.isArray(message.filters))
                                    return "filters: array expected";
                                for (var i = 0; i < message.filters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.ContentFilter.verify(message.filters[i]);
                                    if (error)
                                        return "filters." + error;
                                }
                            }
                            if (message.safetyFeedback != null && message.hasOwnProperty("safetyFeedback")) {
                                if (!Array.isArray(message.safetyFeedback))
                                    return "safetyFeedback: array expected";
                                for (var i = 0; i < message.safetyFeedback.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.SafetyFeedback.verify(message.safetyFeedback[i]);
                                    if (error)
                                        return "safetyFeedback." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateTextResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.GenerateTextResponse} GenerateTextResponse
                         */
                        GenerateTextResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateTextResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.GenerateTextResponse();
                            if (object.candidates) {
                                if (!Array.isArray(object.candidates))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateTextResponse.candidates: array expected");
                                message.candidates = [];
                                for (var i = 0; i < object.candidates.length; ++i) {
                                    if (typeof object.candidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateTextResponse.candidates: object expected");
                                    message.candidates[i] = $root.google.ai.generativelanguage.v1beta.TextCompletion.fromObject(object.candidates[i]);
                                }
                            }
                            if (object.filters) {
                                if (!Array.isArray(object.filters))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateTextResponse.filters: array expected");
                                message.filters = [];
                                for (var i = 0; i < object.filters.length; ++i) {
                                    if (typeof object.filters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateTextResponse.filters: object expected");
                                    message.filters[i] = $root.google.ai.generativelanguage.v1beta.ContentFilter.fromObject(object.filters[i]);
                                }
                            }
                            if (object.safetyFeedback) {
                                if (!Array.isArray(object.safetyFeedback))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.GenerateTextResponse.safetyFeedback: array expected");
                                message.safetyFeedback = [];
                                for (var i = 0; i < object.safetyFeedback.length; ++i) {
                                    if (typeof object.safetyFeedback[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.GenerateTextResponse.safetyFeedback: object expected");
                                    message.safetyFeedback[i] = $root.google.ai.generativelanguage.v1beta.SafetyFeedback.fromObject(object.safetyFeedback[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateTextResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.GenerateTextResponse} message GenerateTextResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateTextResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.candidates = [];
                                object.filters = [];
                                object.safetyFeedback = [];
                            }
                            if (message.candidates && message.candidates.length) {
                                object.candidates = [];
                                for (var j = 0; j < message.candidates.length; ++j)
                                    object.candidates[j] = $root.google.ai.generativelanguage.v1beta.TextCompletion.toObject(message.candidates[j], options);
                            }
                            if (message.filters && message.filters.length) {
                                object.filters = [];
                                for (var j = 0; j < message.filters.length; ++j)
                                    object.filters[j] = $root.google.ai.generativelanguage.v1beta.ContentFilter.toObject(message.filters[j], options);
                            }
                            if (message.safetyFeedback && message.safetyFeedback.length) {
                                object.safetyFeedback = [];
                                for (var j = 0; j < message.safetyFeedback.length; ++j)
                                    object.safetyFeedback[j] = $root.google.ai.generativelanguage.v1beta.SafetyFeedback.toObject(message.safetyFeedback[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateTextResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateTextResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateTextResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.GenerateTextResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateTextResponse";
                        };
    
                        return GenerateTextResponse;
                    })();
    
                    v1beta.TextPrompt = (function() {
    
                        /**
                         * Properties of a TextPrompt.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ITextPrompt
                         * @property {string|null} [text] TextPrompt text
                         */
    
                        /**
                         * Constructs a new TextPrompt.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a TextPrompt.
                         * @implements ITextPrompt
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ITextPrompt=} [properties] Properties to set
                         */
                        function TextPrompt(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TextPrompt text.
                         * @member {string} text
                         * @memberof google.ai.generativelanguage.v1beta.TextPrompt
                         * @instance
                         */
                        TextPrompt.prototype.text = "";
    
                        /**
                         * Creates a new TextPrompt instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITextPrompt=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.TextPrompt} TextPrompt instance
                         */
                        TextPrompt.create = function create(properties) {
                            return new TextPrompt(properties);
                        };
    
                        /**
                         * Encodes the specified TextPrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta.TextPrompt.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITextPrompt} message TextPrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextPrompt.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TextPrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.TextPrompt.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITextPrompt} message TextPrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextPrompt.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TextPrompt message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.TextPrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.TextPrompt} TextPrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextPrompt.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.TextPrompt();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TextPrompt message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TextPrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.TextPrompt} TextPrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextPrompt.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TextPrompt message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.TextPrompt
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TextPrompt.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.text != null && message.hasOwnProperty("text"))
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TextPrompt message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.TextPrompt
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.TextPrompt} TextPrompt
                         */
                        TextPrompt.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.TextPrompt)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.TextPrompt();
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TextPrompt message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.TextPrompt} message TextPrompt
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TextPrompt.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.text = "";
                            if (message.text != null && message.hasOwnProperty("text"))
                                object.text = message.text;
                            return object;
                        };
    
                        /**
                         * Converts this TextPrompt to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.TextPrompt
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TextPrompt.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TextPrompt
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.TextPrompt
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TextPrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.TextPrompt";
                        };
    
                        return TextPrompt;
                    })();
    
                    v1beta.TextCompletion = (function() {
    
                        /**
                         * Properties of a TextCompletion.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ITextCompletion
                         * @property {string|null} [output] TextCompletion output
                         * @property {Array.<google.ai.generativelanguage.v1beta.ISafetyRating>|null} [safetyRatings] TextCompletion safetyRatings
                         * @property {google.ai.generativelanguage.v1beta.ICitationMetadata|null} [citationMetadata] TextCompletion citationMetadata
                         */
    
                        /**
                         * Constructs a new TextCompletion.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a TextCompletion.
                         * @implements ITextCompletion
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ITextCompletion=} [properties] Properties to set
                         */
                        function TextCompletion(properties) {
                            this.safetyRatings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TextCompletion output.
                         * @member {string} output
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.output = "";
    
                        /**
                         * TextCompletion safetyRatings.
                         * @member {Array.<google.ai.generativelanguage.v1beta.ISafetyRating>} safetyRatings
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.safetyRatings = $util.emptyArray;
    
                        /**
                         * TextCompletion citationMetadata.
                         * @member {google.ai.generativelanguage.v1beta.ICitationMetadata|null|undefined} citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.citationMetadata = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TextCompletion _citationMetadata.
                         * @member {"citationMetadata"|undefined} _citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @instance
                         */
                        Object.defineProperty(TextCompletion.prototype, "_citationMetadata", {
                            get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TextCompletion instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITextCompletion=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.TextCompletion} TextCompletion instance
                         */
                        TextCompletion.create = function create(properties) {
                            return new TextCompletion(properties);
                        };
    
                        /**
                         * Encodes the specified TextCompletion message. Does not implicitly {@link google.ai.generativelanguage.v1beta.TextCompletion.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITextCompletion} message TextCompletion message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextCompletion.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.output);
                            if (message.safetyRatings != null && message.safetyRatings.length)
                                for (var i = 0; i < message.safetyRatings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata"))
                                $root.google.ai.generativelanguage.v1beta.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TextCompletion message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.TextCompletion.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ITextCompletion} message TextCompletion message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextCompletion.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TextCompletion message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.TextCompletion} TextCompletion
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextCompletion.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.TextCompletion();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.output = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.safetyRatings && message.safetyRatings.length))
                                            message.safetyRatings = [];
                                        message.safetyRatings.push($root.google.ai.generativelanguage.v1beta.SafetyRating.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        message.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TextCompletion message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.TextCompletion} TextCompletion
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextCompletion.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TextCompletion message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TextCompletion.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.output != null && message.hasOwnProperty("output"))
                                if (!$util.isString(message.output))
                                    return "output: string expected";
                            if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                if (!Array.isArray(message.safetyRatings))
                                    return "safetyRatings: array expected";
                                for (var i = 0; i < message.safetyRatings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.SafetyRating.verify(message.safetyRatings[i]);
                                    if (error)
                                        return "safetyRatings." + error;
                                }
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                properties._citationMetadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.CitationMetadata.verify(message.citationMetadata);
                                    if (error)
                                        return "citationMetadata." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TextCompletion message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.TextCompletion} TextCompletion
                         */
                        TextCompletion.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.TextCompletion)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.TextCompletion();
                            if (object.output != null)
                                message.output = String(object.output);
                            if (object.safetyRatings) {
                                if (!Array.isArray(object.safetyRatings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TextCompletion.safetyRatings: array expected");
                                message.safetyRatings = [];
                                for (var i = 0; i < object.safetyRatings.length; ++i) {
                                    if (typeof object.safetyRatings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.TextCompletion.safetyRatings: object expected");
                                    message.safetyRatings[i] = $root.google.ai.generativelanguage.v1beta.SafetyRating.fromObject(object.safetyRatings[i]);
                                }
                            }
                            if (object.citationMetadata != null) {
                                if (typeof object.citationMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.TextCompletion.citationMetadata: object expected");
                                message.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.fromObject(object.citationMetadata);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TextCompletion message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.TextCompletion} message TextCompletion
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TextCompletion.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.safetyRatings = [];
                            if (options.defaults)
                                object.output = "";
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = message.output;
                            if (message.safetyRatings && message.safetyRatings.length) {
                                object.safetyRatings = [];
                                for (var j = 0; j < message.safetyRatings.length; ++j)
                                    object.safetyRatings[j] = $root.google.ai.generativelanguage.v1beta.SafetyRating.toObject(message.safetyRatings[j], options);
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                object.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.toObject(message.citationMetadata, options);
                                if (options.oneofs)
                                    object._citationMetadata = "citationMetadata";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TextCompletion to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TextCompletion.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TextCompletion
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.TextCompletion
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TextCompletion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.TextCompletion";
                        };
    
                        return TextCompletion;
                    })();
    
                    v1beta.EmbedTextRequest = (function() {
    
                        /**
                         * Properties of an EmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IEmbedTextRequest
                         * @property {string|null} [model] EmbedTextRequest model
                         * @property {string|null} [text] EmbedTextRequest text
                         */
    
                        /**
                         * Constructs a new EmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an EmbedTextRequest.
                         * @implements IEmbedTextRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IEmbedTextRequest=} [properties] Properties to set
                         */
                        function EmbedTextRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedTextRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @instance
                         */
                        EmbedTextRequest.prototype.model = "";
    
                        /**
                         * EmbedTextRequest text.
                         * @member {string} text
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @instance
                         */
                        EmbedTextRequest.prototype.text = "";
    
                        /**
                         * Creates a new EmbedTextRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedTextRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.EmbedTextRequest} EmbedTextRequest instance
                         */
                        EmbedTextRequest.create = function create(properties) {
                            return new EmbedTextRequest(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.EmbedTextRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.EmbedTextRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedTextRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.EmbedTextRequest} EmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.EmbedTextRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedTextRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.EmbedTextRequest} EmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedTextRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedTextRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.text != null && message.hasOwnProperty("text"))
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            return null;
                        };
    
                        /**
                         * Creates an EmbedTextRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.EmbedTextRequest} EmbedTextRequest
                         */
                        EmbedTextRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.EmbedTextRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.EmbedTextRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedTextRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.EmbedTextRequest} message EmbedTextRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedTextRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.text = "";
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.text != null && message.hasOwnProperty("text"))
                                object.text = message.text;
                            return object;
                        };
    
                        /**
                         * Converts this EmbedTextRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedTextRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedTextRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.EmbedTextRequest";
                        };
    
                        return EmbedTextRequest;
                    })();
    
                    v1beta.EmbedTextResponse = (function() {
    
                        /**
                         * Properties of an EmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IEmbedTextResponse
                         * @property {google.ai.generativelanguage.v1beta.IEmbedding|null} [embedding] EmbedTextResponse embedding
                         */
    
                        /**
                         * Constructs a new EmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an EmbedTextResponse.
                         * @implements IEmbedTextResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IEmbedTextResponse=} [properties] Properties to set
                         */
                        function EmbedTextResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedTextResponse embedding.
                         * @member {google.ai.generativelanguage.v1beta.IEmbedding|null|undefined} embedding
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @instance
                         */
                        EmbedTextResponse.prototype.embedding = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * EmbedTextResponse _embedding.
                         * @member {"embedding"|undefined} _embedding
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @instance
                         */
                        Object.defineProperty(EmbedTextResponse.prototype, "_embedding", {
                            get: $util.oneOfGetter($oneOfFields = ["embedding"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new EmbedTextResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedTextResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.EmbedTextResponse} EmbedTextResponse instance
                         */
                        EmbedTextResponse.create = function create(properties) {
                            return new EmbedTextResponse(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.EmbedTextResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embedding != null && Object.hasOwnProperty.call(message, "embedding"))
                                $root.google.ai.generativelanguage.v1beta.Embedding.encode(message.embedding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.EmbedTextResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedTextResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.EmbedTextResponse} EmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.EmbedTextResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.embedding = $root.google.ai.generativelanguage.v1beta.Embedding.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedTextResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.EmbedTextResponse} EmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedTextResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedTextResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.embedding != null && message.hasOwnProperty("embedding")) {
                                properties._embedding = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta.Embedding.verify(message.embedding);
                                    if (error)
                                        return "embedding." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates an EmbedTextResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.EmbedTextResponse} EmbedTextResponse
                         */
                        EmbedTextResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.EmbedTextResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.EmbedTextResponse();
                            if (object.embedding != null) {
                                if (typeof object.embedding !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.EmbedTextResponse.embedding: object expected");
                                message.embedding = $root.google.ai.generativelanguage.v1beta.Embedding.fromObject(object.embedding);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedTextResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.EmbedTextResponse} message EmbedTextResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedTextResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.embedding != null && message.hasOwnProperty("embedding")) {
                                object.embedding = $root.google.ai.generativelanguage.v1beta.Embedding.toObject(message.embedding, options);
                                if (options.oneofs)
                                    object._embedding = "embedding";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this EmbedTextResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedTextResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedTextResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.EmbedTextResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.EmbedTextResponse";
                        };
    
                        return EmbedTextResponse;
                    })();
    
                    v1beta.BatchEmbedTextRequest = (function() {
    
                        /**
                         * Properties of a BatchEmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IBatchEmbedTextRequest
                         * @property {string|null} [model] BatchEmbedTextRequest model
                         * @property {Array.<string>|null} [texts] BatchEmbedTextRequest texts
                         * @property {Array.<google.ai.generativelanguage.v1beta.IEmbedTextRequest>|null} [requests] BatchEmbedTextRequest requests
                         */
    
                        /**
                         * Constructs a new BatchEmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a BatchEmbedTextRequest.
                         * @implements IBatchEmbedTextRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedTextRequest=} [properties] Properties to set
                         */
                        function BatchEmbedTextRequest(properties) {
                            this.texts = [];
                            this.requests = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedTextRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @instance
                         */
                        BatchEmbedTextRequest.prototype.model = "";
    
                        /**
                         * BatchEmbedTextRequest texts.
                         * @member {Array.<string>} texts
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @instance
                         */
                        BatchEmbedTextRequest.prototype.texts = $util.emptyArray;
    
                        /**
                         * BatchEmbedTextRequest requests.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IEmbedTextRequest>} requests
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @instance
                         */
                        BatchEmbedTextRequest.prototype.requests = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedTextRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedTextRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedTextRequest} BatchEmbedTextRequest instance
                         */
                        BatchEmbedTextRequest.create = function create(properties) {
                            return new BatchEmbedTextRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchEmbedTextRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedTextRequest} message BatchEmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.texts != null && message.texts.length)
                                for (var i = 0; i < message.texts.length; ++i)
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.texts[i]);
                            if (message.requests != null && message.requests.length)
                                for (var i = 0; i < message.requests.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.EmbedTextRequest.encode(message.requests[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchEmbedTextRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedTextRequest} message BatchEmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedTextRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedTextRequest} BatchEmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.BatchEmbedTextRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.texts && message.texts.length))
                                            message.texts = [];
                                        message.texts.push(reader.string());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.requests && message.requests.length))
                                            message.requests = [];
                                        message.requests.push($root.google.ai.generativelanguage.v1beta.EmbedTextRequest.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedTextRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedTextRequest} BatchEmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedTextRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedTextRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.texts != null && message.hasOwnProperty("texts")) {
                                if (!Array.isArray(message.texts))
                                    return "texts: array expected";
                                for (var i = 0; i < message.texts.length; ++i)
                                    if (!$util.isString(message.texts[i]))
                                        return "texts: string[] expected";
                            }
                            if (message.requests != null && message.hasOwnProperty("requests")) {
                                if (!Array.isArray(message.requests))
                                    return "requests: array expected";
                                for (var i = 0; i < message.requests.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.EmbedTextRequest.verify(message.requests[i]);
                                    if (error)
                                        return "requests." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedTextRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedTextRequest} BatchEmbedTextRequest
                         */
                        BatchEmbedTextRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.BatchEmbedTextRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.BatchEmbedTextRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.texts) {
                                if (!Array.isArray(object.texts))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.BatchEmbedTextRequest.texts: array expected");
                                message.texts = [];
                                for (var i = 0; i < object.texts.length; ++i)
                                    message.texts[i] = String(object.texts[i]);
                            }
                            if (object.requests) {
                                if (!Array.isArray(object.requests))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.BatchEmbedTextRequest.requests: array expected");
                                message.requests = [];
                                for (var i = 0; i < object.requests.length; ++i) {
                                    if (typeof object.requests[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.BatchEmbedTextRequest.requests: object expected");
                                    message.requests[i] = $root.google.ai.generativelanguage.v1beta.EmbedTextRequest.fromObject(object.requests[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedTextRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.BatchEmbedTextRequest} message BatchEmbedTextRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedTextRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.texts = [];
                                object.requests = [];
                            }
                            if (options.defaults)
                                object.model = "";
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.texts && message.texts.length) {
                                object.texts = [];
                                for (var j = 0; j < message.texts.length; ++j)
                                    object.texts[j] = message.texts[j];
                            }
                            if (message.requests && message.requests.length) {
                                object.requests = [];
                                for (var j = 0; j < message.requests.length; ++j)
                                    object.requests[j] = $root.google.ai.generativelanguage.v1beta.EmbedTextRequest.toObject(message.requests[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedTextRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedTextRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedTextRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.BatchEmbedTextRequest";
                        };
    
                        return BatchEmbedTextRequest;
                    })();
    
                    v1beta.BatchEmbedTextResponse = (function() {
    
                        /**
                         * Properties of a BatchEmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IBatchEmbedTextResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta.IEmbedding>|null} [embeddings] BatchEmbedTextResponse embeddings
                         */
    
                        /**
                         * Constructs a new BatchEmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a BatchEmbedTextResponse.
                         * @implements IBatchEmbedTextResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedTextResponse=} [properties] Properties to set
                         */
                        function BatchEmbedTextResponse(properties) {
                            this.embeddings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedTextResponse embeddings.
                         * @member {Array.<google.ai.generativelanguage.v1beta.IEmbedding>} embeddings
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
                         * @instance
                         */
                        BatchEmbedTextResponse.prototype.embeddings = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedTextResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedTextResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedTextResponse} BatchEmbedTextResponse instance
                         */
                        BatchEmbedTextResponse.create = function create(properties) {
                            return new BatchEmbedTextResponse(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchEmbedTextResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedTextResponse} message BatchEmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embeddings != null && message.embeddings.length)
                                for (var i = 0; i < message.embeddings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta.Embedding.encode(message.embeddings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.BatchEmbedTextResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IBatchEmbedTextResponse} message BatchEmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedTextResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedTextResponse} BatchEmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.BatchEmbedTextResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.embeddings && message.embeddings.length))
                                            message.embeddings = [];
                                        message.embeddings.push($root.google.ai.generativelanguage.v1beta.Embedding.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedTextResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedTextResponse} BatchEmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedTextResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedTextResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.embeddings != null && message.hasOwnProperty("embeddings")) {
                                if (!Array.isArray(message.embeddings))
                                    return "embeddings: array expected";
                                for (var i = 0; i < message.embeddings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta.Embedding.verify(message.embeddings[i]);
                                    if (error)
                                        return "embeddings." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedTextResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.BatchEmbedTextResponse} BatchEmbedTextResponse
                         */
                        BatchEmbedTextResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.BatchEmbedTextResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.BatchEmbedTextResponse();
                            if (object.embeddings) {
                                if (!Array.isArray(object.embeddings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.BatchEmbedTextResponse.embeddings: array expected");
                                message.embeddings = [];
                                for (var i = 0; i < object.embeddings.length; ++i) {
                                    if (typeof object.embeddings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta.BatchEmbedTextResponse.embeddings: object expected");
                                    message.embeddings[i] = $root.google.ai.generativelanguage.v1beta.Embedding.fromObject(object.embeddings[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedTextResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.BatchEmbedTextResponse} message BatchEmbedTextResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedTextResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.embeddings = [];
                            if (message.embeddings && message.embeddings.length) {
                                object.embeddings = [];
                                for (var j = 0; j < message.embeddings.length; ++j)
                                    object.embeddings[j] = $root.google.ai.generativelanguage.v1beta.Embedding.toObject(message.embeddings[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedTextResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedTextResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedTextResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.BatchEmbedTextResponse";
                        };
    
                        return BatchEmbedTextResponse;
                    })();
    
                    v1beta.Embedding = (function() {
    
                        /**
                         * Properties of an Embedding.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface IEmbedding
                         * @property {Array.<number>|null} [value] Embedding value
                         */
    
                        /**
                         * Constructs a new Embedding.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents an Embedding.
                         * @implements IEmbedding
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.IEmbedding=} [properties] Properties to set
                         */
                        function Embedding(properties) {
                            this.value = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Embedding value.
                         * @member {Array.<number>} value
                         * @memberof google.ai.generativelanguage.v1beta.Embedding
                         * @instance
                         */
                        Embedding.prototype.value = $util.emptyArray;
    
                        /**
                         * Creates a new Embedding instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedding=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.Embedding} Embedding instance
                         */
                        Embedding.create = function create(properties) {
                            return new Embedding(properties);
                        };
    
                        /**
                         * Encodes the specified Embedding message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Embedding.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedding} message Embedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Embedding.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.value != null && message.value.length) {
                                writer.uint32(/* id 1, wireType 2 =*/10).fork();
                                for (var i = 0; i < message.value.length; ++i)
                                    writer.float(message.value[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Embedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Embedding.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.IEmbedding} message Embedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Embedding.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an Embedding message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.Embedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.Embedding} Embedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Embedding.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Embedding();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.value && message.value.length))
                                            message.value = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.value.push(reader.float());
                                        } else
                                            message.value.push(reader.float());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an Embedding message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.Embedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.Embedding} Embedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Embedding.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an Embedding message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.Embedding
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Embedding.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.value != null && message.hasOwnProperty("value")) {
                                if (!Array.isArray(message.value))
                                    return "value: array expected";
                                for (var i = 0; i < message.value.length; ++i)
                                    if (typeof message.value[i] !== "number")
                                        return "value: number[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates an Embedding message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.Embedding
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.Embedding} Embedding
                         */
                        Embedding.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.Embedding)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.Embedding();
                            if (object.value) {
                                if (!Array.isArray(object.value))
                                    throw TypeError(".google.ai.generativelanguage.v1beta.Embedding.value: array expected");
                                message.value = [];
                                for (var i = 0; i < object.value.length; ++i)
                                    message.value[i] = Number(object.value[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an Embedding message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.Embedding} message Embedding
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Embedding.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.value = [];
                            if (message.value && message.value.length) {
                                object.value = [];
                                for (var j = 0; j < message.value.length; ++j)
                                    object.value[j] = options.json && !isFinite(message.value[j]) ? String(message.value[j]) : message.value[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Embedding to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.Embedding
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Embedding.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Embedding
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.Embedding
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Embedding.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Embedding";
                        };
    
                        return Embedding;
                    })();
    
                    v1beta.CountTextTokensRequest = (function() {
    
                        /**
                         * Properties of a CountTextTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICountTextTokensRequest
                         * @property {string|null} [model] CountTextTokensRequest model
                         * @property {google.ai.generativelanguage.v1beta.ITextPrompt|null} [prompt] CountTextTokensRequest prompt
                         */
    
                        /**
                         * Constructs a new CountTextTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CountTextTokensRequest.
                         * @implements ICountTextTokensRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICountTextTokensRequest=} [properties] Properties to set
                         */
                        function CountTextTokensRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTextTokensRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @instance
                         */
                        CountTextTokensRequest.prototype.model = "";
    
                        /**
                         * CountTextTokensRequest prompt.
                         * @member {google.ai.generativelanguage.v1beta.ITextPrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @instance
                         */
                        CountTextTokensRequest.prototype.prompt = null;
    
                        /**
                         * Creates a new CountTextTokensRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTextTokensRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CountTextTokensRequest} CountTextTokensRequest instance
                         */
                        CountTextTokensRequest.create = function create(properties) {
                            return new CountTextTokensRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CountTextTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountTextTokensRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTextTokensRequest} message CountTextTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1beta.TextPrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTextTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountTextTokensRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTextTokensRequest} message CountTextTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTextTokensRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CountTextTokensRequest} CountTextTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CountTextTokensRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1beta.TextPrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTextTokensRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CountTextTokensRequest} CountTextTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTextTokensRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTextTokensRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1beta.TextPrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CountTextTokensRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CountTextTokensRequest} CountTextTokensRequest
                         */
                        CountTextTokensRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CountTextTokensRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CountTextTokensRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta.CountTextTokensRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1beta.TextPrompt.fromObject(object.prompt);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTextTokensRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CountTextTokensRequest} message CountTextTokensRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTextTokensRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1beta.TextPrompt.toObject(message.prompt, options);
                            return object;
                        };
    
                        /**
                         * Converts this CountTextTokensRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTextTokensRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTextTokensRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTextTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CountTextTokensRequest";
                        };
    
                        return CountTextTokensRequest;
                    })();
    
                    v1beta.CountTextTokensResponse = (function() {
    
                        /**
                         * Properties of a CountTextTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @interface ICountTextTokensResponse
                         * @property {number|null} [tokenCount] CountTextTokensResponse tokenCount
                         */
    
                        /**
                         * Constructs a new CountTextTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta
                         * @classdesc Represents a CountTextTokensResponse.
                         * @implements ICountTextTokensResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta.ICountTextTokensResponse=} [properties] Properties to set
                         */
                        function CountTextTokensResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTextTokensResponse tokenCount.
                         * @member {number} tokenCount
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensResponse
                         * @instance
                         */
                        CountTextTokensResponse.prototype.tokenCount = 0;
    
                        /**
                         * Creates a new CountTextTokensResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTextTokensResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta.CountTextTokensResponse} CountTextTokensResponse instance
                         */
                        CountTextTokensResponse.create = function create(properties) {
                            return new CountTextTokensResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CountTextTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountTextTokensResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTextTokensResponse} message CountTextTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tokenCount);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTextTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountTextTokensResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.ICountTextTokensResponse} message CountTextTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTextTokensResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta.CountTextTokensResponse} CountTextTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CountTextTokensResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tokenCount = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTextTokensResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta.CountTextTokensResponse} CountTextTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTextTokensResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTextTokensResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                if (!$util.isInteger(message.tokenCount))
                                    return "tokenCount: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a CountTextTokensResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta.CountTextTokensResponse} CountTextTokensResponse
                         */
                        CountTextTokensResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta.CountTextTokensResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta.CountTextTokensResponse();
                            if (object.tokenCount != null)
                                message.tokenCount = object.tokenCount | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTextTokensResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta.CountTextTokensResponse} message CountTextTokensResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTextTokensResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.tokenCount = 0;
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                object.tokenCount = message.tokenCount;
                            return object;
                        };
    
                        /**
                         * Converts this CountTextTokensResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTextTokensResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTextTokensResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta.CountTextTokensResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTextTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CountTextTokensResponse";
                        };
    
                        return CountTextTokensResponse;
                    })();
    
                    return v1beta;
                })();
    
                generativelanguage.v1beta2 = (function() {
    
                    /**
                     * Namespace v1beta2.
                     * @memberof google.ai.generativelanguage
                     * @namespace
                     */
                    var v1beta2 = {};
    
                    v1beta2.CitationMetadata = (function() {
    
                        /**
                         * Properties of a CitationMetadata.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface ICitationMetadata
                         * @property {Array.<google.ai.generativelanguage.v1beta2.ICitationSource>|null} [citationSources] CitationMetadata citationSources
                         */
    
                        /**
                         * Constructs a new CitationMetadata.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a CitationMetadata.
                         * @implements ICitationMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.ICitationMetadata=} [properties] Properties to set
                         */
                        function CitationMetadata(properties) {
                            this.citationSources = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CitationMetadata citationSources.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.ICitationSource>} citationSources
                         * @memberof google.ai.generativelanguage.v1beta2.CitationMetadata
                         * @instance
                         */
                        CitationMetadata.prototype.citationSources = $util.emptyArray;
    
                        /**
                         * Creates a new CitationMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICitationMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.CitationMetadata} CitationMetadata instance
                         */
                        CitationMetadata.create = function create(properties) {
                            return new CitationMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.CitationMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICitationMetadata} message CitationMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.citationSources != null && message.citationSources.length)
                                for (var i = 0; i < message.citationSources.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.CitationSource.encode(message.citationSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.CitationMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICitationMetadata} message CitationMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CitationMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.CitationMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.CitationMetadata} CitationMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.CitationMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.citationSources && message.citationSources.length))
                                            message.citationSources = [];
                                        message.citationSources.push($root.google.ai.generativelanguage.v1beta2.CitationSource.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CitationMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.CitationMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.CitationMetadata} CitationMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CitationMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.CitationMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CitationMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.citationSources != null && message.hasOwnProperty("citationSources")) {
                                if (!Array.isArray(message.citationSources))
                                    return "citationSources: array expected";
                                for (var i = 0; i < message.citationSources.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.CitationSource.verify(message.citationSources[i]);
                                    if (error)
                                        return "citationSources." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CitationMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.CitationMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.CitationMetadata} CitationMetadata
                         */
                        CitationMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.CitationMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.CitationMetadata();
                            if (object.citationSources) {
                                if (!Array.isArray(object.citationSources))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.CitationMetadata.citationSources: array expected");
                                message.citationSources = [];
                                for (var i = 0; i < object.citationSources.length; ++i) {
                                    if (typeof object.citationSources[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.CitationMetadata.citationSources: object expected");
                                    message.citationSources[i] = $root.google.ai.generativelanguage.v1beta2.CitationSource.fromObject(object.citationSources[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CitationMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.CitationMetadata} message CitationMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CitationMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.citationSources = [];
                            if (message.citationSources && message.citationSources.length) {
                                object.citationSources = [];
                                for (var j = 0; j < message.citationSources.length; ++j)
                                    object.citationSources[j] = $root.google.ai.generativelanguage.v1beta2.CitationSource.toObject(message.citationSources[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CitationMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.CitationMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CitationMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CitationMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.CitationMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CitationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.CitationMetadata";
                        };
    
                        return CitationMetadata;
                    })();
    
                    v1beta2.CitationSource = (function() {
    
                        /**
                         * Properties of a CitationSource.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface ICitationSource
                         * @property {number|null} [startIndex] CitationSource startIndex
                         * @property {number|null} [endIndex] CitationSource endIndex
                         * @property {string|null} [uri] CitationSource uri
                         * @property {string|null} [license] CitationSource license
                         */
    
                        /**
                         * Constructs a new CitationSource.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a CitationSource.
                         * @implements ICitationSource
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.ICitationSource=} [properties] Properties to set
                         */
                        function CitationSource(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CitationSource startIndex.
                         * @member {number|null|undefined} startIndex
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.startIndex = null;
    
                        /**
                         * CitationSource endIndex.
                         * @member {number|null|undefined} endIndex
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.endIndex = null;
    
                        /**
                         * CitationSource uri.
                         * @member {string|null|undefined} uri
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.uri = null;
    
                        /**
                         * CitationSource license.
                         * @member {string|null|undefined} license
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.license = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CitationSource _startIndex.
                         * @member {"startIndex"|undefined} _startIndex
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_startIndex", {
                            get: $util.oneOfGetter($oneOfFields = ["startIndex"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _endIndex.
                         * @member {"endIndex"|undefined} _endIndex
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_endIndex", {
                            get: $util.oneOfGetter($oneOfFields = ["endIndex"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _uri.
                         * @member {"uri"|undefined} _uri
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_uri", {
                            get: $util.oneOfGetter($oneOfFields = ["uri"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _license.
                         * @member {"license"|undefined} _license
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_license", {
                            get: $util.oneOfGetter($oneOfFields = ["license"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CitationSource instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICitationSource=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.CitationSource} CitationSource instance
                         */
                        CitationSource.create = function create(properties) {
                            return new CitationSource(properties);
                        };
    
                        /**
                         * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.CitationSource.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICitationSource} message CitationSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationSource.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startIndex);
                            if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endIndex);
                            if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri);
                            if (message.license != null && Object.hasOwnProperty.call(message, "license"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.license);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.CitationSource.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICitationSource} message CitationSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationSource.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CitationSource message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.CitationSource} CitationSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationSource.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.CitationSource();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.startIndex = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.endIndex = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.uri = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.license = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CitationSource message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.CitationSource} CitationSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationSource.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CitationSource message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CitationSource.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.startIndex != null && message.hasOwnProperty("startIndex")) {
                                properties._startIndex = 1;
                                if (!$util.isInteger(message.startIndex))
                                    return "startIndex: integer expected";
                            }
                            if (message.endIndex != null && message.hasOwnProperty("endIndex")) {
                                properties._endIndex = 1;
                                if (!$util.isInteger(message.endIndex))
                                    return "endIndex: integer expected";
                            }
                            if (message.uri != null && message.hasOwnProperty("uri")) {
                                properties._uri = 1;
                                if (!$util.isString(message.uri))
                                    return "uri: string expected";
                            }
                            if (message.license != null && message.hasOwnProperty("license")) {
                                properties._license = 1;
                                if (!$util.isString(message.license))
                                    return "license: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CitationSource message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.CitationSource} CitationSource
                         */
                        CitationSource.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.CitationSource)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.CitationSource();
                            if (object.startIndex != null)
                                message.startIndex = object.startIndex | 0;
                            if (object.endIndex != null)
                                message.endIndex = object.endIndex | 0;
                            if (object.uri != null)
                                message.uri = String(object.uri);
                            if (object.license != null)
                                message.license = String(object.license);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CitationSource message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.CitationSource} message CitationSource
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CitationSource.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.startIndex != null && message.hasOwnProperty("startIndex")) {
                                object.startIndex = message.startIndex;
                                if (options.oneofs)
                                    object._startIndex = "startIndex";
                            }
                            if (message.endIndex != null && message.hasOwnProperty("endIndex")) {
                                object.endIndex = message.endIndex;
                                if (options.oneofs)
                                    object._endIndex = "endIndex";
                            }
                            if (message.uri != null && message.hasOwnProperty("uri")) {
                                object.uri = message.uri;
                                if (options.oneofs)
                                    object._uri = "uri";
                            }
                            if (message.license != null && message.hasOwnProperty("license")) {
                                object.license = message.license;
                                if (options.oneofs)
                                    object._license = "license";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CitationSource to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CitationSource.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CitationSource
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.CitationSource
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CitationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.CitationSource";
                        };
    
                        return CitationSource;
                    })();
    
                    v1beta2.DiscussService = (function() {
    
                        /**
                         * Constructs a new DiscussService service.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a DiscussService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function DiscussService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (DiscussService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DiscussService;
    
                        /**
                         * Creates new DiscussService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.DiscussService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {DiscussService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        DiscussService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta2.DiscussService|generateMessage}.
                         * @memberof google.ai.generativelanguage.v1beta2.DiscussService
                         * @typedef GenerateMessageCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta2.GenerateMessageResponse} [response] GenerateMessageResponse
                         */
    
                        /**
                         * Calls GenerateMessage.
                         * @function generateMessage
                         * @memberof google.ai.generativelanguage.v1beta2.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateMessageRequest} request GenerateMessageRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta2.DiscussService.GenerateMessageCallback} callback Node-style callback called with the error, if any, and GenerateMessageResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(DiscussService.prototype.generateMessage = function generateMessage(request, callback) {
                            return this.rpcCall(generateMessage, $root.google.ai.generativelanguage.v1beta2.GenerateMessageRequest, $root.google.ai.generativelanguage.v1beta2.GenerateMessageResponse, request, callback);
                        }, "name", { value: "GenerateMessage" });
    
                        /**
                         * Calls GenerateMessage.
                         * @function generateMessage
                         * @memberof google.ai.generativelanguage.v1beta2.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateMessageRequest} request GenerateMessageRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta2.GenerateMessageResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta2.DiscussService|countMessageTokens}.
                         * @memberof google.ai.generativelanguage.v1beta2.DiscussService
                         * @typedef CountMessageTokensCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta2.CountMessageTokensResponse} [response] CountMessageTokensResponse
                         */
    
                        /**
                         * Calls CountMessageTokens.
                         * @function countMessageTokens
                         * @memberof google.ai.generativelanguage.v1beta2.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta2.DiscussService.CountMessageTokensCallback} callback Node-style callback called with the error, if any, and CountMessageTokensResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(DiscussService.prototype.countMessageTokens = function countMessageTokens(request, callback) {
                            return this.rpcCall(countMessageTokens, $root.google.ai.generativelanguage.v1beta2.CountMessageTokensRequest, $root.google.ai.generativelanguage.v1beta2.CountMessageTokensResponse, request, callback);
                        }, "name", { value: "CountMessageTokens" });
    
                        /**
                         * Calls CountMessageTokens.
                         * @function countMessageTokens
                         * @memberof google.ai.generativelanguage.v1beta2.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta2.CountMessageTokensResponse>} Promise
                         * @variation 2
                         */
    
                        return DiscussService;
                    })();
    
                    v1beta2.GenerateMessageRequest = (function() {
    
                        /**
                         * Properties of a GenerateMessageRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IGenerateMessageRequest
                         * @property {string|null} [model] GenerateMessageRequest model
                         * @property {google.ai.generativelanguage.v1beta2.IMessagePrompt|null} [prompt] GenerateMessageRequest prompt
                         * @property {number|null} [temperature] GenerateMessageRequest temperature
                         * @property {number|null} [candidateCount] GenerateMessageRequest candidateCount
                         * @property {number|null} [topP] GenerateMessageRequest topP
                         * @property {number|null} [topK] GenerateMessageRequest topK
                         */
    
                        /**
                         * Constructs a new GenerateMessageRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a GenerateMessageRequest.
                         * @implements IGenerateMessageRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateMessageRequest=} [properties] Properties to set
                         */
                        function GenerateMessageRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateMessageRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.model = "";
    
                        /**
                         * GenerateMessageRequest prompt.
                         * @member {google.ai.generativelanguage.v1beta2.IMessagePrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.prompt = null;
    
                        /**
                         * GenerateMessageRequest temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.temperature = null;
    
                        /**
                         * GenerateMessageRequest candidateCount.
                         * @member {number|null|undefined} candidateCount
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.candidateCount = null;
    
                        /**
                         * GenerateMessageRequest topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.topP = null;
    
                        /**
                         * GenerateMessageRequest topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.topK = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateMessageRequest _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _candidateCount.
                         * @member {"candidateCount"|undefined} _candidateCount
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_candidateCount", {
                            get: $util.oneOfGetter($oneOfFields = ["candidateCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateMessageRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateMessageRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateMessageRequest} GenerateMessageRequest instance
                         */
                        GenerateMessageRequest.create = function create(properties) {
                            return new GenerateMessageRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateMessageRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.GenerateMessageRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1beta2.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature);
                            if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 5, wireType 5 =*/45).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.topK);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateMessageRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.GenerateMessageRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateMessageRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateMessageRequest} GenerateMessageRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.GenerateMessageRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1beta2.MessagePrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 4: {
                                        message.candidateCount = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 6: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateMessageRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateMessageRequest} GenerateMessageRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateMessageRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateMessageRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1beta2.MessagePrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                properties._candidateCount = 1;
                                if (!$util.isInteger(message.candidateCount))
                                    return "candidateCount: integer expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateMessageRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateMessageRequest} GenerateMessageRequest
                         */
                        GenerateMessageRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.GenerateMessageRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.GenerateMessageRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateMessageRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1beta2.MessagePrompt.fromObject(object.prompt);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.candidateCount != null)
                                message.candidateCount = object.candidateCount | 0;
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateMessageRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.GenerateMessageRequest} message GenerateMessageRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateMessageRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1beta2.MessagePrompt.toObject(message.prompt, options);
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                object.candidateCount = message.candidateCount;
                                if (options.oneofs)
                                    object._candidateCount = "candidateCount";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateMessageRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateMessageRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateMessageRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.GenerateMessageRequest";
                        };
    
                        return GenerateMessageRequest;
                    })();
    
                    v1beta2.GenerateMessageResponse = (function() {
    
                        /**
                         * Properties of a GenerateMessageResponse.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IGenerateMessageResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta2.IMessage>|null} [candidates] GenerateMessageResponse candidates
                         * @property {Array.<google.ai.generativelanguage.v1beta2.IMessage>|null} [messages] GenerateMessageResponse messages
                         * @property {Array.<google.ai.generativelanguage.v1beta2.IContentFilter>|null} [filters] GenerateMessageResponse filters
                         */
    
                        /**
                         * Constructs a new GenerateMessageResponse.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a GenerateMessageResponse.
                         * @implements IGenerateMessageResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateMessageResponse=} [properties] Properties to set
                         */
                        function GenerateMessageResponse(properties) {
                            this.candidates = [];
                            this.messages = [];
                            this.filters = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateMessageResponse candidates.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.IMessage>} candidates
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.candidates = $util.emptyArray;
    
                        /**
                         * GenerateMessageResponse messages.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.IMessage>} messages
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.messages = $util.emptyArray;
    
                        /**
                         * GenerateMessageResponse filters.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.IContentFilter>} filters
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.filters = $util.emptyArray;
    
                        /**
                         * Creates a new GenerateMessageResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateMessageResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateMessageResponse} GenerateMessageResponse instance
                         */
                        GenerateMessageResponse.create = function create(properties) {
                            return new GenerateMessageResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateMessageResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.GenerateMessageResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidates != null && message.candidates.length)
                                for (var i = 0; i < message.candidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.Message.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.messages != null && message.messages.length)
                                for (var i = 0; i < message.messages.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.Message.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.filters != null && message.filters.length)
                                for (var i = 0; i < message.filters.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateMessageResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.GenerateMessageResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateMessageResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateMessageResponse} GenerateMessageResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.GenerateMessageResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.candidates && message.candidates.length))
                                            message.candidates = [];
                                        message.candidates.push($root.google.ai.generativelanguage.v1beta2.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        if (!(message.messages && message.messages.length))
                                            message.messages = [];
                                        message.messages.push($root.google.ai.generativelanguage.v1beta2.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.filters && message.filters.length))
                                            message.filters = [];
                                        message.filters.push($root.google.ai.generativelanguage.v1beta2.ContentFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateMessageResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateMessageResponse} GenerateMessageResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateMessageResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateMessageResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                if (!Array.isArray(message.candidates))
                                    return "candidates: array expected";
                                for (var i = 0; i < message.candidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.Message.verify(message.candidates[i]);
                                    if (error)
                                        return "candidates." + error;
                                }
                            }
                            if (message.messages != null && message.hasOwnProperty("messages")) {
                                if (!Array.isArray(message.messages))
                                    return "messages: array expected";
                                for (var i = 0; i < message.messages.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.Message.verify(message.messages[i]);
                                    if (error)
                                        return "messages." + error;
                                }
                            }
                            if (message.filters != null && message.hasOwnProperty("filters")) {
                                if (!Array.isArray(message.filters))
                                    return "filters: array expected";
                                for (var i = 0; i < message.filters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.ContentFilter.verify(message.filters[i]);
                                    if (error)
                                        return "filters." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateMessageResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateMessageResponse} GenerateMessageResponse
                         */
                        GenerateMessageResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.GenerateMessageResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.GenerateMessageResponse();
                            if (object.candidates) {
                                if (!Array.isArray(object.candidates))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateMessageResponse.candidates: array expected");
                                message.candidates = [];
                                for (var i = 0; i < object.candidates.length; ++i) {
                                    if (typeof object.candidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateMessageResponse.candidates: object expected");
                                    message.candidates[i] = $root.google.ai.generativelanguage.v1beta2.Message.fromObject(object.candidates[i]);
                                }
                            }
                            if (object.messages) {
                                if (!Array.isArray(object.messages))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateMessageResponse.messages: array expected");
                                message.messages = [];
                                for (var i = 0; i < object.messages.length; ++i) {
                                    if (typeof object.messages[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateMessageResponse.messages: object expected");
                                    message.messages[i] = $root.google.ai.generativelanguage.v1beta2.Message.fromObject(object.messages[i]);
                                }
                            }
                            if (object.filters) {
                                if (!Array.isArray(object.filters))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateMessageResponse.filters: array expected");
                                message.filters = [];
                                for (var i = 0; i < object.filters.length; ++i) {
                                    if (typeof object.filters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateMessageResponse.filters: object expected");
                                    message.filters[i] = $root.google.ai.generativelanguage.v1beta2.ContentFilter.fromObject(object.filters[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateMessageResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.GenerateMessageResponse} message GenerateMessageResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateMessageResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.candidates = [];
                                object.messages = [];
                                object.filters = [];
                            }
                            if (message.candidates && message.candidates.length) {
                                object.candidates = [];
                                for (var j = 0; j < message.candidates.length; ++j)
                                    object.candidates[j] = $root.google.ai.generativelanguage.v1beta2.Message.toObject(message.candidates[j], options);
                            }
                            if (message.messages && message.messages.length) {
                                object.messages = [];
                                for (var j = 0; j < message.messages.length; ++j)
                                    object.messages[j] = $root.google.ai.generativelanguage.v1beta2.Message.toObject(message.messages[j], options);
                            }
                            if (message.filters && message.filters.length) {
                                object.filters = [];
                                for (var j = 0; j < message.filters.length; ++j)
                                    object.filters[j] = $root.google.ai.generativelanguage.v1beta2.ContentFilter.toObject(message.filters[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateMessageResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateMessageResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateMessageResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateMessageResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.GenerateMessageResponse";
                        };
    
                        return GenerateMessageResponse;
                    })();
    
                    v1beta2.Message = (function() {
    
                        /**
                         * Properties of a Message.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IMessage
                         * @property {string|null} [author] Message author
                         * @property {string|null} [content] Message content
                         * @property {google.ai.generativelanguage.v1beta2.ICitationMetadata|null} [citationMetadata] Message citationMetadata
                         */
    
                        /**
                         * Constructs a new Message.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a Message.
                         * @implements IMessage
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IMessage=} [properties] Properties to set
                         */
                        function Message(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Message author.
                         * @member {string} author
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @instance
                         */
                        Message.prototype.author = "";
    
                        /**
                         * Message content.
                         * @member {string} content
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @instance
                         */
                        Message.prototype.content = "";
    
                        /**
                         * Message citationMetadata.
                         * @member {google.ai.generativelanguage.v1beta2.ICitationMetadata|null|undefined} citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @instance
                         */
                        Message.prototype.citationMetadata = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Message _citationMetadata.
                         * @member {"citationMetadata"|undefined} _citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @instance
                         */
                        Object.defineProperty(Message.prototype, "_citationMetadata", {
                            get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Message instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IMessage=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.Message} Message instance
                         */
                        Message.create = function create(properties) {
                            return new Message(properties);
                        };
    
                        /**
                         * Encodes the specified Message message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.Message.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IMessage} message Message message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Message.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.author != null && Object.hasOwnProperty.call(message, "author"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.author);
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.content);
                            if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata"))
                                $root.google.ai.generativelanguage.v1beta2.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Message message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.Message.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IMessage} message Message message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Message.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Message message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.Message} Message
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Message.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.Message();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.author = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.content = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.citationMetadata = $root.google.ai.generativelanguage.v1beta2.CitationMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Message message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.Message} Message
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Message.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Message message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Message.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.author != null && message.hasOwnProperty("author"))
                                if (!$util.isString(message.author))
                                    return "author: string expected";
                            if (message.content != null && message.hasOwnProperty("content"))
                                if (!$util.isString(message.content))
                                    return "content: string expected";
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                properties._citationMetadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta2.CitationMetadata.verify(message.citationMetadata);
                                    if (error)
                                        return "citationMetadata." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Message message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.Message} Message
                         */
                        Message.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.Message)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.Message();
                            if (object.author != null)
                                message.author = String(object.author);
                            if (object.content != null)
                                message.content = String(object.content);
                            if (object.citationMetadata != null) {
                                if (typeof object.citationMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.Message.citationMetadata: object expected");
                                message.citationMetadata = $root.google.ai.generativelanguage.v1beta2.CitationMetadata.fromObject(object.citationMetadata);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Message message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.Message} message Message
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Message.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.author = "";
                                object.content = "";
                            }
                            if (message.author != null && message.hasOwnProperty("author"))
                                object.author = message.author;
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = message.content;
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                object.citationMetadata = $root.google.ai.generativelanguage.v1beta2.CitationMetadata.toObject(message.citationMetadata, options);
                                if (options.oneofs)
                                    object._citationMetadata = "citationMetadata";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Message to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Message.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Message
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.Message
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.Message";
                        };
    
                        return Message;
                    })();
    
                    v1beta2.MessagePrompt = (function() {
    
                        /**
                         * Properties of a MessagePrompt.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IMessagePrompt
                         * @property {string|null} [context] MessagePrompt context
                         * @property {Array.<google.ai.generativelanguage.v1beta2.IExample>|null} [examples] MessagePrompt examples
                         * @property {Array.<google.ai.generativelanguage.v1beta2.IMessage>|null} [messages] MessagePrompt messages
                         */
    
                        /**
                         * Constructs a new MessagePrompt.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a MessagePrompt.
                         * @implements IMessagePrompt
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IMessagePrompt=} [properties] Properties to set
                         */
                        function MessagePrompt(properties) {
                            this.examples = [];
                            this.messages = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * MessagePrompt context.
                         * @member {string} context
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.context = "";
    
                        /**
                         * MessagePrompt examples.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.IExample>} examples
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.examples = $util.emptyArray;
    
                        /**
                         * MessagePrompt messages.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.IMessage>} messages
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.messages = $util.emptyArray;
    
                        /**
                         * Creates a new MessagePrompt instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IMessagePrompt=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.MessagePrompt} MessagePrompt instance
                         */
                        MessagePrompt.create = function create(properties) {
                            return new MessagePrompt(properties);
                        };
    
                        /**
                         * Encodes the specified MessagePrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.MessagePrompt.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IMessagePrompt} message MessagePrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MessagePrompt.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.context != null && Object.hasOwnProperty.call(message, "context"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.context);
                            if (message.examples != null && message.examples.length)
                                for (var i = 0; i < message.examples.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.Example.encode(message.examples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.messages != null && message.messages.length)
                                for (var i = 0; i < message.messages.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.Message.encode(message.messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified MessagePrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.MessagePrompt.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IMessagePrompt} message MessagePrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MessagePrompt.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a MessagePrompt message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.MessagePrompt} MessagePrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MessagePrompt.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.MessagePrompt();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.context = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.examples && message.examples.length))
                                            message.examples = [];
                                        message.examples.push($root.google.ai.generativelanguage.v1beta2.Example.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.messages && message.messages.length))
                                            message.messages = [];
                                        message.messages.push($root.google.ai.generativelanguage.v1beta2.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a MessagePrompt message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.MessagePrompt} MessagePrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MessagePrompt.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a MessagePrompt message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        MessagePrompt.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.context != null && message.hasOwnProperty("context"))
                                if (!$util.isString(message.context))
                                    return "context: string expected";
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                if (!Array.isArray(message.examples))
                                    return "examples: array expected";
                                for (var i = 0; i < message.examples.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.Example.verify(message.examples[i]);
                                    if (error)
                                        return "examples." + error;
                                }
                            }
                            if (message.messages != null && message.hasOwnProperty("messages")) {
                                if (!Array.isArray(message.messages))
                                    return "messages: array expected";
                                for (var i = 0; i < message.messages.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.Message.verify(message.messages[i]);
                                    if (error)
                                        return "messages." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a MessagePrompt message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.MessagePrompt} MessagePrompt
                         */
                        MessagePrompt.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.MessagePrompt)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.MessagePrompt();
                            if (object.context != null)
                                message.context = String(object.context);
                            if (object.examples) {
                                if (!Array.isArray(object.examples))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.MessagePrompt.examples: array expected");
                                message.examples = [];
                                for (var i = 0; i < object.examples.length; ++i) {
                                    if (typeof object.examples[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.MessagePrompt.examples: object expected");
                                    message.examples[i] = $root.google.ai.generativelanguage.v1beta2.Example.fromObject(object.examples[i]);
                                }
                            }
                            if (object.messages) {
                                if (!Array.isArray(object.messages))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.MessagePrompt.messages: array expected");
                                message.messages = [];
                                for (var i = 0; i < object.messages.length; ++i) {
                                    if (typeof object.messages[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.MessagePrompt.messages: object expected");
                                    message.messages[i] = $root.google.ai.generativelanguage.v1beta2.Message.fromObject(object.messages[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a MessagePrompt message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.MessagePrompt} message MessagePrompt
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        MessagePrompt.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.examples = [];
                                object.messages = [];
                            }
                            if (options.defaults)
                                object.context = "";
                            if (message.context != null && message.hasOwnProperty("context"))
                                object.context = message.context;
                            if (message.examples && message.examples.length) {
                                object.examples = [];
                                for (var j = 0; j < message.examples.length; ++j)
                                    object.examples[j] = $root.google.ai.generativelanguage.v1beta2.Example.toObject(message.examples[j], options);
                            }
                            if (message.messages && message.messages.length) {
                                object.messages = [];
                                for (var j = 0; j < message.messages.length; ++j)
                                    object.messages[j] = $root.google.ai.generativelanguage.v1beta2.Message.toObject(message.messages[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this MessagePrompt to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        MessagePrompt.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for MessagePrompt
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.MessagePrompt
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        MessagePrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.MessagePrompt";
                        };
    
                        return MessagePrompt;
                    })();
    
                    v1beta2.Example = (function() {
    
                        /**
                         * Properties of an Example.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IExample
                         * @property {google.ai.generativelanguage.v1beta2.IMessage|null} [input] Example input
                         * @property {google.ai.generativelanguage.v1beta2.IMessage|null} [output] Example output
                         */
    
                        /**
                         * Constructs a new Example.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents an Example.
                         * @implements IExample
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IExample=} [properties] Properties to set
                         */
                        function Example(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Example input.
                         * @member {google.ai.generativelanguage.v1beta2.IMessage|null|undefined} input
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @instance
                         */
                        Example.prototype.input = null;
    
                        /**
                         * Example output.
                         * @member {google.ai.generativelanguage.v1beta2.IMessage|null|undefined} output
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @instance
                         */
                        Example.prototype.output = null;
    
                        /**
                         * Creates a new Example instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IExample=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.Example} Example instance
                         */
                        Example.create = function create(properties) {
                            return new Example(properties);
                        };
    
                        /**
                         * Encodes the specified Example message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.Example.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IExample} message Example message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Example.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.input != null && Object.hasOwnProperty.call(message, "input"))
                                $root.google.ai.generativelanguage.v1beta2.Message.encode(message.input, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                $root.google.ai.generativelanguage.v1beta2.Message.encode(message.output, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Example message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.Example.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IExample} message Example message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Example.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an Example message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.Example} Example
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Example.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.Example();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.input = $root.google.ai.generativelanguage.v1beta2.Message.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.output = $root.google.ai.generativelanguage.v1beta2.Message.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an Example message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.Example} Example
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Example.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an Example message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Example.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.input != null && message.hasOwnProperty("input")) {
                                var error = $root.google.ai.generativelanguage.v1beta2.Message.verify(message.input);
                                if (error)
                                    return "input." + error;
                            }
                            if (message.output != null && message.hasOwnProperty("output")) {
                                var error = $root.google.ai.generativelanguage.v1beta2.Message.verify(message.output);
                                if (error)
                                    return "output." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an Example message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.Example} Example
                         */
                        Example.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.Example)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.Example();
                            if (object.input != null) {
                                if (typeof object.input !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.Example.input: object expected");
                                message.input = $root.google.ai.generativelanguage.v1beta2.Message.fromObject(object.input);
                            }
                            if (object.output != null) {
                                if (typeof object.output !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.Example.output: object expected");
                                message.output = $root.google.ai.generativelanguage.v1beta2.Message.fromObject(object.output);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an Example message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.Example} message Example
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Example.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.input = null;
                                object.output = null;
                            }
                            if (message.input != null && message.hasOwnProperty("input"))
                                object.input = $root.google.ai.generativelanguage.v1beta2.Message.toObject(message.input, options);
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = $root.google.ai.generativelanguage.v1beta2.Message.toObject(message.output, options);
                            return object;
                        };
    
                        /**
                         * Converts this Example to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Example.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Example
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.Example
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.Example";
                        };
    
                        return Example;
                    })();
    
                    v1beta2.CountMessageTokensRequest = (function() {
    
                        /**
                         * Properties of a CountMessageTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface ICountMessageTokensRequest
                         * @property {string|null} [model] CountMessageTokensRequest model
                         * @property {google.ai.generativelanguage.v1beta2.IMessagePrompt|null} [prompt] CountMessageTokensRequest prompt
                         */
    
                        /**
                         * Constructs a new CountMessageTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a CountMessageTokensRequest.
                         * @implements ICountMessageTokensRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.ICountMessageTokensRequest=} [properties] Properties to set
                         */
                        function CountMessageTokensRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountMessageTokensRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @instance
                         */
                        CountMessageTokensRequest.prototype.model = "";
    
                        /**
                         * CountMessageTokensRequest prompt.
                         * @member {google.ai.generativelanguage.v1beta2.IMessagePrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @instance
                         */
                        CountMessageTokensRequest.prototype.prompt = null;
    
                        /**
                         * Creates a new CountMessageTokensRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICountMessageTokensRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.CountMessageTokensRequest} CountMessageTokensRequest instance
                         */
                        CountMessageTokensRequest.create = function create(properties) {
                            return new CountMessageTokensRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.CountMessageTokensRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1beta2.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.CountMessageTokensRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountMessageTokensRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.CountMessageTokensRequest} CountMessageTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.CountMessageTokensRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1beta2.MessagePrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountMessageTokensRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.CountMessageTokensRequest} CountMessageTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountMessageTokensRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountMessageTokensRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1beta2.MessagePrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CountMessageTokensRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.CountMessageTokensRequest} CountMessageTokensRequest
                         */
                        CountMessageTokensRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.CountMessageTokensRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.CountMessageTokensRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.CountMessageTokensRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1beta2.MessagePrompt.fromObject(object.prompt);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountMessageTokensRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.CountMessageTokensRequest} message CountMessageTokensRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountMessageTokensRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1beta2.MessagePrompt.toObject(message.prompt, options);
                            return object;
                        };
    
                        /**
                         * Converts this CountMessageTokensRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountMessageTokensRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountMessageTokensRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountMessageTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.CountMessageTokensRequest";
                        };
    
                        return CountMessageTokensRequest;
                    })();
    
                    v1beta2.CountMessageTokensResponse = (function() {
    
                        /**
                         * Properties of a CountMessageTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface ICountMessageTokensResponse
                         * @property {number|null} [tokenCount] CountMessageTokensResponse tokenCount
                         */
    
                        /**
                         * Constructs a new CountMessageTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a CountMessageTokensResponse.
                         * @implements ICountMessageTokensResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.ICountMessageTokensResponse=} [properties] Properties to set
                         */
                        function CountMessageTokensResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountMessageTokensResponse tokenCount.
                         * @member {number} tokenCount
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensResponse
                         * @instance
                         */
                        CountMessageTokensResponse.prototype.tokenCount = 0;
    
                        /**
                         * Creates a new CountMessageTokensResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICountMessageTokensResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.CountMessageTokensResponse} CountMessageTokensResponse instance
                         */
                        CountMessageTokensResponse.create = function create(properties) {
                            return new CountMessageTokensResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.CountMessageTokensResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tokenCount);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.CountMessageTokensResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountMessageTokensResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.CountMessageTokensResponse} CountMessageTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.CountMessageTokensResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tokenCount = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountMessageTokensResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.CountMessageTokensResponse} CountMessageTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountMessageTokensResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountMessageTokensResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                if (!$util.isInteger(message.tokenCount))
                                    return "tokenCount: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a CountMessageTokensResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.CountMessageTokensResponse} CountMessageTokensResponse
                         */
                        CountMessageTokensResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.CountMessageTokensResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.CountMessageTokensResponse();
                            if (object.tokenCount != null)
                                message.tokenCount = object.tokenCount | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountMessageTokensResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.CountMessageTokensResponse} message CountMessageTokensResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountMessageTokensResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.tokenCount = 0;
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                object.tokenCount = message.tokenCount;
                            return object;
                        };
    
                        /**
                         * Converts this CountMessageTokensResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountMessageTokensResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountMessageTokensResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.CountMessageTokensResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountMessageTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.CountMessageTokensResponse";
                        };
    
                        return CountMessageTokensResponse;
                    })();
    
                    /**
                     * HarmCategory enum.
                     * @name google.ai.generativelanguage.v1beta2.HarmCategory
                     * @enum {number}
                     * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value
                     * @property {number} HARM_CATEGORY_DEROGATORY=1 HARM_CATEGORY_DEROGATORY value
                     * @property {number} HARM_CATEGORY_TOXICITY=2 HARM_CATEGORY_TOXICITY value
                     * @property {number} HARM_CATEGORY_VIOLENCE=3 HARM_CATEGORY_VIOLENCE value
                     * @property {number} HARM_CATEGORY_SEXUAL=4 HARM_CATEGORY_SEXUAL value
                     * @property {number} HARM_CATEGORY_MEDICAL=5 HARM_CATEGORY_MEDICAL value
                     * @property {number} HARM_CATEGORY_DANGEROUS=6 HARM_CATEGORY_DANGEROUS value
                     */
                    v1beta2.HarmCategory = (function() {
                        var valuesById = {}, values = Object.create(valuesById);
                        values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0;
                        values[valuesById[1] = "HARM_CATEGORY_DEROGATORY"] = 1;
                        values[valuesById[2] = "HARM_CATEGORY_TOXICITY"] = 2;
                        values[valuesById[3] = "HARM_CATEGORY_VIOLENCE"] = 3;
                        values[valuesById[4] = "HARM_CATEGORY_SEXUAL"] = 4;
                        values[valuesById[5] = "HARM_CATEGORY_MEDICAL"] = 5;
                        values[valuesById[6] = "HARM_CATEGORY_DANGEROUS"] = 6;
                        return values;
                    })();
    
                    v1beta2.ContentFilter = (function() {
    
                        /**
                         * Properties of a ContentFilter.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IContentFilter
                         * @property {google.ai.generativelanguage.v1beta2.ContentFilter.BlockedReason|null} [reason] ContentFilter reason
                         * @property {string|null} [message] ContentFilter message
                         */
    
                        /**
                         * Constructs a new ContentFilter.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a ContentFilter.
                         * @implements IContentFilter
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IContentFilter=} [properties] Properties to set
                         */
                        function ContentFilter(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ContentFilter reason.
                         * @member {google.ai.generativelanguage.v1beta2.ContentFilter.BlockedReason} reason
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @instance
                         */
                        ContentFilter.prototype.reason = 0;
    
                        /**
                         * ContentFilter message.
                         * @member {string|null|undefined} message
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @instance
                         */
                        ContentFilter.prototype.message = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * ContentFilter _message.
                         * @member {"message"|undefined} _message
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @instance
                         */
                        Object.defineProperty(ContentFilter.prototype, "_message", {
                            get: $util.oneOfGetter($oneOfFields = ["message"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new ContentFilter instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IContentFilter=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.ContentFilter} ContentFilter instance
                         */
                        ContentFilter.create = function create(properties) {
                            return new ContentFilter(properties);
                        };
    
                        /**
                         * Encodes the specified ContentFilter message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.ContentFilter.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IContentFilter} message ContentFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentFilter.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.reason != null && Object.hasOwnProperty.call(message, "reason"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.reason);
                            if (message.message != null && Object.hasOwnProperty.call(message, "message"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.message);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.ContentFilter.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IContentFilter} message ContentFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentFilter.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ContentFilter message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.ContentFilter} ContentFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentFilter.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.ContentFilter();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.reason = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.message = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ContentFilter message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.ContentFilter} ContentFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentFilter.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ContentFilter message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ContentFilter.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.reason != null && message.hasOwnProperty("reason"))
                                switch (message.reason) {
                                default:
                                    return "reason: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                    break;
                                }
                            if (message.message != null && message.hasOwnProperty("message")) {
                                properties._message = 1;
                                if (!$util.isString(message.message))
                                    return "message: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.ContentFilter} ContentFilter
                         */
                        ContentFilter.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.ContentFilter)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.ContentFilter();
                            switch (object.reason) {
                            default:
                                if (typeof object.reason === "number") {
                                    message.reason = object.reason;
                                    break;
                                }
                                break;
                            case "BLOCKED_REASON_UNSPECIFIED":
                            case 0:
                                message.reason = 0;
                                break;
                            case "SAFETY":
                            case 1:
                                message.reason = 1;
                                break;
                            case "OTHER":
                            case 2:
                                message.reason = 2;
                                break;
                            }
                            if (object.message != null)
                                message.message = String(object.message);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ContentFilter message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ContentFilter} message ContentFilter
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ContentFilter.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.reason = options.enums === String ? "BLOCKED_REASON_UNSPECIFIED" : 0;
                            if (message.reason != null && message.hasOwnProperty("reason"))
                                object.reason = options.enums === String ? $root.google.ai.generativelanguage.v1beta2.ContentFilter.BlockedReason[message.reason] === undefined ? message.reason : $root.google.ai.generativelanguage.v1beta2.ContentFilter.BlockedReason[message.reason] : message.reason;
                            if (message.message != null && message.hasOwnProperty("message")) {
                                object.message = message.message;
                                if (options.oneofs)
                                    object._message = "message";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this ContentFilter to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ContentFilter.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ContentFilter
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.ContentFilter
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ContentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.ContentFilter";
                        };
    
                        /**
                         * BlockedReason enum.
                         * @name google.ai.generativelanguage.v1beta2.ContentFilter.BlockedReason
                         * @enum {number}
                         * @property {number} BLOCKED_REASON_UNSPECIFIED=0 BLOCKED_REASON_UNSPECIFIED value
                         * @property {number} SAFETY=1 SAFETY value
                         * @property {number} OTHER=2 OTHER value
                         */
                        ContentFilter.BlockedReason = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "BLOCKED_REASON_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "SAFETY"] = 1;
                            values[valuesById[2] = "OTHER"] = 2;
                            return values;
                        })();
    
                        return ContentFilter;
                    })();
    
                    v1beta2.SafetyFeedback = (function() {
    
                        /**
                         * Properties of a SafetyFeedback.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface ISafetyFeedback
                         * @property {google.ai.generativelanguage.v1beta2.ISafetyRating|null} [rating] SafetyFeedback rating
                         * @property {google.ai.generativelanguage.v1beta2.ISafetySetting|null} [setting] SafetyFeedback setting
                         */
    
                        /**
                         * Constructs a new SafetyFeedback.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a SafetyFeedback.
                         * @implements ISafetyFeedback
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.ISafetyFeedback=} [properties] Properties to set
                         */
                        function SafetyFeedback(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetyFeedback rating.
                         * @member {google.ai.generativelanguage.v1beta2.ISafetyRating|null|undefined} rating
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @instance
                         */
                        SafetyFeedback.prototype.rating = null;
    
                        /**
                         * SafetyFeedback setting.
                         * @member {google.ai.generativelanguage.v1beta2.ISafetySetting|null|undefined} setting
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @instance
                         */
                        SafetyFeedback.prototype.setting = null;
    
                        /**
                         * Creates a new SafetyFeedback instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ISafetyFeedback=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.SafetyFeedback} SafetyFeedback instance
                         */
                        SafetyFeedback.create = function create(properties) {
                            return new SafetyFeedback(properties);
                        };
    
                        /**
                         * Encodes the specified SafetyFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.SafetyFeedback.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ISafetyFeedback} message SafetyFeedback message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyFeedback.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.rating != null && Object.hasOwnProperty.call(message, "rating"))
                                $root.google.ai.generativelanguage.v1beta2.SafetyRating.encode(message.rating, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.setting != null && Object.hasOwnProperty.call(message, "setting"))
                                $root.google.ai.generativelanguage.v1beta2.SafetySetting.encode(message.setting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetyFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.SafetyFeedback.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ISafetyFeedback} message SafetyFeedback message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyFeedback.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetyFeedback message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.SafetyFeedback} SafetyFeedback
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyFeedback.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.SafetyFeedback();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.rating = $root.google.ai.generativelanguage.v1beta2.SafetyRating.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.setting = $root.google.ai.generativelanguage.v1beta2.SafetySetting.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetyFeedback message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.SafetyFeedback} SafetyFeedback
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyFeedback.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetyFeedback message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetyFeedback.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.rating != null && message.hasOwnProperty("rating")) {
                                var error = $root.google.ai.generativelanguage.v1beta2.SafetyRating.verify(message.rating);
                                if (error)
                                    return "rating." + error;
                            }
                            if (message.setting != null && message.hasOwnProperty("setting")) {
                                var error = $root.google.ai.generativelanguage.v1beta2.SafetySetting.verify(message.setting);
                                if (error)
                                    return "setting." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a SafetyFeedback message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.SafetyFeedback} SafetyFeedback
                         */
                        SafetyFeedback.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.SafetyFeedback)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.SafetyFeedback();
                            if (object.rating != null) {
                                if (typeof object.rating !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.SafetyFeedback.rating: object expected");
                                message.rating = $root.google.ai.generativelanguage.v1beta2.SafetyRating.fromObject(object.rating);
                            }
                            if (object.setting != null) {
                                if (typeof object.setting !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.SafetyFeedback.setting: object expected");
                                message.setting = $root.google.ai.generativelanguage.v1beta2.SafetySetting.fromObject(object.setting);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetyFeedback message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.SafetyFeedback} message SafetyFeedback
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetyFeedback.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.rating = null;
                                object.setting = null;
                            }
                            if (message.rating != null && message.hasOwnProperty("rating"))
                                object.rating = $root.google.ai.generativelanguage.v1beta2.SafetyRating.toObject(message.rating, options);
                            if (message.setting != null && message.hasOwnProperty("setting"))
                                object.setting = $root.google.ai.generativelanguage.v1beta2.SafetySetting.toObject(message.setting, options);
                            return object;
                        };
    
                        /**
                         * Converts this SafetyFeedback to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetyFeedback.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetyFeedback
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyFeedback
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetyFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.SafetyFeedback";
                        };
    
                        return SafetyFeedback;
                    })();
    
                    v1beta2.SafetyRating = (function() {
    
                        /**
                         * Properties of a SafetyRating.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface ISafetyRating
                         * @property {google.ai.generativelanguage.v1beta2.HarmCategory|null} [category] SafetyRating category
                         * @property {google.ai.generativelanguage.v1beta2.SafetyRating.HarmProbability|null} [probability] SafetyRating probability
                         */
    
                        /**
                         * Constructs a new SafetyRating.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a SafetyRating.
                         * @implements ISafetyRating
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.ISafetyRating=} [properties] Properties to set
                         */
                        function SafetyRating(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetyRating category.
                         * @member {google.ai.generativelanguage.v1beta2.HarmCategory} category
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.category = 0;
    
                        /**
                         * SafetyRating probability.
                         * @member {google.ai.generativelanguage.v1beta2.SafetyRating.HarmProbability} probability
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.probability = 0;
    
                        /**
                         * Creates a new SafetyRating instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ISafetyRating=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.SafetyRating} SafetyRating instance
                         */
                        SafetyRating.create = function create(properties) {
                            return new SafetyRating(properties);
                        };
    
                        /**
                         * Encodes the specified SafetyRating message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.SafetyRating.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ISafetyRating} message SafetyRating message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyRating.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.category != null && Object.hasOwnProperty.call(message, "category"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category);
                            if (message.probability != null && Object.hasOwnProperty.call(message, "probability"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.probability);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetyRating message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.SafetyRating.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ISafetyRating} message SafetyRating message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyRating.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetyRating message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.SafetyRating} SafetyRating
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyRating.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.SafetyRating();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.category = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.probability = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetyRating message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.SafetyRating} SafetyRating
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyRating.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetyRating message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetyRating.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.category != null && message.hasOwnProperty("category"))
                                switch (message.category) {
                                default:
                                    return "category: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                    break;
                                }
                            if (message.probability != null && message.hasOwnProperty("probability"))
                                switch (message.probability) {
                                default:
                                    return "probability: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                    break;
                                }
                            return null;
                        };
    
                        /**
                         * Creates a SafetyRating message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.SafetyRating} SafetyRating
                         */
                        SafetyRating.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.SafetyRating)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.SafetyRating();
                            switch (object.category) {
                            default:
                                if (typeof object.category === "number") {
                                    message.category = object.category;
                                    break;
                                }
                                break;
                            case "HARM_CATEGORY_UNSPECIFIED":
                            case 0:
                                message.category = 0;
                                break;
                            case "HARM_CATEGORY_DEROGATORY":
                            case 1:
                                message.category = 1;
                                break;
                            case "HARM_CATEGORY_TOXICITY":
                            case 2:
                                message.category = 2;
                                break;
                            case "HARM_CATEGORY_VIOLENCE":
                            case 3:
                                message.category = 3;
                                break;
                            case "HARM_CATEGORY_SEXUAL":
                            case 4:
                                message.category = 4;
                                break;
                            case "HARM_CATEGORY_MEDICAL":
                            case 5:
                                message.category = 5;
                                break;
                            case "HARM_CATEGORY_DANGEROUS":
                            case 6:
                                message.category = 6;
                                break;
                            }
                            switch (object.probability) {
                            default:
                                if (typeof object.probability === "number") {
                                    message.probability = object.probability;
                                    break;
                                }
                                break;
                            case "HARM_PROBABILITY_UNSPECIFIED":
                            case 0:
                                message.probability = 0;
                                break;
                            case "NEGLIGIBLE":
                            case 1:
                                message.probability = 1;
                                break;
                            case "LOW":
                            case 2:
                                message.probability = 2;
                                break;
                            case "MEDIUM":
                            case 3:
                                message.probability = 3;
                                break;
                            case "HIGH":
                            case 4:
                                message.probability = 4;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetyRating message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.SafetyRating} message SafetyRating
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetyRating.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0;
                                object.probability = options.enums === String ? "HARM_PROBABILITY_UNSPECIFIED" : 0;
                            }
                            if (message.category != null && message.hasOwnProperty("category"))
                                object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta2.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta2.HarmCategory[message.category] : message.category;
                            if (message.probability != null && message.hasOwnProperty("probability"))
                                object.probability = options.enums === String ? $root.google.ai.generativelanguage.v1beta2.SafetyRating.HarmProbability[message.probability] === undefined ? message.probability : $root.google.ai.generativelanguage.v1beta2.SafetyRating.HarmProbability[message.probability] : message.probability;
                            return object;
                        };
    
                        /**
                         * Converts this SafetyRating to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetyRating.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetyRating
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.SafetyRating
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetyRating.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.SafetyRating";
                        };
    
                        /**
                         * HarmProbability enum.
                         * @name google.ai.generativelanguage.v1beta2.SafetyRating.HarmProbability
                         * @enum {number}
                         * @property {number} HARM_PROBABILITY_UNSPECIFIED=0 HARM_PROBABILITY_UNSPECIFIED value
                         * @property {number} NEGLIGIBLE=1 NEGLIGIBLE value
                         * @property {number} LOW=2 LOW value
                         * @property {number} MEDIUM=3 MEDIUM value
                         * @property {number} HIGH=4 HIGH value
                         */
                        SafetyRating.HarmProbability = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "HARM_PROBABILITY_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "NEGLIGIBLE"] = 1;
                            values[valuesById[2] = "LOW"] = 2;
                            values[valuesById[3] = "MEDIUM"] = 3;
                            values[valuesById[4] = "HIGH"] = 4;
                            return values;
                        })();
    
                        return SafetyRating;
                    })();
    
                    v1beta2.SafetySetting = (function() {
    
                        /**
                         * Properties of a SafetySetting.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface ISafetySetting
                         * @property {google.ai.generativelanguage.v1beta2.HarmCategory|null} [category] SafetySetting category
                         * @property {google.ai.generativelanguage.v1beta2.SafetySetting.HarmBlockThreshold|null} [threshold] SafetySetting threshold
                         */
    
                        /**
                         * Constructs a new SafetySetting.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a SafetySetting.
                         * @implements ISafetySetting
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.ISafetySetting=} [properties] Properties to set
                         */
                        function SafetySetting(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetySetting category.
                         * @member {google.ai.generativelanguage.v1beta2.HarmCategory} category
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @instance
                         */
                        SafetySetting.prototype.category = 0;
    
                        /**
                         * SafetySetting threshold.
                         * @member {google.ai.generativelanguage.v1beta2.SafetySetting.HarmBlockThreshold} threshold
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @instance
                         */
                        SafetySetting.prototype.threshold = 0;
    
                        /**
                         * Creates a new SafetySetting instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ISafetySetting=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.SafetySetting} SafetySetting instance
                         */
                        SafetySetting.create = function create(properties) {
                            return new SafetySetting(properties);
                        };
    
                        /**
                         * Encodes the specified SafetySetting message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.SafetySetting.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ISafetySetting} message SafetySetting message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetySetting.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.category != null && Object.hasOwnProperty.call(message, "category"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category);
                            if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.threshold);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.SafetySetting.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ISafetySetting} message SafetySetting message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetySetting.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetySetting message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.SafetySetting} SafetySetting
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetySetting.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.SafetySetting();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.category = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.threshold = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetySetting message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.SafetySetting} SafetySetting
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetySetting.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetySetting message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetySetting.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.category != null && message.hasOwnProperty("category"))
                                switch (message.category) {
                                default:
                                    return "category: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                    break;
                                }
                            if (message.threshold != null && message.hasOwnProperty("threshold"))
                                switch (message.threshold) {
                                default:
                                    return "threshold: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            return null;
                        };
    
                        /**
                         * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.SafetySetting} SafetySetting
                         */
                        SafetySetting.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.SafetySetting)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.SafetySetting();
                            switch (object.category) {
                            default:
                                if (typeof object.category === "number") {
                                    message.category = object.category;
                                    break;
                                }
                                break;
                            case "HARM_CATEGORY_UNSPECIFIED":
                            case 0:
                                message.category = 0;
                                break;
                            case "HARM_CATEGORY_DEROGATORY":
                            case 1:
                                message.category = 1;
                                break;
                            case "HARM_CATEGORY_TOXICITY":
                            case 2:
                                message.category = 2;
                                break;
                            case "HARM_CATEGORY_VIOLENCE":
                            case 3:
                                message.category = 3;
                                break;
                            case "HARM_CATEGORY_SEXUAL":
                            case 4:
                                message.category = 4;
                                break;
                            case "HARM_CATEGORY_MEDICAL":
                            case 5:
                                message.category = 5;
                                break;
                            case "HARM_CATEGORY_DANGEROUS":
                            case 6:
                                message.category = 6;
                                break;
                            }
                            switch (object.threshold) {
                            default:
                                if (typeof object.threshold === "number") {
                                    message.threshold = object.threshold;
                                    break;
                                }
                                break;
                            case "HARM_BLOCK_THRESHOLD_UNSPECIFIED":
                            case 0:
                                message.threshold = 0;
                                break;
                            case "BLOCK_LOW_AND_ABOVE":
                            case 1:
                                message.threshold = 1;
                                break;
                            case "BLOCK_MEDIUM_AND_ABOVE":
                            case 2:
                                message.threshold = 2;
                                break;
                            case "BLOCK_ONLY_HIGH":
                            case 3:
                                message.threshold = 3;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetySetting message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.SafetySetting} message SafetySetting
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetySetting.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0;
                                object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0;
                            }
                            if (message.category != null && message.hasOwnProperty("category"))
                                object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta2.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta2.HarmCategory[message.category] : message.category;
                            if (message.threshold != null && message.hasOwnProperty("threshold"))
                                object.threshold = options.enums === String ? $root.google.ai.generativelanguage.v1beta2.SafetySetting.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.ai.generativelanguage.v1beta2.SafetySetting.HarmBlockThreshold[message.threshold] : message.threshold;
                            return object;
                        };
    
                        /**
                         * Converts this SafetySetting to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetySetting.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetySetting
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.SafetySetting
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.SafetySetting";
                        };
    
                        /**
                         * HarmBlockThreshold enum.
                         * @name google.ai.generativelanguage.v1beta2.SafetySetting.HarmBlockThreshold
                         * @enum {number}
                         * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value
                         * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value
                         * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value
                         * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value
                         */
                        SafetySetting.HarmBlockThreshold = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1;
                            values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2;
                            values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3;
                            return values;
                        })();
    
                        return SafetySetting;
                    })();
    
                    v1beta2.Model = (function() {
    
                        /**
                         * Properties of a Model.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IModel
                         * @property {string|null} [name] Model name
                         * @property {string|null} [baseModelId] Model baseModelId
                         * @property {string|null} [version] Model version
                         * @property {string|null} [displayName] Model displayName
                         * @property {string|null} [description] Model description
                         * @property {number|null} [inputTokenLimit] Model inputTokenLimit
                         * @property {number|null} [outputTokenLimit] Model outputTokenLimit
                         * @property {Array.<string>|null} [supportedGenerationMethods] Model supportedGenerationMethods
                         * @property {number|null} [temperature] Model temperature
                         * @property {number|null} [topP] Model topP
                         * @property {number|null} [topK] Model topK
                         */
    
                        /**
                         * Constructs a new Model.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a Model.
                         * @implements IModel
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IModel=} [properties] Properties to set
                         */
                        function Model(properties) {
                            this.supportedGenerationMethods = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Model name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Model.prototype.name = "";
    
                        /**
                         * Model baseModelId.
                         * @member {string} baseModelId
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Model.prototype.baseModelId = "";
    
                        /**
                         * Model version.
                         * @member {string} version
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Model.prototype.version = "";
    
                        /**
                         * Model displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Model.prototype.displayName = "";
    
                        /**
                         * Model description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Model.prototype.description = "";
    
                        /**
                         * Model inputTokenLimit.
                         * @member {number} inputTokenLimit
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Model.prototype.inputTokenLimit = 0;
    
                        /**
                         * Model outputTokenLimit.
                         * @member {number} outputTokenLimit
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Model.prototype.outputTokenLimit = 0;
    
                        /**
                         * Model supportedGenerationMethods.
                         * @member {Array.<string>} supportedGenerationMethods
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Model.prototype.supportedGenerationMethods = $util.emptyArray;
    
                        /**
                         * Model temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Model.prototype.temperature = null;
    
                        /**
                         * Model topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Model.prototype.topP = null;
    
                        /**
                         * Model topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Model.prototype.topK = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Model _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Model instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IModel=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.Model} Model instance
                         */
                        Model.create = function create(properties) {
                            return new Model(properties);
                        };
    
                        /**
                         * Encodes the specified Model message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.Model.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IModel} message Model message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Model.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.baseModelId != null && Object.hasOwnProperty.call(message, "baseModelId"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModelId);
                            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.version);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 5, wireType 2 =*/42).string(message.description);
                            if (message.inputTokenLimit != null && Object.hasOwnProperty.call(message, "inputTokenLimit"))
                                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.inputTokenLimit);
                            if (message.outputTokenLimit != null && Object.hasOwnProperty.call(message, "outputTokenLimit"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.outputTokenLimit);
                            if (message.supportedGenerationMethods != null && message.supportedGenerationMethods.length)
                                for (var i = 0; i < message.supportedGenerationMethods.length; ++i)
                                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.supportedGenerationMethods[i]);
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 9, wireType 5 =*/77).float(message.temperature);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 10, wireType 5 =*/85).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 11, wireType 0 =*/88).int32(message.topK);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Model message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.Model.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IModel} message Model message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Model.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Model message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.Model} Model
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Model.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.Model();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.baseModelId = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.version = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 5: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.inputTokenLimit = reader.int32();
                                        break;
                                    }
                                case 7: {
                                        message.outputTokenLimit = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        if (!(message.supportedGenerationMethods && message.supportedGenerationMethods.length))
                                            message.supportedGenerationMethods = [];
                                        message.supportedGenerationMethods.push(reader.string());
                                        break;
                                    }
                                case 9: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 10: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 11: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Model message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.Model} Model
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Model.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Model message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Model.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.baseModelId != null && message.hasOwnProperty("baseModelId"))
                                if (!$util.isString(message.baseModelId))
                                    return "baseModelId: string expected";
                            if (message.version != null && message.hasOwnProperty("version"))
                                if (!$util.isString(message.version))
                                    return "version: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit"))
                                if (!$util.isInteger(message.inputTokenLimit))
                                    return "inputTokenLimit: integer expected";
                            if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit"))
                                if (!$util.isInteger(message.outputTokenLimit))
                                    return "outputTokenLimit: integer expected";
                            if (message.supportedGenerationMethods != null && message.hasOwnProperty("supportedGenerationMethods")) {
                                if (!Array.isArray(message.supportedGenerationMethods))
                                    return "supportedGenerationMethods: array expected";
                                for (var i = 0; i < message.supportedGenerationMethods.length; ++i)
                                    if (!$util.isString(message.supportedGenerationMethods[i]))
                                        return "supportedGenerationMethods: string[] expected";
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Model message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.Model} Model
                         */
                        Model.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.Model)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.Model();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.baseModelId != null)
                                message.baseModelId = String(object.baseModelId);
                            if (object.version != null)
                                message.version = String(object.version);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.inputTokenLimit != null)
                                message.inputTokenLimit = object.inputTokenLimit | 0;
                            if (object.outputTokenLimit != null)
                                message.outputTokenLimit = object.outputTokenLimit | 0;
                            if (object.supportedGenerationMethods) {
                                if (!Array.isArray(object.supportedGenerationMethods))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.Model.supportedGenerationMethods: array expected");
                                message.supportedGenerationMethods = [];
                                for (var i = 0; i < object.supportedGenerationMethods.length; ++i)
                                    message.supportedGenerationMethods[i] = String(object.supportedGenerationMethods[i]);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Model message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.Model} message Model
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Model.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.supportedGenerationMethods = [];
                            if (options.defaults) {
                                object.name = "";
                                object.baseModelId = "";
                                object.version = "";
                                object.displayName = "";
                                object.description = "";
                                object.inputTokenLimit = 0;
                                object.outputTokenLimit = 0;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.baseModelId != null && message.hasOwnProperty("baseModelId"))
                                object.baseModelId = message.baseModelId;
                            if (message.version != null && message.hasOwnProperty("version"))
                                object.version = message.version;
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit"))
                                object.inputTokenLimit = message.inputTokenLimit;
                            if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit"))
                                object.outputTokenLimit = message.outputTokenLimit;
                            if (message.supportedGenerationMethods && message.supportedGenerationMethods.length) {
                                object.supportedGenerationMethods = [];
                                for (var j = 0; j < message.supportedGenerationMethods.length; ++j)
                                    object.supportedGenerationMethods[j] = message.supportedGenerationMethods[j];
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Model to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Model.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Model
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.Model
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.Model";
                        };
    
                        return Model;
                    })();
    
                    v1beta2.ModelService = (function() {
    
                        /**
                         * Constructs a new ModelService service.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a ModelService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function ModelService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (ModelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ModelService;
    
                        /**
                         * Creates new ModelService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.ModelService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {ModelService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        ModelService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta2.ModelService|getModel}.
                         * @memberof google.ai.generativelanguage.v1beta2.ModelService
                         * @typedef GetModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta2.Model} [response] Model
                         */
    
                        /**
                         * Calls GetModel.
                         * @function getModel
                         * @memberof google.ai.generativelanguage.v1beta2.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.IGetModelRequest} request GetModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta2.ModelService.GetModelCallback} callback Node-style callback called with the error, if any, and Model
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.getModel = function getModel(request, callback) {
                            return this.rpcCall(getModel, $root.google.ai.generativelanguage.v1beta2.GetModelRequest, $root.google.ai.generativelanguage.v1beta2.Model, request, callback);
                        }, "name", { value: "GetModel" });
    
                        /**
                         * Calls GetModel.
                         * @function getModel
                         * @memberof google.ai.generativelanguage.v1beta2.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.IGetModelRequest} request GetModelRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta2.Model>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta2.ModelService|listModels}.
                         * @memberof google.ai.generativelanguage.v1beta2.ModelService
                         * @typedef ListModelsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta2.ListModelsResponse} [response] ListModelsResponse
                         */
    
                        /**
                         * Calls ListModels.
                         * @function listModels
                         * @memberof google.ai.generativelanguage.v1beta2.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.IListModelsRequest} request ListModelsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta2.ModelService.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.listModels = function listModels(request, callback) {
                            return this.rpcCall(listModels, $root.google.ai.generativelanguage.v1beta2.ListModelsRequest, $root.google.ai.generativelanguage.v1beta2.ListModelsResponse, request, callback);
                        }, "name", { value: "ListModels" });
    
                        /**
                         * Calls ListModels.
                         * @function listModels
                         * @memberof google.ai.generativelanguage.v1beta2.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.IListModelsRequest} request ListModelsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta2.ListModelsResponse>} Promise
                         * @variation 2
                         */
    
                        return ModelService;
                    })();
    
                    v1beta2.GetModelRequest = (function() {
    
                        /**
                         * Properties of a GetModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IGetModelRequest
                         * @property {string|null} [name] GetModelRequest name
                         */
    
                        /**
                         * Constructs a new GetModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a GetModelRequest.
                         * @implements IGetModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IGetModelRequest=} [properties] Properties to set
                         */
                        function GetModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetModelRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta2.GetModelRequest
                         * @instance
                         */
                        GetModelRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGetModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.GetModelRequest} GetModelRequest instance
                         */
                        GetModelRequest.create = function create(properties) {
                            return new GetModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.GetModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGetModelRequest} message GetModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.GetModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGetModelRequest} message GetModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.GetModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.GetModelRequest} GetModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.GetModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.GetModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.GetModelRequest} GetModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.GetModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.GetModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.GetModelRequest} GetModelRequest
                         */
                        GetModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.GetModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.GetModelRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.GetModelRequest} message GetModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.GetModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.GetModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.GetModelRequest";
                        };
    
                        return GetModelRequest;
                    })();
    
                    v1beta2.ListModelsRequest = (function() {
    
                        /**
                         * Properties of a ListModelsRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IListModelsRequest
                         * @property {number|null} [pageSize] ListModelsRequest pageSize
                         * @property {string|null} [pageToken] ListModelsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListModelsRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a ListModelsRequest.
                         * @implements IListModelsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IListModelsRequest=} [properties] Properties to set
                         */
                        function ListModelsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListModelsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @instance
                         */
                        ListModelsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListModelsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @instance
                         */
                        ListModelsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListModelsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IListModelsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.ListModelsRequest} ListModelsRequest instance
                         */
                        ListModelsRequest.create = function create(properties) {
                            return new ListModelsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.ListModelsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IListModelsRequest} message ListModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.ListModelsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IListModelsRequest} message ListModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListModelsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.ListModelsRequest} ListModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.ListModelsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.ListModelsRequest} ListModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListModelsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListModelsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.ListModelsRequest} ListModelsRequest
                         */
                        ListModelsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.ListModelsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.ListModelsRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ListModelsRequest} message ListModelsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListModelsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListModelsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListModelsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListModelsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.ListModelsRequest";
                        };
    
                        return ListModelsRequest;
                    })();
    
                    v1beta2.ListModelsResponse = (function() {
    
                        /**
                         * Properties of a ListModelsResponse.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IListModelsResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta2.IModel>|null} [models] ListModelsResponse models
                         * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListModelsResponse.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a ListModelsResponse.
                         * @implements IListModelsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IListModelsResponse=} [properties] Properties to set
                         */
                        function ListModelsResponse(properties) {
                            this.models = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListModelsResponse models.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.IModel>} models
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @instance
                         */
                        ListModelsResponse.prototype.models = $util.emptyArray;
    
                        /**
                         * ListModelsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @instance
                         */
                        ListModelsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListModelsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IListModelsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.ListModelsResponse} ListModelsResponse instance
                         */
                        ListModelsResponse.create = function create(properties) {
                            return new ListModelsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.ListModelsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IListModelsResponse} message ListModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.models != null && message.models.length)
                                for (var i = 0; i < message.models.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.Model.encode(message.models[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.ListModelsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IListModelsResponse} message ListModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListModelsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.ListModelsResponse} ListModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.ListModelsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.models && message.models.length))
                                            message.models = [];
                                        message.models.push($root.google.ai.generativelanguage.v1beta2.Model.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.ListModelsResponse} ListModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListModelsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListModelsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.models != null && message.hasOwnProperty("models")) {
                                if (!Array.isArray(message.models))
                                    return "models: array expected";
                                for (var i = 0; i < message.models.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.Model.verify(message.models[i]);
                                    if (error)
                                        return "models." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.ListModelsResponse} ListModelsResponse
                         */
                        ListModelsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.ListModelsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.ListModelsResponse();
                            if (object.models) {
                                if (!Array.isArray(object.models))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.ListModelsResponse.models: array expected");
                                message.models = [];
                                for (var i = 0; i < object.models.length; ++i) {
                                    if (typeof object.models[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.ListModelsResponse.models: object expected");
                                    message.models[i] = $root.google.ai.generativelanguage.v1beta2.Model.fromObject(object.models[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ListModelsResponse} message ListModelsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListModelsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.models = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.models && message.models.length) {
                                object.models = [];
                                for (var j = 0; j < message.models.length; ++j)
                                    object.models[j] = $root.google.ai.generativelanguage.v1beta2.Model.toObject(message.models[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListModelsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListModelsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListModelsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.ListModelsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.ListModelsResponse";
                        };
    
                        return ListModelsResponse;
                    })();
    
                    v1beta2.TextService = (function() {
    
                        /**
                         * Constructs a new TextService service.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a TextService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function TextService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (TextService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TextService;
    
                        /**
                         * Creates new TextService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.TextService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {TextService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        TextService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta2.TextService|generateText}.
                         * @memberof google.ai.generativelanguage.v1beta2.TextService
                         * @typedef GenerateTextCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta2.GenerateTextResponse} [response] GenerateTextResponse
                         */
    
                        /**
                         * Calls GenerateText.
                         * @function generateText
                         * @memberof google.ai.generativelanguage.v1beta2.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateTextRequest} request GenerateTextRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta2.TextService.GenerateTextCallback} callback Node-style callback called with the error, if any, and GenerateTextResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.generateText = function generateText(request, callback) {
                            return this.rpcCall(generateText, $root.google.ai.generativelanguage.v1beta2.GenerateTextRequest, $root.google.ai.generativelanguage.v1beta2.GenerateTextResponse, request, callback);
                        }, "name", { value: "GenerateText" });
    
                        /**
                         * Calls GenerateText.
                         * @function generateText
                         * @memberof google.ai.generativelanguage.v1beta2.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateTextRequest} request GenerateTextRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta2.GenerateTextResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta2.TextService|embedText}.
                         * @memberof google.ai.generativelanguage.v1beta2.TextService
                         * @typedef EmbedTextCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta2.EmbedTextResponse} [response] EmbedTextResponse
                         */
    
                        /**
                         * Calls EmbedText.
                         * @function embedText
                         * @memberof google.ai.generativelanguage.v1beta2.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedTextRequest} request EmbedTextRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta2.TextService.EmbedTextCallback} callback Node-style callback called with the error, if any, and EmbedTextResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.embedText = function embedText(request, callback) {
                            return this.rpcCall(embedText, $root.google.ai.generativelanguage.v1beta2.EmbedTextRequest, $root.google.ai.generativelanguage.v1beta2.EmbedTextResponse, request, callback);
                        }, "name", { value: "EmbedText" });
    
                        /**
                         * Calls EmbedText.
                         * @function embedText
                         * @memberof google.ai.generativelanguage.v1beta2.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedTextRequest} request EmbedTextRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta2.EmbedTextResponse>} Promise
                         * @variation 2
                         */
    
                        return TextService;
                    })();
    
                    v1beta2.GenerateTextRequest = (function() {
    
                        /**
                         * Properties of a GenerateTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IGenerateTextRequest
                         * @property {string|null} [model] GenerateTextRequest model
                         * @property {google.ai.generativelanguage.v1beta2.ITextPrompt|null} [prompt] GenerateTextRequest prompt
                         * @property {number|null} [temperature] GenerateTextRequest temperature
                         * @property {number|null} [candidateCount] GenerateTextRequest candidateCount
                         * @property {number|null} [maxOutputTokens] GenerateTextRequest maxOutputTokens
                         * @property {number|null} [topP] GenerateTextRequest topP
                         * @property {number|null} [topK] GenerateTextRequest topK
                         * @property {Array.<google.ai.generativelanguage.v1beta2.ISafetySetting>|null} [safetySettings] GenerateTextRequest safetySettings
                         * @property {Array.<string>|null} [stopSequences] GenerateTextRequest stopSequences
                         */
    
                        /**
                         * Constructs a new GenerateTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a GenerateTextRequest.
                         * @implements IGenerateTextRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateTextRequest=} [properties] Properties to set
                         */
                        function GenerateTextRequest(properties) {
                            this.safetySettings = [];
                            this.stopSequences = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateTextRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.model = "";
    
                        /**
                         * GenerateTextRequest prompt.
                         * @member {google.ai.generativelanguage.v1beta2.ITextPrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.prompt = null;
    
                        /**
                         * GenerateTextRequest temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.temperature = null;
    
                        /**
                         * GenerateTextRequest candidateCount.
                         * @member {number|null|undefined} candidateCount
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.candidateCount = null;
    
                        /**
                         * GenerateTextRequest maxOutputTokens.
                         * @member {number|null|undefined} maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.maxOutputTokens = null;
    
                        /**
                         * GenerateTextRequest topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.topP = null;
    
                        /**
                         * GenerateTextRequest topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.topK = null;
    
                        /**
                         * GenerateTextRequest safetySettings.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.ISafetySetting>} safetySettings
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.safetySettings = $util.emptyArray;
    
                        /**
                         * GenerateTextRequest stopSequences.
                         * @member {Array.<string>} stopSequences
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.stopSequences = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateTextRequest _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _candidateCount.
                         * @member {"candidateCount"|undefined} _candidateCount
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_candidateCount", {
                            get: $util.oneOfGetter($oneOfFields = ["candidateCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _maxOutputTokens.
                         * @member {"maxOutputTokens"|undefined} _maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_maxOutputTokens", {
                            get: $util.oneOfGetter($oneOfFields = ["maxOutputTokens"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateTextRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateTextRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateTextRequest} GenerateTextRequest instance
                         */
                        GenerateTextRequest.create = function create(properties) {
                            return new GenerateTextRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.GenerateTextRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1beta2.TextPrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature);
                            if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount);
                            if (message.maxOutputTokens != null && Object.hasOwnProperty.call(message, "maxOutputTokens"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxOutputTokens);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 6, wireType 5 =*/53).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.topK);
                            if (message.safetySettings != null && message.safetySettings.length)
                                for (var i = 0; i < message.safetySettings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.stopSequences != null && message.stopSequences.length)
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    writer.uint32(/* id 9, wireType 2 =*/74).string(message.stopSequences[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.GenerateTextRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateTextRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateTextRequest} GenerateTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.GenerateTextRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1beta2.TextPrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 4: {
                                        message.candidateCount = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.maxOutputTokens = reader.int32();
                                        break;
                                    }
                                case 6: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 7: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        if (!(message.safetySettings && message.safetySettings.length))
                                            message.safetySettings = [];
                                        message.safetySettings.push($root.google.ai.generativelanguage.v1beta2.SafetySetting.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 9: {
                                        if (!(message.stopSequences && message.stopSequences.length))
                                            message.stopSequences = [];
                                        message.stopSequences.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateTextRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateTextRequest} GenerateTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateTextRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateTextRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1beta2.TextPrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                properties._candidateCount = 1;
                                if (!$util.isInteger(message.candidateCount))
                                    return "candidateCount: integer expected";
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                properties._maxOutputTokens = 1;
                                if (!$util.isInteger(message.maxOutputTokens))
                                    return "maxOutputTokens: integer expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) {
                                if (!Array.isArray(message.safetySettings))
                                    return "safetySettings: array expected";
                                for (var i = 0; i < message.safetySettings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.SafetySetting.verify(message.safetySettings[i]);
                                    if (error)
                                        return "safetySettings." + error;
                                }
                            }
                            if (message.stopSequences != null && message.hasOwnProperty("stopSequences")) {
                                if (!Array.isArray(message.stopSequences))
                                    return "stopSequences: array expected";
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    if (!$util.isString(message.stopSequences[i]))
                                        return "stopSequences: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateTextRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateTextRequest} GenerateTextRequest
                         */
                        GenerateTextRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.GenerateTextRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.GenerateTextRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateTextRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1beta2.TextPrompt.fromObject(object.prompt);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.candidateCount != null)
                                message.candidateCount = object.candidateCount | 0;
                            if (object.maxOutputTokens != null)
                                message.maxOutputTokens = object.maxOutputTokens | 0;
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            if (object.safetySettings) {
                                if (!Array.isArray(object.safetySettings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateTextRequest.safetySettings: array expected");
                                message.safetySettings = [];
                                for (var i = 0; i < object.safetySettings.length; ++i) {
                                    if (typeof object.safetySettings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateTextRequest.safetySettings: object expected");
                                    message.safetySettings[i] = $root.google.ai.generativelanguage.v1beta2.SafetySetting.fromObject(object.safetySettings[i]);
                                }
                            }
                            if (object.stopSequences) {
                                if (!Array.isArray(object.stopSequences))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateTextRequest.stopSequences: array expected");
                                message.stopSequences = [];
                                for (var i = 0; i < object.stopSequences.length; ++i)
                                    message.stopSequences[i] = String(object.stopSequences[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateTextRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.GenerateTextRequest} message GenerateTextRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateTextRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.safetySettings = [];
                                object.stopSequences = [];
                            }
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1beta2.TextPrompt.toObject(message.prompt, options);
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                object.candidateCount = message.candidateCount;
                                if (options.oneofs)
                                    object._candidateCount = "candidateCount";
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                object.maxOutputTokens = message.maxOutputTokens;
                                if (options.oneofs)
                                    object._maxOutputTokens = "maxOutputTokens";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.safetySettings && message.safetySettings.length) {
                                object.safetySettings = [];
                                for (var j = 0; j < message.safetySettings.length; ++j)
                                    object.safetySettings[j] = $root.google.ai.generativelanguage.v1beta2.SafetySetting.toObject(message.safetySettings[j], options);
                            }
                            if (message.stopSequences && message.stopSequences.length) {
                                object.stopSequences = [];
                                for (var j = 0; j < message.stopSequences.length; ++j)
                                    object.stopSequences[j] = message.stopSequences[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateTextRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateTextRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateTextRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.GenerateTextRequest";
                        };
    
                        return GenerateTextRequest;
                    })();
    
                    v1beta2.GenerateTextResponse = (function() {
    
                        /**
                         * Properties of a GenerateTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IGenerateTextResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta2.ITextCompletion>|null} [candidates] GenerateTextResponse candidates
                         * @property {Array.<google.ai.generativelanguage.v1beta2.IContentFilter>|null} [filters] GenerateTextResponse filters
                         * @property {Array.<google.ai.generativelanguage.v1beta2.ISafetyFeedback>|null} [safetyFeedback] GenerateTextResponse safetyFeedback
                         */
    
                        /**
                         * Constructs a new GenerateTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a GenerateTextResponse.
                         * @implements IGenerateTextResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateTextResponse=} [properties] Properties to set
                         */
                        function GenerateTextResponse(properties) {
                            this.candidates = [];
                            this.filters = [];
                            this.safetyFeedback = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateTextResponse candidates.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.ITextCompletion>} candidates
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.candidates = $util.emptyArray;
    
                        /**
                         * GenerateTextResponse filters.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.IContentFilter>} filters
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.filters = $util.emptyArray;
    
                        /**
                         * GenerateTextResponse safetyFeedback.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.ISafetyFeedback>} safetyFeedback
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.safetyFeedback = $util.emptyArray;
    
                        /**
                         * Creates a new GenerateTextResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateTextResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateTextResponse} GenerateTextResponse instance
                         */
                        GenerateTextResponse.create = function create(properties) {
                            return new GenerateTextResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.GenerateTextResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidates != null && message.candidates.length)
                                for (var i = 0; i < message.candidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.TextCompletion.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.filters != null && message.filters.length)
                                for (var i = 0; i < message.filters.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.safetyFeedback != null && message.safetyFeedback.length)
                                for (var i = 0; i < message.safetyFeedback.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.SafetyFeedback.encode(message.safetyFeedback[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.GenerateTextResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateTextResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateTextResponse} GenerateTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.GenerateTextResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.candidates && message.candidates.length))
                                            message.candidates = [];
                                        message.candidates.push($root.google.ai.generativelanguage.v1beta2.TextCompletion.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.filters && message.filters.length))
                                            message.filters = [];
                                        message.filters.push($root.google.ai.generativelanguage.v1beta2.ContentFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        if (!(message.safetyFeedback && message.safetyFeedback.length))
                                            message.safetyFeedback = [];
                                        message.safetyFeedback.push($root.google.ai.generativelanguage.v1beta2.SafetyFeedback.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateTextResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateTextResponse} GenerateTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateTextResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateTextResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                if (!Array.isArray(message.candidates))
                                    return "candidates: array expected";
                                for (var i = 0; i < message.candidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.TextCompletion.verify(message.candidates[i]);
                                    if (error)
                                        return "candidates." + error;
                                }
                            }
                            if (message.filters != null && message.hasOwnProperty("filters")) {
                                if (!Array.isArray(message.filters))
                                    return "filters: array expected";
                                for (var i = 0; i < message.filters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.ContentFilter.verify(message.filters[i]);
                                    if (error)
                                        return "filters." + error;
                                }
                            }
                            if (message.safetyFeedback != null && message.hasOwnProperty("safetyFeedback")) {
                                if (!Array.isArray(message.safetyFeedback))
                                    return "safetyFeedback: array expected";
                                for (var i = 0; i < message.safetyFeedback.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.SafetyFeedback.verify(message.safetyFeedback[i]);
                                    if (error)
                                        return "safetyFeedback." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateTextResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.GenerateTextResponse} GenerateTextResponse
                         */
                        GenerateTextResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.GenerateTextResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.GenerateTextResponse();
                            if (object.candidates) {
                                if (!Array.isArray(object.candidates))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateTextResponse.candidates: array expected");
                                message.candidates = [];
                                for (var i = 0; i < object.candidates.length; ++i) {
                                    if (typeof object.candidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateTextResponse.candidates: object expected");
                                    message.candidates[i] = $root.google.ai.generativelanguage.v1beta2.TextCompletion.fromObject(object.candidates[i]);
                                }
                            }
                            if (object.filters) {
                                if (!Array.isArray(object.filters))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateTextResponse.filters: array expected");
                                message.filters = [];
                                for (var i = 0; i < object.filters.length; ++i) {
                                    if (typeof object.filters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateTextResponse.filters: object expected");
                                    message.filters[i] = $root.google.ai.generativelanguage.v1beta2.ContentFilter.fromObject(object.filters[i]);
                                }
                            }
                            if (object.safetyFeedback) {
                                if (!Array.isArray(object.safetyFeedback))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateTextResponse.safetyFeedback: array expected");
                                message.safetyFeedback = [];
                                for (var i = 0; i < object.safetyFeedback.length; ++i) {
                                    if (typeof object.safetyFeedback[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateTextResponse.safetyFeedback: object expected");
                                    message.safetyFeedback[i] = $root.google.ai.generativelanguage.v1beta2.SafetyFeedback.fromObject(object.safetyFeedback[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateTextResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.GenerateTextResponse} message GenerateTextResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateTextResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.candidates = [];
                                object.filters = [];
                                object.safetyFeedback = [];
                            }
                            if (message.candidates && message.candidates.length) {
                                object.candidates = [];
                                for (var j = 0; j < message.candidates.length; ++j)
                                    object.candidates[j] = $root.google.ai.generativelanguage.v1beta2.TextCompletion.toObject(message.candidates[j], options);
                            }
                            if (message.filters && message.filters.length) {
                                object.filters = [];
                                for (var j = 0; j < message.filters.length; ++j)
                                    object.filters[j] = $root.google.ai.generativelanguage.v1beta2.ContentFilter.toObject(message.filters[j], options);
                            }
                            if (message.safetyFeedback && message.safetyFeedback.length) {
                                object.safetyFeedback = [];
                                for (var j = 0; j < message.safetyFeedback.length; ++j)
                                    object.safetyFeedback[j] = $root.google.ai.generativelanguage.v1beta2.SafetyFeedback.toObject(message.safetyFeedback[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateTextResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateTextResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateTextResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.GenerateTextResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.GenerateTextResponse";
                        };
    
                        return GenerateTextResponse;
                    })();
    
                    v1beta2.TextPrompt = (function() {
    
                        /**
                         * Properties of a TextPrompt.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface ITextPrompt
                         * @property {string|null} [text] TextPrompt text
                         */
    
                        /**
                         * Constructs a new TextPrompt.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a TextPrompt.
                         * @implements ITextPrompt
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.ITextPrompt=} [properties] Properties to set
                         */
                        function TextPrompt(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TextPrompt text.
                         * @member {string} text
                         * @memberof google.ai.generativelanguage.v1beta2.TextPrompt
                         * @instance
                         */
                        TextPrompt.prototype.text = "";
    
                        /**
                         * Creates a new TextPrompt instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ITextPrompt=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.TextPrompt} TextPrompt instance
                         */
                        TextPrompt.create = function create(properties) {
                            return new TextPrompt(properties);
                        };
    
                        /**
                         * Encodes the specified TextPrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.TextPrompt.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ITextPrompt} message TextPrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextPrompt.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TextPrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.TextPrompt.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ITextPrompt} message TextPrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextPrompt.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TextPrompt message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.TextPrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.TextPrompt} TextPrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextPrompt.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.TextPrompt();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TextPrompt message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.TextPrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.TextPrompt} TextPrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextPrompt.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TextPrompt message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.TextPrompt
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TextPrompt.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.text != null && message.hasOwnProperty("text"))
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TextPrompt message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.TextPrompt
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.TextPrompt} TextPrompt
                         */
                        TextPrompt.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.TextPrompt)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.TextPrompt();
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TextPrompt message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.TextPrompt} message TextPrompt
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TextPrompt.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.text = "";
                            if (message.text != null && message.hasOwnProperty("text"))
                                object.text = message.text;
                            return object;
                        };
    
                        /**
                         * Converts this TextPrompt to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.TextPrompt
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TextPrompt.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TextPrompt
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.TextPrompt
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TextPrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.TextPrompt";
                        };
    
                        return TextPrompt;
                    })();
    
                    v1beta2.TextCompletion = (function() {
    
                        /**
                         * Properties of a TextCompletion.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface ITextCompletion
                         * @property {string|null} [output] TextCompletion output
                         * @property {Array.<google.ai.generativelanguage.v1beta2.ISafetyRating>|null} [safetyRatings] TextCompletion safetyRatings
                         * @property {google.ai.generativelanguage.v1beta2.ICitationMetadata|null} [citationMetadata] TextCompletion citationMetadata
                         */
    
                        /**
                         * Constructs a new TextCompletion.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents a TextCompletion.
                         * @implements ITextCompletion
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.ITextCompletion=} [properties] Properties to set
                         */
                        function TextCompletion(properties) {
                            this.safetyRatings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TextCompletion output.
                         * @member {string} output
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.output = "";
    
                        /**
                         * TextCompletion safetyRatings.
                         * @member {Array.<google.ai.generativelanguage.v1beta2.ISafetyRating>} safetyRatings
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.safetyRatings = $util.emptyArray;
    
                        /**
                         * TextCompletion citationMetadata.
                         * @member {google.ai.generativelanguage.v1beta2.ICitationMetadata|null|undefined} citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.citationMetadata = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TextCompletion _citationMetadata.
                         * @member {"citationMetadata"|undefined} _citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @instance
                         */
                        Object.defineProperty(TextCompletion.prototype, "_citationMetadata", {
                            get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TextCompletion instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ITextCompletion=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.TextCompletion} TextCompletion instance
                         */
                        TextCompletion.create = function create(properties) {
                            return new TextCompletion(properties);
                        };
    
                        /**
                         * Encodes the specified TextCompletion message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.TextCompletion.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ITextCompletion} message TextCompletion message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextCompletion.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.output);
                            if (message.safetyRatings != null && message.safetyRatings.length)
                                for (var i = 0; i < message.safetyRatings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta2.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata"))
                                $root.google.ai.generativelanguage.v1beta2.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TextCompletion message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.TextCompletion.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.ITextCompletion} message TextCompletion message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextCompletion.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TextCompletion message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.TextCompletion} TextCompletion
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextCompletion.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.TextCompletion();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.output = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.safetyRatings && message.safetyRatings.length))
                                            message.safetyRatings = [];
                                        message.safetyRatings.push($root.google.ai.generativelanguage.v1beta2.SafetyRating.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        message.citationMetadata = $root.google.ai.generativelanguage.v1beta2.CitationMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TextCompletion message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.TextCompletion} TextCompletion
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextCompletion.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TextCompletion message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TextCompletion.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.output != null && message.hasOwnProperty("output"))
                                if (!$util.isString(message.output))
                                    return "output: string expected";
                            if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                if (!Array.isArray(message.safetyRatings))
                                    return "safetyRatings: array expected";
                                for (var i = 0; i < message.safetyRatings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta2.SafetyRating.verify(message.safetyRatings[i]);
                                    if (error)
                                        return "safetyRatings." + error;
                                }
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                properties._citationMetadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta2.CitationMetadata.verify(message.citationMetadata);
                                    if (error)
                                        return "citationMetadata." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TextCompletion message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.TextCompletion} TextCompletion
                         */
                        TextCompletion.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.TextCompletion)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.TextCompletion();
                            if (object.output != null)
                                message.output = String(object.output);
                            if (object.safetyRatings) {
                                if (!Array.isArray(object.safetyRatings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.TextCompletion.safetyRatings: array expected");
                                message.safetyRatings = [];
                                for (var i = 0; i < object.safetyRatings.length; ++i) {
                                    if (typeof object.safetyRatings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta2.TextCompletion.safetyRatings: object expected");
                                    message.safetyRatings[i] = $root.google.ai.generativelanguage.v1beta2.SafetyRating.fromObject(object.safetyRatings[i]);
                                }
                            }
                            if (object.citationMetadata != null) {
                                if (typeof object.citationMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.TextCompletion.citationMetadata: object expected");
                                message.citationMetadata = $root.google.ai.generativelanguage.v1beta2.CitationMetadata.fromObject(object.citationMetadata);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TextCompletion message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.TextCompletion} message TextCompletion
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TextCompletion.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.safetyRatings = [];
                            if (options.defaults)
                                object.output = "";
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = message.output;
                            if (message.safetyRatings && message.safetyRatings.length) {
                                object.safetyRatings = [];
                                for (var j = 0; j < message.safetyRatings.length; ++j)
                                    object.safetyRatings[j] = $root.google.ai.generativelanguage.v1beta2.SafetyRating.toObject(message.safetyRatings[j], options);
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                object.citationMetadata = $root.google.ai.generativelanguage.v1beta2.CitationMetadata.toObject(message.citationMetadata, options);
                                if (options.oneofs)
                                    object._citationMetadata = "citationMetadata";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TextCompletion to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TextCompletion.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TextCompletion
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.TextCompletion
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TextCompletion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.TextCompletion";
                        };
    
                        return TextCompletion;
                    })();
    
                    v1beta2.EmbedTextRequest = (function() {
    
                        /**
                         * Properties of an EmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IEmbedTextRequest
                         * @property {string|null} [model] EmbedTextRequest model
                         * @property {string|null} [text] EmbedTextRequest text
                         */
    
                        /**
                         * Constructs a new EmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents an EmbedTextRequest.
                         * @implements IEmbedTextRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedTextRequest=} [properties] Properties to set
                         */
                        function EmbedTextRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedTextRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @instance
                         */
                        EmbedTextRequest.prototype.model = "";
    
                        /**
                         * EmbedTextRequest text.
                         * @member {string} text
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @instance
                         */
                        EmbedTextRequest.prototype.text = "";
    
                        /**
                         * Creates a new EmbedTextRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedTextRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.EmbedTextRequest} EmbedTextRequest instance
                         */
                        EmbedTextRequest.create = function create(properties) {
                            return new EmbedTextRequest(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.EmbedTextRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.EmbedTextRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedTextRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.EmbedTextRequest} EmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.EmbedTextRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedTextRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.EmbedTextRequest} EmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedTextRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedTextRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.text != null && message.hasOwnProperty("text"))
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            return null;
                        };
    
                        /**
                         * Creates an EmbedTextRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.EmbedTextRequest} EmbedTextRequest
                         */
                        EmbedTextRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.EmbedTextRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.EmbedTextRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedTextRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.EmbedTextRequest} message EmbedTextRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedTextRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.text = "";
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.text != null && message.hasOwnProperty("text"))
                                object.text = message.text;
                            return object;
                        };
    
                        /**
                         * Converts this EmbedTextRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedTextRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedTextRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.EmbedTextRequest";
                        };
    
                        return EmbedTextRequest;
                    })();
    
                    v1beta2.EmbedTextResponse = (function() {
    
                        /**
                         * Properties of an EmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IEmbedTextResponse
                         * @property {google.ai.generativelanguage.v1beta2.IEmbedding|null} [embedding] EmbedTextResponse embedding
                         */
    
                        /**
                         * Constructs a new EmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents an EmbedTextResponse.
                         * @implements IEmbedTextResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedTextResponse=} [properties] Properties to set
                         */
                        function EmbedTextResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedTextResponse embedding.
                         * @member {google.ai.generativelanguage.v1beta2.IEmbedding|null|undefined} embedding
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @instance
                         */
                        EmbedTextResponse.prototype.embedding = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * EmbedTextResponse _embedding.
                         * @member {"embedding"|undefined} _embedding
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @instance
                         */
                        Object.defineProperty(EmbedTextResponse.prototype, "_embedding", {
                            get: $util.oneOfGetter($oneOfFields = ["embedding"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new EmbedTextResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedTextResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.EmbedTextResponse} EmbedTextResponse instance
                         */
                        EmbedTextResponse.create = function create(properties) {
                            return new EmbedTextResponse(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.EmbedTextResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embedding != null && Object.hasOwnProperty.call(message, "embedding"))
                                $root.google.ai.generativelanguage.v1beta2.Embedding.encode(message.embedding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.EmbedTextResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedTextResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.EmbedTextResponse} EmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.EmbedTextResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.embedding = $root.google.ai.generativelanguage.v1beta2.Embedding.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedTextResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.EmbedTextResponse} EmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedTextResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedTextResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.embedding != null && message.hasOwnProperty("embedding")) {
                                properties._embedding = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta2.Embedding.verify(message.embedding);
                                    if (error)
                                        return "embedding." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates an EmbedTextResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.EmbedTextResponse} EmbedTextResponse
                         */
                        EmbedTextResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.EmbedTextResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.EmbedTextResponse();
                            if (object.embedding != null) {
                                if (typeof object.embedding !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.EmbedTextResponse.embedding: object expected");
                                message.embedding = $root.google.ai.generativelanguage.v1beta2.Embedding.fromObject(object.embedding);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedTextResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.EmbedTextResponse} message EmbedTextResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedTextResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.embedding != null && message.hasOwnProperty("embedding")) {
                                object.embedding = $root.google.ai.generativelanguage.v1beta2.Embedding.toObject(message.embedding, options);
                                if (options.oneofs)
                                    object._embedding = "embedding";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this EmbedTextResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedTextResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedTextResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.EmbedTextResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.EmbedTextResponse";
                        };
    
                        return EmbedTextResponse;
                    })();
    
                    v1beta2.Embedding = (function() {
    
                        /**
                         * Properties of an Embedding.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @interface IEmbedding
                         * @property {Array.<number>|null} [value] Embedding value
                         */
    
                        /**
                         * Constructs a new Embedding.
                         * @memberof google.ai.generativelanguage.v1beta2
                         * @classdesc Represents an Embedding.
                         * @implements IEmbedding
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedding=} [properties] Properties to set
                         */
                        function Embedding(properties) {
                            this.value = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Embedding value.
                         * @member {Array.<number>} value
                         * @memberof google.ai.generativelanguage.v1beta2.Embedding
                         * @instance
                         */
                        Embedding.prototype.value = $util.emptyArray;
    
                        /**
                         * Creates a new Embedding instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta2.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedding=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta2.Embedding} Embedding instance
                         */
                        Embedding.create = function create(properties) {
                            return new Embedding(properties);
                        };
    
                        /**
                         * Encodes the specified Embedding message. Does not implicitly {@link google.ai.generativelanguage.v1beta2.Embedding.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta2.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedding} message Embedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Embedding.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.value != null && message.value.length) {
                                writer.uint32(/* id 1, wireType 2 =*/10).fork();
                                for (var i = 0; i < message.value.length; ++i)
                                    writer.float(message.value[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Embedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta2.Embedding.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.IEmbedding} message Embedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Embedding.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an Embedding message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta2.Embedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta2.Embedding} Embedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Embedding.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta2.Embedding();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.value && message.value.length))
                                            message.value = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.value.push(reader.float());
                                        } else
                                            message.value.push(reader.float());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an Embedding message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta2.Embedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta2.Embedding} Embedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Embedding.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an Embedding message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta2.Embedding
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Embedding.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.value != null && message.hasOwnProperty("value")) {
                                if (!Array.isArray(message.value))
                                    return "value: array expected";
                                for (var i = 0; i < message.value.length; ++i)
                                    if (typeof message.value[i] !== "number")
                                        return "value: number[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates an Embedding message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta2.Embedding
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta2.Embedding} Embedding
                         */
                        Embedding.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta2.Embedding)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta2.Embedding();
                            if (object.value) {
                                if (!Array.isArray(object.value))
                                    throw TypeError(".google.ai.generativelanguage.v1beta2.Embedding.value: array expected");
                                message.value = [];
                                for (var i = 0; i < object.value.length; ++i)
                                    message.value[i] = Number(object.value[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an Embedding message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta2.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta2.Embedding} message Embedding
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Embedding.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.value = [];
                            if (message.value && message.value.length) {
                                object.value = [];
                                for (var j = 0; j < message.value.length; ++j)
                                    object.value[j] = options.json && !isFinite(message.value[j]) ? String(message.value[j]) : message.value[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Embedding to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta2.Embedding
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Embedding.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Embedding
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta2.Embedding
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Embedding.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta2.Embedding";
                        };
    
                        return Embedding;
                    })();
    
                    return v1beta2;
                })();
    
                generativelanguage.v1beta3 = (function() {
    
                    /**
                     * Namespace v1beta3.
                     * @memberof google.ai.generativelanguage
                     * @namespace
                     */
                    var v1beta3 = {};
    
                    v1beta3.CitationMetadata = (function() {
    
                        /**
                         * Properties of a CitationMetadata.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ICitationMetadata
                         * @property {Array.<google.ai.generativelanguage.v1beta3.ICitationSource>|null} [citationSources] CitationMetadata citationSources
                         */
    
                        /**
                         * Constructs a new CitationMetadata.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a CitationMetadata.
                         * @implements ICitationMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ICitationMetadata=} [properties] Properties to set
                         */
                        function CitationMetadata(properties) {
                            this.citationSources = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CitationMetadata citationSources.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.ICitationSource>} citationSources
                         * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata
                         * @instance
                         */
                        CitationMetadata.prototype.citationSources = $util.emptyArray;
    
                        /**
                         * Creates a new CitationMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICitationMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.CitationMetadata} CitationMetadata instance
                         */
                        CitationMetadata.create = function create(properties) {
                            return new CitationMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICitationMetadata} message CitationMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.citationSources != null && message.citationSources.length)
                                for (var i = 0; i < message.citationSources.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.CitationSource.encode(message.citationSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICitationMetadata} message CitationMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CitationMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.CitationMetadata} CitationMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CitationMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.citationSources && message.citationSources.length))
                                            message.citationSources = [];
                                        message.citationSources.push($root.google.ai.generativelanguage.v1beta3.CitationSource.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CitationMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.CitationMetadata} CitationMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CitationMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CitationMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.citationSources != null && message.hasOwnProperty("citationSources")) {
                                if (!Array.isArray(message.citationSources))
                                    return "citationSources: array expected";
                                for (var i = 0; i < message.citationSources.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.CitationSource.verify(message.citationSources[i]);
                                    if (error)
                                        return "citationSources." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CitationMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.CitationMetadata} CitationMetadata
                         */
                        CitationMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.CitationMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.CitationMetadata();
                            if (object.citationSources) {
                                if (!Array.isArray(object.citationSources))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.CitationMetadata.citationSources: array expected");
                                message.citationSources = [];
                                for (var i = 0; i < object.citationSources.length; ++i) {
                                    if (typeof object.citationSources[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.CitationMetadata.citationSources: object expected");
                                    message.citationSources[i] = $root.google.ai.generativelanguage.v1beta3.CitationSource.fromObject(object.citationSources[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CitationMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.CitationMetadata} message CitationMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CitationMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.citationSources = [];
                            if (message.citationSources && message.citationSources.length) {
                                object.citationSources = [];
                                for (var j = 0; j < message.citationSources.length; ++j)
                                    object.citationSources[j] = $root.google.ai.generativelanguage.v1beta3.CitationSource.toObject(message.citationSources[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CitationMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CitationMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CitationMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CitationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CitationMetadata";
                        };
    
                        return CitationMetadata;
                    })();
    
                    v1beta3.CitationSource = (function() {
    
                        /**
                         * Properties of a CitationSource.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ICitationSource
                         * @property {number|null} [startIndex] CitationSource startIndex
                         * @property {number|null} [endIndex] CitationSource endIndex
                         * @property {string|null} [uri] CitationSource uri
                         * @property {string|null} [license] CitationSource license
                         */
    
                        /**
                         * Constructs a new CitationSource.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a CitationSource.
                         * @implements ICitationSource
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ICitationSource=} [properties] Properties to set
                         */
                        function CitationSource(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CitationSource startIndex.
                         * @member {number|null|undefined} startIndex
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.startIndex = null;
    
                        /**
                         * CitationSource endIndex.
                         * @member {number|null|undefined} endIndex
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.endIndex = null;
    
                        /**
                         * CitationSource uri.
                         * @member {string|null|undefined} uri
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.uri = null;
    
                        /**
                         * CitationSource license.
                         * @member {string|null|undefined} license
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @instance
                         */
                        CitationSource.prototype.license = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CitationSource _startIndex.
                         * @member {"startIndex"|undefined} _startIndex
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_startIndex", {
                            get: $util.oneOfGetter($oneOfFields = ["startIndex"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _endIndex.
                         * @member {"endIndex"|undefined} _endIndex
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_endIndex", {
                            get: $util.oneOfGetter($oneOfFields = ["endIndex"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _uri.
                         * @member {"uri"|undefined} _uri
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_uri", {
                            get: $util.oneOfGetter($oneOfFields = ["uri"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * CitationSource _license.
                         * @member {"license"|undefined} _license
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @instance
                         */
                        Object.defineProperty(CitationSource.prototype, "_license", {
                            get: $util.oneOfGetter($oneOfFields = ["license"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CitationSource instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICitationSource=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.CitationSource} CitationSource instance
                         */
                        CitationSource.create = function create(properties) {
                            return new CitationSource(properties);
                        };
    
                        /**
                         * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationSource.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICitationSource} message CitationSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationSource.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startIndex);
                            if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endIndex);
                            if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri);
                            if (message.license != null && Object.hasOwnProperty.call(message, "license"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.license);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationSource.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICitationSource} message CitationSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CitationSource.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CitationSource message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.CitationSource} CitationSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationSource.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CitationSource();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.startIndex = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.endIndex = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.uri = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.license = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CitationSource message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.CitationSource} CitationSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CitationSource.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CitationSource message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CitationSource.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.startIndex != null && message.hasOwnProperty("startIndex")) {
                                properties._startIndex = 1;
                                if (!$util.isInteger(message.startIndex))
                                    return "startIndex: integer expected";
                            }
                            if (message.endIndex != null && message.hasOwnProperty("endIndex")) {
                                properties._endIndex = 1;
                                if (!$util.isInteger(message.endIndex))
                                    return "endIndex: integer expected";
                            }
                            if (message.uri != null && message.hasOwnProperty("uri")) {
                                properties._uri = 1;
                                if (!$util.isString(message.uri))
                                    return "uri: string expected";
                            }
                            if (message.license != null && message.hasOwnProperty("license")) {
                                properties._license = 1;
                                if (!$util.isString(message.license))
                                    return "license: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CitationSource message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.CitationSource} CitationSource
                         */
                        CitationSource.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.CitationSource)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.CitationSource();
                            if (object.startIndex != null)
                                message.startIndex = object.startIndex | 0;
                            if (object.endIndex != null)
                                message.endIndex = object.endIndex | 0;
                            if (object.uri != null)
                                message.uri = String(object.uri);
                            if (object.license != null)
                                message.license = String(object.license);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CitationSource message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.CitationSource} message CitationSource
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CitationSource.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.startIndex != null && message.hasOwnProperty("startIndex")) {
                                object.startIndex = message.startIndex;
                                if (options.oneofs)
                                    object._startIndex = "startIndex";
                            }
                            if (message.endIndex != null && message.hasOwnProperty("endIndex")) {
                                object.endIndex = message.endIndex;
                                if (options.oneofs)
                                    object._endIndex = "endIndex";
                            }
                            if (message.uri != null && message.hasOwnProperty("uri")) {
                                object.uri = message.uri;
                                if (options.oneofs)
                                    object._uri = "uri";
                            }
                            if (message.license != null && message.hasOwnProperty("license")) {
                                object.license = message.license;
                                if (options.oneofs)
                                    object._license = "license";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this CitationSource to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CitationSource.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CitationSource
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.CitationSource
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CitationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CitationSource";
                        };
    
                        return CitationSource;
                    })();
    
                    v1beta3.DiscussService = (function() {
    
                        /**
                         * Constructs a new DiscussService service.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a DiscussService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function DiscussService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (DiscussService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DiscussService;
    
                        /**
                         * Creates new DiscussService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.DiscussService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {DiscussService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        DiscussService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.DiscussService|generateMessage}.
                         * @memberof google.ai.generativelanguage.v1beta3.DiscussService
                         * @typedef GenerateMessageCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} [response] GenerateMessageResponse
                         */
    
                        /**
                         * Calls GenerateMessage.
                         * @function generateMessage
                         * @memberof google.ai.generativelanguage.v1beta3.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest} request GenerateMessageRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.DiscussService.GenerateMessageCallback} callback Node-style callback called with the error, if any, and GenerateMessageResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(DiscussService.prototype.generateMessage = function generateMessage(request, callback) {
                            return this.rpcCall(generateMessage, $root.google.ai.generativelanguage.v1beta3.GenerateMessageRequest, $root.google.ai.generativelanguage.v1beta3.GenerateMessageResponse, request, callback);
                        }, "name", { value: "GenerateMessage" });
    
                        /**
                         * Calls GenerateMessage.
                         * @function generateMessage
                         * @memberof google.ai.generativelanguage.v1beta3.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest} request GenerateMessageRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.GenerateMessageResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.DiscussService|countMessageTokens}.
                         * @memberof google.ai.generativelanguage.v1beta3.DiscussService
                         * @typedef CountMessageTokensCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} [response] CountMessageTokensResponse
                         */
    
                        /**
                         * Calls CountMessageTokens.
                         * @function countMessageTokens
                         * @memberof google.ai.generativelanguage.v1beta3.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.DiscussService.CountMessageTokensCallback} callback Node-style callback called with the error, if any, and CountMessageTokensResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(DiscussService.prototype.countMessageTokens = function countMessageTokens(request, callback) {
                            return this.rpcCall(countMessageTokens, $root.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest, $root.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse, request, callback);
                        }, "name", { value: "CountMessageTokens" });
    
                        /**
                         * Calls CountMessageTokens.
                         * @function countMessageTokens
                         * @memberof google.ai.generativelanguage.v1beta3.DiscussService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.CountMessageTokensResponse>} Promise
                         * @variation 2
                         */
    
                        return DiscussService;
                    })();
    
                    v1beta3.GenerateMessageRequest = (function() {
    
                        /**
                         * Properties of a GenerateMessageRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IGenerateMessageRequest
                         * @property {string|null} [model] GenerateMessageRequest model
                         * @property {google.ai.generativelanguage.v1beta3.IMessagePrompt|null} [prompt] GenerateMessageRequest prompt
                         * @property {number|null} [temperature] GenerateMessageRequest temperature
                         * @property {number|null} [candidateCount] GenerateMessageRequest candidateCount
                         * @property {number|null} [topP] GenerateMessageRequest topP
                         * @property {number|null} [topK] GenerateMessageRequest topK
                         */
    
                        /**
                         * Constructs a new GenerateMessageRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a GenerateMessageRequest.
                         * @implements IGenerateMessageRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest=} [properties] Properties to set
                         */
                        function GenerateMessageRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateMessageRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.model = "";
    
                        /**
                         * GenerateMessageRequest prompt.
                         * @member {google.ai.generativelanguage.v1beta3.IMessagePrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.prompt = null;
    
                        /**
                         * GenerateMessageRequest temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.temperature = null;
    
                        /**
                         * GenerateMessageRequest candidateCount.
                         * @member {number|null|undefined} candidateCount
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.candidateCount = null;
    
                        /**
                         * GenerateMessageRequest topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.topP = null;
    
                        /**
                         * GenerateMessageRequest topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @instance
                         */
                        GenerateMessageRequest.prototype.topK = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateMessageRequest _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _candidateCount.
                         * @member {"candidateCount"|undefined} _candidateCount
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_candidateCount", {
                            get: $util.oneOfGetter($oneOfFields = ["candidateCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateMessageRequest _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateMessageRequest.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateMessageRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageRequest} GenerateMessageRequest instance
                         */
                        GenerateMessageRequest.create = function create(properties) {
                            return new GenerateMessageRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateMessageRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1beta3.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature);
                            if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 5, wireType 5 =*/45).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.topK);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateMessageRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateMessageRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageRequest} GenerateMessageRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GenerateMessageRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 4: {
                                        message.candidateCount = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 6: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateMessageRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageRequest} GenerateMessageRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateMessageRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateMessageRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                properties._candidateCount = 1;
                                if (!$util.isInteger(message.candidateCount))
                                    return "candidateCount: integer expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateMessageRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageRequest} GenerateMessageRequest
                         */
                        GenerateMessageRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.GenerateMessageRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.GenerateMessageRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.fromObject(object.prompt);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.candidateCount != null)
                                message.candidateCount = object.candidateCount | 0;
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateMessageRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.GenerateMessageRequest} message GenerateMessageRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateMessageRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.toObject(message.prompt, options);
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                object.candidateCount = message.candidateCount;
                                if (options.oneofs)
                                    object._candidateCount = "candidateCount";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateMessageRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateMessageRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateMessageRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GenerateMessageRequest";
                        };
    
                        return GenerateMessageRequest;
                    })();
    
                    v1beta3.GenerateMessageResponse = (function() {
    
                        /**
                         * Properties of a GenerateMessageResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IGenerateMessageResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta3.IMessage>|null} [candidates] GenerateMessageResponse candidates
                         * @property {Array.<google.ai.generativelanguage.v1beta3.IMessage>|null} [messages] GenerateMessageResponse messages
                         * @property {Array.<google.ai.generativelanguage.v1beta3.IContentFilter>|null} [filters] GenerateMessageResponse filters
                         */
    
                        /**
                         * Constructs a new GenerateMessageResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a GenerateMessageResponse.
                         * @implements IGenerateMessageResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageResponse=} [properties] Properties to set
                         */
                        function GenerateMessageResponse(properties) {
                            this.candidates = [];
                            this.messages = [];
                            this.filters = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateMessageResponse candidates.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.IMessage>} candidates
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.candidates = $util.emptyArray;
    
                        /**
                         * GenerateMessageResponse messages.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.IMessage>} messages
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.messages = $util.emptyArray;
    
                        /**
                         * GenerateMessageResponse filters.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.IContentFilter>} filters
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @instance
                         */
                        GenerateMessageResponse.prototype.filters = $util.emptyArray;
    
                        /**
                         * Creates a new GenerateMessageResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} GenerateMessageResponse instance
                         */
                        GenerateMessageResponse.create = function create(properties) {
                            return new GenerateMessageResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateMessageResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidates != null && message.candidates.length)
                                for (var i = 0; i < message.candidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.Message.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.messages != null && message.messages.length)
                                for (var i = 0; i < message.messages.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.Message.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.filters != null && message.filters.length)
                                for (var i = 0; i < message.filters.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateMessageResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateMessageResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateMessageResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} GenerateMessageResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GenerateMessageResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.candidates && message.candidates.length))
                                            message.candidates = [];
                                        message.candidates.push($root.google.ai.generativelanguage.v1beta3.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        if (!(message.messages && message.messages.length))
                                            message.messages = [];
                                        message.messages.push($root.google.ai.generativelanguage.v1beta3.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.filters && message.filters.length))
                                            message.filters = [];
                                        message.filters.push($root.google.ai.generativelanguage.v1beta3.ContentFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateMessageResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} GenerateMessageResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateMessageResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateMessageResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateMessageResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                if (!Array.isArray(message.candidates))
                                    return "candidates: array expected";
                                for (var i = 0; i < message.candidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.Message.verify(message.candidates[i]);
                                    if (error)
                                        return "candidates." + error;
                                }
                            }
                            if (message.messages != null && message.hasOwnProperty("messages")) {
                                if (!Array.isArray(message.messages))
                                    return "messages: array expected";
                                for (var i = 0; i < message.messages.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.Message.verify(message.messages[i]);
                                    if (error)
                                        return "messages." + error;
                                }
                            }
                            if (message.filters != null && message.hasOwnProperty("filters")) {
                                if (!Array.isArray(message.filters))
                                    return "filters: array expected";
                                for (var i = 0; i < message.filters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.ContentFilter.verify(message.filters[i]);
                                    if (error)
                                        return "filters." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateMessageResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} GenerateMessageResponse
                         */
                        GenerateMessageResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.GenerateMessageResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.GenerateMessageResponse();
                            if (object.candidates) {
                                if (!Array.isArray(object.candidates))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.candidates: array expected");
                                message.candidates = [];
                                for (var i = 0; i < object.candidates.length; ++i) {
                                    if (typeof object.candidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.candidates: object expected");
                                    message.candidates[i] = $root.google.ai.generativelanguage.v1beta3.Message.fromObject(object.candidates[i]);
                                }
                            }
                            if (object.messages) {
                                if (!Array.isArray(object.messages))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.messages: array expected");
                                message.messages = [];
                                for (var i = 0; i < object.messages.length; ++i) {
                                    if (typeof object.messages[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.messages: object expected");
                                    message.messages[i] = $root.google.ai.generativelanguage.v1beta3.Message.fromObject(object.messages[i]);
                                }
                            }
                            if (object.filters) {
                                if (!Array.isArray(object.filters))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.filters: array expected");
                                message.filters = [];
                                for (var i = 0; i < object.filters.length; ++i) {
                                    if (typeof object.filters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.filters: object expected");
                                    message.filters[i] = $root.google.ai.generativelanguage.v1beta3.ContentFilter.fromObject(object.filters[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateMessageResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} message GenerateMessageResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateMessageResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.candidates = [];
                                object.messages = [];
                                object.filters = [];
                            }
                            if (message.candidates && message.candidates.length) {
                                object.candidates = [];
                                for (var j = 0; j < message.candidates.length; ++j)
                                    object.candidates[j] = $root.google.ai.generativelanguage.v1beta3.Message.toObject(message.candidates[j], options);
                            }
                            if (message.messages && message.messages.length) {
                                object.messages = [];
                                for (var j = 0; j < message.messages.length; ++j)
                                    object.messages[j] = $root.google.ai.generativelanguage.v1beta3.Message.toObject(message.messages[j], options);
                            }
                            if (message.filters && message.filters.length) {
                                object.filters = [];
                                for (var j = 0; j < message.filters.length; ++j)
                                    object.filters[j] = $root.google.ai.generativelanguage.v1beta3.ContentFilter.toObject(message.filters[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateMessageResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateMessageResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateMessageResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GenerateMessageResponse";
                        };
    
                        return GenerateMessageResponse;
                    })();
    
                    v1beta3.Message = (function() {
    
                        /**
                         * Properties of a Message.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IMessage
                         * @property {string|null} [author] Message author
                         * @property {string|null} [content] Message content
                         * @property {google.ai.generativelanguage.v1beta3.ICitationMetadata|null} [citationMetadata] Message citationMetadata
                         */
    
                        /**
                         * Constructs a new Message.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a Message.
                         * @implements IMessage
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IMessage=} [properties] Properties to set
                         */
                        function Message(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Message author.
                         * @member {string} author
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @instance
                         */
                        Message.prototype.author = "";
    
                        /**
                         * Message content.
                         * @member {string} content
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @instance
                         */
                        Message.prototype.content = "";
    
                        /**
                         * Message citationMetadata.
                         * @member {google.ai.generativelanguage.v1beta3.ICitationMetadata|null|undefined} citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @instance
                         */
                        Message.prototype.citationMetadata = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Message _citationMetadata.
                         * @member {"citationMetadata"|undefined} _citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @instance
                         */
                        Object.defineProperty(Message.prototype, "_citationMetadata", {
                            get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Message instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IMessage=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.Message} Message instance
                         */
                        Message.create = function create(properties) {
                            return new Message(properties);
                        };
    
                        /**
                         * Encodes the specified Message message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Message.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IMessage} message Message message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Message.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.author != null && Object.hasOwnProperty.call(message, "author"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.author);
                            if (message.content != null && Object.hasOwnProperty.call(message, "content"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.content);
                            if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata"))
                                $root.google.ai.generativelanguage.v1beta3.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Message message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Message.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IMessage} message Message message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Message.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Message message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.Message} Message
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Message.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Message();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.author = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.content = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Message message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.Message} Message
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Message.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Message message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Message.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.author != null && message.hasOwnProperty("author"))
                                if (!$util.isString(message.author))
                                    return "author: string expected";
                            if (message.content != null && message.hasOwnProperty("content"))
                                if (!$util.isString(message.content))
                                    return "content: string expected";
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                properties._citationMetadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.verify(message.citationMetadata);
                                    if (error)
                                        return "citationMetadata." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Message message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.Message} Message
                         */
                        Message.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.Message)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.Message();
                            if (object.author != null)
                                message.author = String(object.author);
                            if (object.content != null)
                                message.content = String(object.content);
                            if (object.citationMetadata != null) {
                                if (typeof object.citationMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.Message.citationMetadata: object expected");
                                message.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.fromObject(object.citationMetadata);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Message message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.Message} message Message
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Message.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.author = "";
                                object.content = "";
                            }
                            if (message.author != null && message.hasOwnProperty("author"))
                                object.author = message.author;
                            if (message.content != null && message.hasOwnProperty("content"))
                                object.content = message.content;
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                object.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.toObject(message.citationMetadata, options);
                                if (options.oneofs)
                                    object._citationMetadata = "citationMetadata";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Message to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Message.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Message
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.Message
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Message";
                        };
    
                        return Message;
                    })();
    
                    v1beta3.MessagePrompt = (function() {
    
                        /**
                         * Properties of a MessagePrompt.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IMessagePrompt
                         * @property {string|null} [context] MessagePrompt context
                         * @property {Array.<google.ai.generativelanguage.v1beta3.IExample>|null} [examples] MessagePrompt examples
                         * @property {Array.<google.ai.generativelanguage.v1beta3.IMessage>|null} [messages] MessagePrompt messages
                         */
    
                        /**
                         * Constructs a new MessagePrompt.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a MessagePrompt.
                         * @implements IMessagePrompt
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IMessagePrompt=} [properties] Properties to set
                         */
                        function MessagePrompt(properties) {
                            this.examples = [];
                            this.messages = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * MessagePrompt context.
                         * @member {string} context
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.context = "";
    
                        /**
                         * MessagePrompt examples.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.IExample>} examples
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.examples = $util.emptyArray;
    
                        /**
                         * MessagePrompt messages.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.IMessage>} messages
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @instance
                         */
                        MessagePrompt.prototype.messages = $util.emptyArray;
    
                        /**
                         * Creates a new MessagePrompt instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IMessagePrompt=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.MessagePrompt} MessagePrompt instance
                         */
                        MessagePrompt.create = function create(properties) {
                            return new MessagePrompt(properties);
                        };
    
                        /**
                         * Encodes the specified MessagePrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.MessagePrompt.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IMessagePrompt} message MessagePrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MessagePrompt.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.context != null && Object.hasOwnProperty.call(message, "context"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.context);
                            if (message.examples != null && message.examples.length)
                                for (var i = 0; i < message.examples.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.Example.encode(message.examples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.messages != null && message.messages.length)
                                for (var i = 0; i < message.messages.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.Message.encode(message.messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified MessagePrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.MessagePrompt.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IMessagePrompt} message MessagePrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        MessagePrompt.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a MessagePrompt message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.MessagePrompt} MessagePrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MessagePrompt.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.MessagePrompt();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.context = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.examples && message.examples.length))
                                            message.examples = [];
                                        message.examples.push($root.google.ai.generativelanguage.v1beta3.Example.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.messages && message.messages.length))
                                            message.messages = [];
                                        message.messages.push($root.google.ai.generativelanguage.v1beta3.Message.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a MessagePrompt message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.MessagePrompt} MessagePrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        MessagePrompt.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a MessagePrompt message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        MessagePrompt.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.context != null && message.hasOwnProperty("context"))
                                if (!$util.isString(message.context))
                                    return "context: string expected";
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                if (!Array.isArray(message.examples))
                                    return "examples: array expected";
                                for (var i = 0; i < message.examples.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.Example.verify(message.examples[i]);
                                    if (error)
                                        return "examples." + error;
                                }
                            }
                            if (message.messages != null && message.hasOwnProperty("messages")) {
                                if (!Array.isArray(message.messages))
                                    return "messages: array expected";
                                for (var i = 0; i < message.messages.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.Message.verify(message.messages[i]);
                                    if (error)
                                        return "messages." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a MessagePrompt message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.MessagePrompt} MessagePrompt
                         */
                        MessagePrompt.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.MessagePrompt)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.MessagePrompt();
                            if (object.context != null)
                                message.context = String(object.context);
                            if (object.examples) {
                                if (!Array.isArray(object.examples))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.MessagePrompt.examples: array expected");
                                message.examples = [];
                                for (var i = 0; i < object.examples.length; ++i) {
                                    if (typeof object.examples[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.MessagePrompt.examples: object expected");
                                    message.examples[i] = $root.google.ai.generativelanguage.v1beta3.Example.fromObject(object.examples[i]);
                                }
                            }
                            if (object.messages) {
                                if (!Array.isArray(object.messages))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.MessagePrompt.messages: array expected");
                                message.messages = [];
                                for (var i = 0; i < object.messages.length; ++i) {
                                    if (typeof object.messages[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.MessagePrompt.messages: object expected");
                                    message.messages[i] = $root.google.ai.generativelanguage.v1beta3.Message.fromObject(object.messages[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a MessagePrompt message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.MessagePrompt} message MessagePrompt
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        MessagePrompt.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.examples = [];
                                object.messages = [];
                            }
                            if (options.defaults)
                                object.context = "";
                            if (message.context != null && message.hasOwnProperty("context"))
                                object.context = message.context;
                            if (message.examples && message.examples.length) {
                                object.examples = [];
                                for (var j = 0; j < message.examples.length; ++j)
                                    object.examples[j] = $root.google.ai.generativelanguage.v1beta3.Example.toObject(message.examples[j], options);
                            }
                            if (message.messages && message.messages.length) {
                                object.messages = [];
                                for (var j = 0; j < message.messages.length; ++j)
                                    object.messages[j] = $root.google.ai.generativelanguage.v1beta3.Message.toObject(message.messages[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this MessagePrompt to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        MessagePrompt.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for MessagePrompt
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        MessagePrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.MessagePrompt";
                        };
    
                        return MessagePrompt;
                    })();
    
                    v1beta3.Example = (function() {
    
                        /**
                         * Properties of an Example.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IExample
                         * @property {google.ai.generativelanguage.v1beta3.IMessage|null} [input] Example input
                         * @property {google.ai.generativelanguage.v1beta3.IMessage|null} [output] Example output
                         */
    
                        /**
                         * Constructs a new Example.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents an Example.
                         * @implements IExample
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IExample=} [properties] Properties to set
                         */
                        function Example(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Example input.
                         * @member {google.ai.generativelanguage.v1beta3.IMessage|null|undefined} input
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @instance
                         */
                        Example.prototype.input = null;
    
                        /**
                         * Example output.
                         * @member {google.ai.generativelanguage.v1beta3.IMessage|null|undefined} output
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @instance
                         */
                        Example.prototype.output = null;
    
                        /**
                         * Creates a new Example instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IExample=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.Example} Example instance
                         */
                        Example.create = function create(properties) {
                            return new Example(properties);
                        };
    
                        /**
                         * Encodes the specified Example message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Example.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IExample} message Example message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Example.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.input != null && Object.hasOwnProperty.call(message, "input"))
                                $root.google.ai.generativelanguage.v1beta3.Message.encode(message.input, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                $root.google.ai.generativelanguage.v1beta3.Message.encode(message.output, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Example message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Example.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IExample} message Example message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Example.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an Example message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.Example} Example
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Example.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Example();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.input = $root.google.ai.generativelanguage.v1beta3.Message.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.output = $root.google.ai.generativelanguage.v1beta3.Message.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an Example message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.Example} Example
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Example.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an Example message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Example.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.input != null && message.hasOwnProperty("input")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.Message.verify(message.input);
                                if (error)
                                    return "input." + error;
                            }
                            if (message.output != null && message.hasOwnProperty("output")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.Message.verify(message.output);
                                if (error)
                                    return "output." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an Example message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.Example} Example
                         */
                        Example.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.Example)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.Example();
                            if (object.input != null) {
                                if (typeof object.input !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.Example.input: object expected");
                                message.input = $root.google.ai.generativelanguage.v1beta3.Message.fromObject(object.input);
                            }
                            if (object.output != null) {
                                if (typeof object.output !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.Example.output: object expected");
                                message.output = $root.google.ai.generativelanguage.v1beta3.Message.fromObject(object.output);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an Example message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.Example} message Example
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Example.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.input = null;
                                object.output = null;
                            }
                            if (message.input != null && message.hasOwnProperty("input"))
                                object.input = $root.google.ai.generativelanguage.v1beta3.Message.toObject(message.input, options);
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = $root.google.ai.generativelanguage.v1beta3.Message.toObject(message.output, options);
                            return object;
                        };
    
                        /**
                         * Converts this Example to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Example.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Example
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.Example
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Example";
                        };
    
                        return Example;
                    })();
    
                    v1beta3.CountMessageTokensRequest = (function() {
    
                        /**
                         * Properties of a CountMessageTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ICountMessageTokensRequest
                         * @property {string|null} [model] CountMessageTokensRequest model
                         * @property {google.ai.generativelanguage.v1beta3.IMessagePrompt|null} [prompt] CountMessageTokensRequest prompt
                         */
    
                        /**
                         * Constructs a new CountMessageTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a CountMessageTokensRequest.
                         * @implements ICountMessageTokensRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest=} [properties] Properties to set
                         */
                        function CountMessageTokensRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountMessageTokensRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @instance
                         */
                        CountMessageTokensRequest.prototype.model = "";
    
                        /**
                         * CountMessageTokensRequest prompt.
                         * @member {google.ai.generativelanguage.v1beta3.IMessagePrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @instance
                         */
                        CountMessageTokensRequest.prototype.prompt = null;
    
                        /**
                         * Creates a new CountMessageTokensRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensRequest} CountMessageTokensRequest instance
                         */
                        CountMessageTokensRequest.create = function create(properties) {
                            return new CountMessageTokensRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1beta3.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountMessageTokensRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensRequest} CountMessageTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountMessageTokensRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensRequest} CountMessageTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountMessageTokensRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountMessageTokensRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CountMessageTokensRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensRequest} CountMessageTokensRequest
                         */
                        CountMessageTokensRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.CountMessageTokensRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.fromObject(object.prompt);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountMessageTokensRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.CountMessageTokensRequest} message CountMessageTokensRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountMessageTokensRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.toObject(message.prompt, options);
                            return object;
                        };
    
                        /**
                         * Converts this CountMessageTokensRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountMessageTokensRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountMessageTokensRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountMessageTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CountMessageTokensRequest";
                        };
    
                        return CountMessageTokensRequest;
                    })();
    
                    v1beta3.CountMessageTokensResponse = (function() {
    
                        /**
                         * Properties of a CountMessageTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ICountMessageTokensResponse
                         * @property {number|null} [tokenCount] CountMessageTokensResponse tokenCount
                         */
    
                        /**
                         * Constructs a new CountMessageTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a CountMessageTokensResponse.
                         * @implements ICountMessageTokensResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse=} [properties] Properties to set
                         */
                        function CountMessageTokensResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountMessageTokensResponse tokenCount.
                         * @member {number} tokenCount
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse
                         * @instance
                         */
                        CountMessageTokensResponse.prototype.tokenCount = 0;
    
                        /**
                         * Creates a new CountMessageTokensResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} CountMessageTokensResponse instance
                         */
                        CountMessageTokensResponse.create = function create(properties) {
                            return new CountMessageTokensResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tokenCount);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountMessageTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountMessageTokensResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountMessageTokensResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} CountMessageTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tokenCount = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountMessageTokensResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} CountMessageTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountMessageTokensResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountMessageTokensResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountMessageTokensResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                if (!$util.isInteger(message.tokenCount))
                                    return "tokenCount: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a CountMessageTokensResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} CountMessageTokensResponse
                         */
                        CountMessageTokensResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse();
                            if (object.tokenCount != null)
                                message.tokenCount = object.tokenCount | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountMessageTokensResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} message CountMessageTokensResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountMessageTokensResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.tokenCount = 0;
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                object.tokenCount = message.tokenCount;
                            return object;
                        };
    
                        /**
                         * Converts this CountMessageTokensResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountMessageTokensResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountMessageTokensResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountMessageTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CountMessageTokensResponse";
                        };
    
                        return CountMessageTokensResponse;
                    })();
    
                    /**
                     * HarmCategory enum.
                     * @name google.ai.generativelanguage.v1beta3.HarmCategory
                     * @enum {number}
                     * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value
                     * @property {number} HARM_CATEGORY_DEROGATORY=1 HARM_CATEGORY_DEROGATORY value
                     * @property {number} HARM_CATEGORY_TOXICITY=2 HARM_CATEGORY_TOXICITY value
                     * @property {number} HARM_CATEGORY_VIOLENCE=3 HARM_CATEGORY_VIOLENCE value
                     * @property {number} HARM_CATEGORY_SEXUAL=4 HARM_CATEGORY_SEXUAL value
                     * @property {number} HARM_CATEGORY_MEDICAL=5 HARM_CATEGORY_MEDICAL value
                     * @property {number} HARM_CATEGORY_DANGEROUS=6 HARM_CATEGORY_DANGEROUS value
                     */
                    v1beta3.HarmCategory = (function() {
                        var valuesById = {}, values = Object.create(valuesById);
                        values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0;
                        values[valuesById[1] = "HARM_CATEGORY_DEROGATORY"] = 1;
                        values[valuesById[2] = "HARM_CATEGORY_TOXICITY"] = 2;
                        values[valuesById[3] = "HARM_CATEGORY_VIOLENCE"] = 3;
                        values[valuesById[4] = "HARM_CATEGORY_SEXUAL"] = 4;
                        values[valuesById[5] = "HARM_CATEGORY_MEDICAL"] = 5;
                        values[valuesById[6] = "HARM_CATEGORY_DANGEROUS"] = 6;
                        return values;
                    })();
    
                    v1beta3.ContentFilter = (function() {
    
                        /**
                         * Properties of a ContentFilter.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IContentFilter
                         * @property {google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason|null} [reason] ContentFilter reason
                         * @property {string|null} [message] ContentFilter message
                         */
    
                        /**
                         * Constructs a new ContentFilter.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a ContentFilter.
                         * @implements IContentFilter
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IContentFilter=} [properties] Properties to set
                         */
                        function ContentFilter(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ContentFilter reason.
                         * @member {google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason} reason
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @instance
                         */
                        ContentFilter.prototype.reason = 0;
    
                        /**
                         * ContentFilter message.
                         * @member {string|null|undefined} message
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @instance
                         */
                        ContentFilter.prototype.message = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * ContentFilter _message.
                         * @member {"message"|undefined} _message
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @instance
                         */
                        Object.defineProperty(ContentFilter.prototype, "_message", {
                            get: $util.oneOfGetter($oneOfFields = ["message"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new ContentFilter instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IContentFilter=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.ContentFilter} ContentFilter instance
                         */
                        ContentFilter.create = function create(properties) {
                            return new ContentFilter(properties);
                        };
    
                        /**
                         * Encodes the specified ContentFilter message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ContentFilter.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IContentFilter} message ContentFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentFilter.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.reason != null && Object.hasOwnProperty.call(message, "reason"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.reason);
                            if (message.message != null && Object.hasOwnProperty.call(message, "message"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.message);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ContentFilter.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IContentFilter} message ContentFilter message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ContentFilter.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ContentFilter message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.ContentFilter} ContentFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentFilter.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ContentFilter();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.reason = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.message = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ContentFilter message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.ContentFilter} ContentFilter
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ContentFilter.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ContentFilter message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ContentFilter.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.reason != null && message.hasOwnProperty("reason"))
                                switch (message.reason) {
                                default:
                                    return "reason: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                    break;
                                }
                            if (message.message != null && message.hasOwnProperty("message")) {
                                properties._message = 1;
                                if (!$util.isString(message.message))
                                    return "message: string expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.ContentFilter} ContentFilter
                         */
                        ContentFilter.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.ContentFilter)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.ContentFilter();
                            switch (object.reason) {
                            default:
                                if (typeof object.reason === "number") {
                                    message.reason = object.reason;
                                    break;
                                }
                                break;
                            case "BLOCKED_REASON_UNSPECIFIED":
                            case 0:
                                message.reason = 0;
                                break;
                            case "SAFETY":
                            case 1:
                                message.reason = 1;
                                break;
                            case "OTHER":
                            case 2:
                                message.reason = 2;
                                break;
                            }
                            if (object.message != null)
                                message.message = String(object.message);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ContentFilter message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ContentFilter} message ContentFilter
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ContentFilter.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.reason = options.enums === String ? "BLOCKED_REASON_UNSPECIFIED" : 0;
                            if (message.reason != null && message.hasOwnProperty("reason"))
                                object.reason = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason[message.reason] === undefined ? message.reason : $root.google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason[message.reason] : message.reason;
                            if (message.message != null && message.hasOwnProperty("message")) {
                                object.message = message.message;
                                if (options.oneofs)
                                    object._message = "message";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this ContentFilter to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ContentFilter.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ContentFilter
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.ContentFilter
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ContentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ContentFilter";
                        };
    
                        /**
                         * BlockedReason enum.
                         * @name google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason
                         * @enum {number}
                         * @property {number} BLOCKED_REASON_UNSPECIFIED=0 BLOCKED_REASON_UNSPECIFIED value
                         * @property {number} SAFETY=1 SAFETY value
                         * @property {number} OTHER=2 OTHER value
                         */
                        ContentFilter.BlockedReason = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "BLOCKED_REASON_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "SAFETY"] = 1;
                            values[valuesById[2] = "OTHER"] = 2;
                            return values;
                        })();
    
                        return ContentFilter;
                    })();
    
                    v1beta3.SafetyFeedback = (function() {
    
                        /**
                         * Properties of a SafetyFeedback.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ISafetyFeedback
                         * @property {google.ai.generativelanguage.v1beta3.ISafetyRating|null} [rating] SafetyFeedback rating
                         * @property {google.ai.generativelanguage.v1beta3.ISafetySetting|null} [setting] SafetyFeedback setting
                         */
    
                        /**
                         * Constructs a new SafetyFeedback.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a SafetyFeedback.
                         * @implements ISafetyFeedback
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ISafetyFeedback=} [properties] Properties to set
                         */
                        function SafetyFeedback(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetyFeedback rating.
                         * @member {google.ai.generativelanguage.v1beta3.ISafetyRating|null|undefined} rating
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @instance
                         */
                        SafetyFeedback.prototype.rating = null;
    
                        /**
                         * SafetyFeedback setting.
                         * @member {google.ai.generativelanguage.v1beta3.ISafetySetting|null|undefined} setting
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @instance
                         */
                        SafetyFeedback.prototype.setting = null;
    
                        /**
                         * Creates a new SafetyFeedback instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ISafetyFeedback=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.SafetyFeedback} SafetyFeedback instance
                         */
                        SafetyFeedback.create = function create(properties) {
                            return new SafetyFeedback(properties);
                        };
    
                        /**
                         * Encodes the specified SafetyFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyFeedback.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ISafetyFeedback} message SafetyFeedback message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyFeedback.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.rating != null && Object.hasOwnProperty.call(message, "rating"))
                                $root.google.ai.generativelanguage.v1beta3.SafetyRating.encode(message.rating, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.setting != null && Object.hasOwnProperty.call(message, "setting"))
                                $root.google.ai.generativelanguage.v1beta3.SafetySetting.encode(message.setting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetyFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyFeedback.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ISafetyFeedback} message SafetyFeedback message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyFeedback.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetyFeedback message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.SafetyFeedback} SafetyFeedback
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyFeedback.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.SafetyFeedback();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.rating = $root.google.ai.generativelanguage.v1beta3.SafetyRating.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.setting = $root.google.ai.generativelanguage.v1beta3.SafetySetting.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetyFeedback message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.SafetyFeedback} SafetyFeedback
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyFeedback.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetyFeedback message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetyFeedback.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.rating != null && message.hasOwnProperty("rating")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.SafetyRating.verify(message.rating);
                                if (error)
                                    return "rating." + error;
                            }
                            if (message.setting != null && message.hasOwnProperty("setting")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.SafetySetting.verify(message.setting);
                                if (error)
                                    return "setting." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a SafetyFeedback message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.SafetyFeedback} SafetyFeedback
                         */
                        SafetyFeedback.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.SafetyFeedback)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.SafetyFeedback();
                            if (object.rating != null) {
                                if (typeof object.rating !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.SafetyFeedback.rating: object expected");
                                message.rating = $root.google.ai.generativelanguage.v1beta3.SafetyRating.fromObject(object.rating);
                            }
                            if (object.setting != null) {
                                if (typeof object.setting !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.SafetyFeedback.setting: object expected");
                                message.setting = $root.google.ai.generativelanguage.v1beta3.SafetySetting.fromObject(object.setting);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetyFeedback message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.SafetyFeedback} message SafetyFeedback
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetyFeedback.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.rating = null;
                                object.setting = null;
                            }
                            if (message.rating != null && message.hasOwnProperty("rating"))
                                object.rating = $root.google.ai.generativelanguage.v1beta3.SafetyRating.toObject(message.rating, options);
                            if (message.setting != null && message.hasOwnProperty("setting"))
                                object.setting = $root.google.ai.generativelanguage.v1beta3.SafetySetting.toObject(message.setting, options);
                            return object;
                        };
    
                        /**
                         * Converts this SafetyFeedback to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetyFeedback.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetyFeedback
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetyFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.SafetyFeedback";
                        };
    
                        return SafetyFeedback;
                    })();
    
                    v1beta3.SafetyRating = (function() {
    
                        /**
                         * Properties of a SafetyRating.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ISafetyRating
                         * @property {google.ai.generativelanguage.v1beta3.HarmCategory|null} [category] SafetyRating category
                         * @property {google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability|null} [probability] SafetyRating probability
                         */
    
                        /**
                         * Constructs a new SafetyRating.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a SafetyRating.
                         * @implements ISafetyRating
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ISafetyRating=} [properties] Properties to set
                         */
                        function SafetyRating(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetyRating category.
                         * @member {google.ai.generativelanguage.v1beta3.HarmCategory} category
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.category = 0;
    
                        /**
                         * SafetyRating probability.
                         * @member {google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability} probability
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @instance
                         */
                        SafetyRating.prototype.probability = 0;
    
                        /**
                         * Creates a new SafetyRating instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ISafetyRating=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.SafetyRating} SafetyRating instance
                         */
                        SafetyRating.create = function create(properties) {
                            return new SafetyRating(properties);
                        };
    
                        /**
                         * Encodes the specified SafetyRating message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyRating.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ISafetyRating} message SafetyRating message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyRating.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.category != null && Object.hasOwnProperty.call(message, "category"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category);
                            if (message.probability != null && Object.hasOwnProperty.call(message, "probability"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.probability);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetyRating message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyRating.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ISafetyRating} message SafetyRating message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetyRating.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetyRating message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.SafetyRating} SafetyRating
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyRating.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.SafetyRating();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.category = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.probability = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetyRating message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.SafetyRating} SafetyRating
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetyRating.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetyRating message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetyRating.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.category != null && message.hasOwnProperty("category"))
                                switch (message.category) {
                                default:
                                    return "category: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                    break;
                                }
                            if (message.probability != null && message.hasOwnProperty("probability"))
                                switch (message.probability) {
                                default:
                                    return "probability: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                    break;
                                }
                            return null;
                        };
    
                        /**
                         * Creates a SafetyRating message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.SafetyRating} SafetyRating
                         */
                        SafetyRating.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.SafetyRating)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.SafetyRating();
                            switch (object.category) {
                            default:
                                if (typeof object.category === "number") {
                                    message.category = object.category;
                                    break;
                                }
                                break;
                            case "HARM_CATEGORY_UNSPECIFIED":
                            case 0:
                                message.category = 0;
                                break;
                            case "HARM_CATEGORY_DEROGATORY":
                            case 1:
                                message.category = 1;
                                break;
                            case "HARM_CATEGORY_TOXICITY":
                            case 2:
                                message.category = 2;
                                break;
                            case "HARM_CATEGORY_VIOLENCE":
                            case 3:
                                message.category = 3;
                                break;
                            case "HARM_CATEGORY_SEXUAL":
                            case 4:
                                message.category = 4;
                                break;
                            case "HARM_CATEGORY_MEDICAL":
                            case 5:
                                message.category = 5;
                                break;
                            case "HARM_CATEGORY_DANGEROUS":
                            case 6:
                                message.category = 6;
                                break;
                            }
                            switch (object.probability) {
                            default:
                                if (typeof object.probability === "number") {
                                    message.probability = object.probability;
                                    break;
                                }
                                break;
                            case "HARM_PROBABILITY_UNSPECIFIED":
                            case 0:
                                message.probability = 0;
                                break;
                            case "NEGLIGIBLE":
                            case 1:
                                message.probability = 1;
                                break;
                            case "LOW":
                            case 2:
                                message.probability = 2;
                                break;
                            case "MEDIUM":
                            case 3:
                                message.probability = 3;
                                break;
                            case "HIGH":
                            case 4:
                                message.probability = 4;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetyRating message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.SafetyRating} message SafetyRating
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetyRating.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0;
                                object.probability = options.enums === String ? "HARM_PROBABILITY_UNSPECIFIED" : 0;
                            }
                            if (message.category != null && message.hasOwnProperty("category"))
                                object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta3.HarmCategory[message.category] : message.category;
                            if (message.probability != null && message.hasOwnProperty("probability"))
                                object.probability = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability[message.probability] === undefined ? message.probability : $root.google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability[message.probability] : message.probability;
                            return object;
                        };
    
                        /**
                         * Converts this SafetyRating to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetyRating.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetyRating
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.SafetyRating
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetyRating.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.SafetyRating";
                        };
    
                        /**
                         * HarmProbability enum.
                         * @name google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability
                         * @enum {number}
                         * @property {number} HARM_PROBABILITY_UNSPECIFIED=0 HARM_PROBABILITY_UNSPECIFIED value
                         * @property {number} NEGLIGIBLE=1 NEGLIGIBLE value
                         * @property {number} LOW=2 LOW value
                         * @property {number} MEDIUM=3 MEDIUM value
                         * @property {number} HIGH=4 HIGH value
                         */
                        SafetyRating.HarmProbability = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "HARM_PROBABILITY_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "NEGLIGIBLE"] = 1;
                            values[valuesById[2] = "LOW"] = 2;
                            values[valuesById[3] = "MEDIUM"] = 3;
                            values[valuesById[4] = "HIGH"] = 4;
                            return values;
                        })();
    
                        return SafetyRating;
                    })();
    
                    v1beta3.SafetySetting = (function() {
    
                        /**
                         * Properties of a SafetySetting.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ISafetySetting
                         * @property {google.ai.generativelanguage.v1beta3.HarmCategory|null} [category] SafetySetting category
                         * @property {google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold|null} [threshold] SafetySetting threshold
                         */
    
                        /**
                         * Constructs a new SafetySetting.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a SafetySetting.
                         * @implements ISafetySetting
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ISafetySetting=} [properties] Properties to set
                         */
                        function SafetySetting(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * SafetySetting category.
                         * @member {google.ai.generativelanguage.v1beta3.HarmCategory} category
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @instance
                         */
                        SafetySetting.prototype.category = 0;
    
                        /**
                         * SafetySetting threshold.
                         * @member {google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold} threshold
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @instance
                         */
                        SafetySetting.prototype.threshold = 0;
    
                        /**
                         * Creates a new SafetySetting instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ISafetySetting=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.SafetySetting} SafetySetting instance
                         */
                        SafetySetting.create = function create(properties) {
                            return new SafetySetting(properties);
                        };
    
                        /**
                         * Encodes the specified SafetySetting message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetySetting.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ISafetySetting} message SafetySetting message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetySetting.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.category != null && Object.hasOwnProperty.call(message, "category"))
                                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category);
                            if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.threshold);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetySetting.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ISafetySetting} message SafetySetting message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        SafetySetting.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a SafetySetting message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.SafetySetting} SafetySetting
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetySetting.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.SafetySetting();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.category = reader.int32();
                                        break;
                                    }
                                case 4: {
                                        message.threshold = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a SafetySetting message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.SafetySetting} SafetySetting
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        SafetySetting.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a SafetySetting message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        SafetySetting.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.category != null && message.hasOwnProperty("category"))
                                switch (message.category) {
                                default:
                                    return "category: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                case 5:
                                case 6:
                                    break;
                                }
                            if (message.threshold != null && message.hasOwnProperty("threshold"))
                                switch (message.threshold) {
                                default:
                                    return "threshold: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                case 4:
                                    break;
                                }
                            return null;
                        };
    
                        /**
                         * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.SafetySetting} SafetySetting
                         */
                        SafetySetting.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.SafetySetting)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.SafetySetting();
                            switch (object.category) {
                            default:
                                if (typeof object.category === "number") {
                                    message.category = object.category;
                                    break;
                                }
                                break;
                            case "HARM_CATEGORY_UNSPECIFIED":
                            case 0:
                                message.category = 0;
                                break;
                            case "HARM_CATEGORY_DEROGATORY":
                            case 1:
                                message.category = 1;
                                break;
                            case "HARM_CATEGORY_TOXICITY":
                            case 2:
                                message.category = 2;
                                break;
                            case "HARM_CATEGORY_VIOLENCE":
                            case 3:
                                message.category = 3;
                                break;
                            case "HARM_CATEGORY_SEXUAL":
                            case 4:
                                message.category = 4;
                                break;
                            case "HARM_CATEGORY_MEDICAL":
                            case 5:
                                message.category = 5;
                                break;
                            case "HARM_CATEGORY_DANGEROUS":
                            case 6:
                                message.category = 6;
                                break;
                            }
                            switch (object.threshold) {
                            default:
                                if (typeof object.threshold === "number") {
                                    message.threshold = object.threshold;
                                    break;
                                }
                                break;
                            case "HARM_BLOCK_THRESHOLD_UNSPECIFIED":
                            case 0:
                                message.threshold = 0;
                                break;
                            case "BLOCK_LOW_AND_ABOVE":
                            case 1:
                                message.threshold = 1;
                                break;
                            case "BLOCK_MEDIUM_AND_ABOVE":
                            case 2:
                                message.threshold = 2;
                                break;
                            case "BLOCK_ONLY_HIGH":
                            case 3:
                                message.threshold = 3;
                                break;
                            case "BLOCK_NONE":
                            case 4:
                                message.threshold = 4;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a SafetySetting message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.SafetySetting} message SafetySetting
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        SafetySetting.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0;
                                object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0;
                            }
                            if (message.category != null && message.hasOwnProperty("category"))
                                object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta3.HarmCategory[message.category] : message.category;
                            if (message.threshold != null && message.hasOwnProperty("threshold"))
                                object.threshold = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold[message.threshold] : message.threshold;
                            return object;
                        };
    
                        /**
                         * Converts this SafetySetting to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        SafetySetting.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for SafetySetting
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.SafetySetting
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.SafetySetting";
                        };
    
                        /**
                         * HarmBlockThreshold enum.
                         * @name google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold
                         * @enum {number}
                         * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value
                         * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value
                         * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value
                         * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value
                         * @property {number} BLOCK_NONE=4 BLOCK_NONE value
                         */
                        SafetySetting.HarmBlockThreshold = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1;
                            values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2;
                            values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3;
                            values[valuesById[4] = "BLOCK_NONE"] = 4;
                            return values;
                        })();
    
                        return SafetySetting;
                    })();
    
                    v1beta3.Model = (function() {
    
                        /**
                         * Properties of a Model.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IModel
                         * @property {string|null} [name] Model name
                         * @property {string|null} [baseModelId] Model baseModelId
                         * @property {string|null} [version] Model version
                         * @property {string|null} [displayName] Model displayName
                         * @property {string|null} [description] Model description
                         * @property {number|null} [inputTokenLimit] Model inputTokenLimit
                         * @property {number|null} [outputTokenLimit] Model outputTokenLimit
                         * @property {Array.<string>|null} [supportedGenerationMethods] Model supportedGenerationMethods
                         * @property {number|null} [temperature] Model temperature
                         * @property {number|null} [topP] Model topP
                         * @property {number|null} [topK] Model topK
                         */
    
                        /**
                         * Constructs a new Model.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a Model.
                         * @implements IModel
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IModel=} [properties] Properties to set
                         */
                        function Model(properties) {
                            this.supportedGenerationMethods = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Model name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Model.prototype.name = "";
    
                        /**
                         * Model baseModelId.
                         * @member {string} baseModelId
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Model.prototype.baseModelId = "";
    
                        /**
                         * Model version.
                         * @member {string} version
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Model.prototype.version = "";
    
                        /**
                         * Model displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Model.prototype.displayName = "";
    
                        /**
                         * Model description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Model.prototype.description = "";
    
                        /**
                         * Model inputTokenLimit.
                         * @member {number} inputTokenLimit
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Model.prototype.inputTokenLimit = 0;
    
                        /**
                         * Model outputTokenLimit.
                         * @member {number} outputTokenLimit
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Model.prototype.outputTokenLimit = 0;
    
                        /**
                         * Model supportedGenerationMethods.
                         * @member {Array.<string>} supportedGenerationMethods
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Model.prototype.supportedGenerationMethods = $util.emptyArray;
    
                        /**
                         * Model temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Model.prototype.temperature = null;
    
                        /**
                         * Model topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Model.prototype.topP = null;
    
                        /**
                         * Model topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Model.prototype.topK = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Model _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Model _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         */
                        Object.defineProperty(Model.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Model instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IModel=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.Model} Model instance
                         */
                        Model.create = function create(properties) {
                            return new Model(properties);
                        };
    
                        /**
                         * Encodes the specified Model message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Model.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IModel} message Model message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Model.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.baseModelId != null && Object.hasOwnProperty.call(message, "baseModelId"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModelId);
                            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.version);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 5, wireType 2 =*/42).string(message.description);
                            if (message.inputTokenLimit != null && Object.hasOwnProperty.call(message, "inputTokenLimit"))
                                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.inputTokenLimit);
                            if (message.outputTokenLimit != null && Object.hasOwnProperty.call(message, "outputTokenLimit"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.outputTokenLimit);
                            if (message.supportedGenerationMethods != null && message.supportedGenerationMethods.length)
                                for (var i = 0; i < message.supportedGenerationMethods.length; ++i)
                                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.supportedGenerationMethods[i]);
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 9, wireType 5 =*/77).float(message.temperature);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 10, wireType 5 =*/85).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 11, wireType 0 =*/88).int32(message.topK);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Model message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Model.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IModel} message Model message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Model.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Model message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.Model} Model
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Model.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Model();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.baseModelId = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.version = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 5: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.inputTokenLimit = reader.int32();
                                        break;
                                    }
                                case 7: {
                                        message.outputTokenLimit = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        if (!(message.supportedGenerationMethods && message.supportedGenerationMethods.length))
                                            message.supportedGenerationMethods = [];
                                        message.supportedGenerationMethods.push(reader.string());
                                        break;
                                    }
                                case 9: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 10: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 11: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Model message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.Model} Model
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Model.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Model message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Model.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.baseModelId != null && message.hasOwnProperty("baseModelId"))
                                if (!$util.isString(message.baseModelId))
                                    return "baseModelId: string expected";
                            if (message.version != null && message.hasOwnProperty("version"))
                                if (!$util.isString(message.version))
                                    return "version: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit"))
                                if (!$util.isInteger(message.inputTokenLimit))
                                    return "inputTokenLimit: integer expected";
                            if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit"))
                                if (!$util.isInteger(message.outputTokenLimit))
                                    return "outputTokenLimit: integer expected";
                            if (message.supportedGenerationMethods != null && message.hasOwnProperty("supportedGenerationMethods")) {
                                if (!Array.isArray(message.supportedGenerationMethods))
                                    return "supportedGenerationMethods: array expected";
                                for (var i = 0; i < message.supportedGenerationMethods.length; ++i)
                                    if (!$util.isString(message.supportedGenerationMethods[i]))
                                        return "supportedGenerationMethods: string[] expected";
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Model message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.Model} Model
                         */
                        Model.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.Model)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.Model();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.baseModelId != null)
                                message.baseModelId = String(object.baseModelId);
                            if (object.version != null)
                                message.version = String(object.version);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.inputTokenLimit != null)
                                message.inputTokenLimit = object.inputTokenLimit | 0;
                            if (object.outputTokenLimit != null)
                                message.outputTokenLimit = object.outputTokenLimit | 0;
                            if (object.supportedGenerationMethods) {
                                if (!Array.isArray(object.supportedGenerationMethods))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.Model.supportedGenerationMethods: array expected");
                                message.supportedGenerationMethods = [];
                                for (var i = 0; i < object.supportedGenerationMethods.length; ++i)
                                    message.supportedGenerationMethods[i] = String(object.supportedGenerationMethods[i]);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Model message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.Model} message Model
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Model.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.supportedGenerationMethods = [];
                            if (options.defaults) {
                                object.name = "";
                                object.baseModelId = "";
                                object.version = "";
                                object.displayName = "";
                                object.description = "";
                                object.inputTokenLimit = 0;
                                object.outputTokenLimit = 0;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.baseModelId != null && message.hasOwnProperty("baseModelId"))
                                object.baseModelId = message.baseModelId;
                            if (message.version != null && message.hasOwnProperty("version"))
                                object.version = message.version;
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit"))
                                object.inputTokenLimit = message.inputTokenLimit;
                            if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit"))
                                object.outputTokenLimit = message.outputTokenLimit;
                            if (message.supportedGenerationMethods && message.supportedGenerationMethods.length) {
                                object.supportedGenerationMethods = [];
                                for (var j = 0; j < message.supportedGenerationMethods.length; ++j)
                                    object.supportedGenerationMethods[j] = message.supportedGenerationMethods[j];
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Model to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Model.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Model
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.Model
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Model";
                        };
    
                        return Model;
                    })();
    
                    v1beta3.ModelService = (function() {
    
                        /**
                         * Constructs a new ModelService service.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a ModelService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function ModelService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (ModelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ModelService;
    
                        /**
                         * Creates new ModelService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {ModelService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        ModelService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|getModel}.
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @typedef GetModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.Model} [response] Model
                         */
    
                        /**
                         * Calls GetModel.
                         * @function getModel
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest} request GetModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.ModelService.GetModelCallback} callback Node-style callback called with the error, if any, and Model
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.getModel = function getModel(request, callback) {
                            return this.rpcCall(getModel, $root.google.ai.generativelanguage.v1beta3.GetModelRequest, $root.google.ai.generativelanguage.v1beta3.Model, request, callback);
                        }, "name", { value: "GetModel" });
    
                        /**
                         * Calls GetModel.
                         * @function getModel
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest} request GetModelRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.Model>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|listModels}.
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @typedef ListModelsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.ListModelsResponse} [response] ListModelsResponse
                         */
    
                        /**
                         * Calls ListModels.
                         * @function listModels
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest} request ListModelsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.ModelService.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.listModels = function listModels(request, callback) {
                            return this.rpcCall(listModels, $root.google.ai.generativelanguage.v1beta3.ListModelsRequest, $root.google.ai.generativelanguage.v1beta3.ListModelsResponse, request, callback);
                        }, "name", { value: "ListModels" });
    
                        /**
                         * Calls ListModels.
                         * @function listModels
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest} request ListModelsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.ListModelsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|getTunedModel}.
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @typedef GetTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.TunedModel} [response] TunedModel
                         */
    
                        /**
                         * Calls GetTunedModel.
                         * @function getTunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest} request GetTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.ModelService.GetTunedModelCallback} callback Node-style callback called with the error, if any, and TunedModel
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.getTunedModel = function getTunedModel(request, callback) {
                            return this.rpcCall(getTunedModel, $root.google.ai.generativelanguage.v1beta3.GetTunedModelRequest, $root.google.ai.generativelanguage.v1beta3.TunedModel, request, callback);
                        }, "name", { value: "GetTunedModel" });
    
                        /**
                         * Calls GetTunedModel.
                         * @function getTunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest} request GetTunedModelRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.TunedModel>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|listTunedModels}.
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @typedef ListTunedModelsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} [response] ListTunedModelsResponse
                         */
    
                        /**
                         * Calls ListTunedModels.
                         * @function listTunedModels
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest} request ListTunedModelsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.ModelService.ListTunedModelsCallback} callback Node-style callback called with the error, if any, and ListTunedModelsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.listTunedModels = function listTunedModels(request, callback) {
                            return this.rpcCall(listTunedModels, $root.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest, $root.google.ai.generativelanguage.v1beta3.ListTunedModelsResponse, request, callback);
                        }, "name", { value: "ListTunedModels" });
    
                        /**
                         * Calls ListTunedModels.
                         * @function listTunedModels
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest} request ListTunedModelsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.ListTunedModelsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|createTunedModel}.
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @typedef CreateTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.longrunning.Operation} [response] Operation
                         */
    
                        /**
                         * Calls CreateTunedModel.
                         * @function createTunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest} request CreateTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.ModelService.CreateTunedModelCallback} callback Node-style callback called with the error, if any, and Operation
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.createTunedModel = function createTunedModel(request, callback) {
                            return this.rpcCall(createTunedModel, $root.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest, $root.google.longrunning.Operation, request, callback);
                        }, "name", { value: "CreateTunedModel" });
    
                        /**
                         * Calls CreateTunedModel.
                         * @function createTunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest} request CreateTunedModelRequest message or plain object
                         * @returns {Promise<google.longrunning.Operation>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|updateTunedModel}.
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @typedef UpdateTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.TunedModel} [response] TunedModel
                         */
    
                        /**
                         * Calls UpdateTunedModel.
                         * @function updateTunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest} request UpdateTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.ModelService.UpdateTunedModelCallback} callback Node-style callback called with the error, if any, and TunedModel
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.updateTunedModel = function updateTunedModel(request, callback) {
                            return this.rpcCall(updateTunedModel, $root.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest, $root.google.ai.generativelanguage.v1beta3.TunedModel, request, callback);
                        }, "name", { value: "UpdateTunedModel" });
    
                        /**
                         * Calls UpdateTunedModel.
                         * @function updateTunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest} request UpdateTunedModelRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.TunedModel>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|deleteTunedModel}.
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @typedef DeleteTunedModelCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeleteTunedModel.
                         * @function deleteTunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest} request DeleteTunedModelRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.ModelService.DeleteTunedModelCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(ModelService.prototype.deleteTunedModel = function deleteTunedModel(request, callback) {
                            return this.rpcCall(deleteTunedModel, $root.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeleteTunedModel" });
    
                        /**
                         * Calls DeleteTunedModel.
                         * @function deleteTunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.ModelService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest} request DeleteTunedModelRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        return ModelService;
                    })();
    
                    v1beta3.GetModelRequest = (function() {
    
                        /**
                         * Properties of a GetModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IGetModelRequest
                         * @property {string|null} [name] GetModelRequest name
                         */
    
                        /**
                         * Constructs a new GetModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a GetModelRequest.
                         * @implements IGetModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest=} [properties] Properties to set
                         */
                        function GetModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetModelRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest
                         * @instance
                         */
                        GetModelRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.GetModelRequest} GetModelRequest instance
                         */
                        GetModelRequest.create = function create(properties) {
                            return new GetModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest} message GetModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest} message GetModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.GetModelRequest} GetModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GetModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.GetModelRequest} GetModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.GetModelRequest} GetModelRequest
                         */
                        GetModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.GetModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.GetModelRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.GetModelRequest} message GetModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GetModelRequest";
                        };
    
                        return GetModelRequest;
                    })();
    
                    v1beta3.ListModelsRequest = (function() {
    
                        /**
                         * Properties of a ListModelsRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IListModelsRequest
                         * @property {number|null} [pageSize] ListModelsRequest pageSize
                         * @property {string|null} [pageToken] ListModelsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListModelsRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a ListModelsRequest.
                         * @implements IListModelsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest=} [properties] Properties to set
                         */
                        function ListModelsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListModelsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @instance
                         */
                        ListModelsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListModelsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @instance
                         */
                        ListModelsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListModelsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.ListModelsRequest} ListModelsRequest instance
                         */
                        ListModelsRequest.create = function create(properties) {
                            return new ListModelsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest} message ListModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest} message ListModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListModelsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.ListModelsRequest} ListModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListModelsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.ListModelsRequest} ListModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListModelsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListModelsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.ListModelsRequest} ListModelsRequest
                         */
                        ListModelsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListModelsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.ListModelsRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ListModelsRequest} message ListModelsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListModelsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListModelsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListModelsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListModelsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListModelsRequest";
                        };
    
                        return ListModelsRequest;
                    })();
    
                    v1beta3.ListModelsResponse = (function() {
    
                        /**
                         * Properties of a ListModelsResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IListModelsResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta3.IModel>|null} [models] ListModelsResponse models
                         * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListModelsResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a ListModelsResponse.
                         * @implements IListModelsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IListModelsResponse=} [properties] Properties to set
                         */
                        function ListModelsResponse(properties) {
                            this.models = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListModelsResponse models.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.IModel>} models
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @instance
                         */
                        ListModelsResponse.prototype.models = $util.emptyArray;
    
                        /**
                         * ListModelsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @instance
                         */
                        ListModelsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListModelsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListModelsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.ListModelsResponse} ListModelsResponse instance
                         */
                        ListModelsResponse.create = function create(properties) {
                            return new ListModelsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListModelsResponse} message ListModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.models != null && message.models.length)
                                for (var i = 0; i < message.models.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.Model.encode(message.models[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListModelsResponse} message ListModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListModelsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.ListModelsResponse} ListModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListModelsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.models && message.models.length))
                                            message.models = [];
                                        message.models.push($root.google.ai.generativelanguage.v1beta3.Model.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.ListModelsResponse} ListModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListModelsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListModelsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListModelsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.models != null && message.hasOwnProperty("models")) {
                                if (!Array.isArray(message.models))
                                    return "models: array expected";
                                for (var i = 0; i < message.models.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.Model.verify(message.models[i]);
                                    if (error)
                                        return "models." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.ListModelsResponse} ListModelsResponse
                         */
                        ListModelsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListModelsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.ListModelsResponse();
                            if (object.models) {
                                if (!Array.isArray(object.models))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.ListModelsResponse.models: array expected");
                                message.models = [];
                                for (var i = 0; i < object.models.length; ++i) {
                                    if (typeof object.models[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.ListModelsResponse.models: object expected");
                                    message.models[i] = $root.google.ai.generativelanguage.v1beta3.Model.fromObject(object.models[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ListModelsResponse} message ListModelsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListModelsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.models = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.models && message.models.length) {
                                object.models = [];
                                for (var j = 0; j < message.models.length; ++j)
                                    object.models[j] = $root.google.ai.generativelanguage.v1beta3.Model.toObject(message.models[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListModelsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListModelsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListModelsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListModelsResponse";
                        };
    
                        return ListModelsResponse;
                    })();
    
                    v1beta3.GetTunedModelRequest = (function() {
    
                        /**
                         * Properties of a GetTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IGetTunedModelRequest
                         * @property {string|null} [name] GetTunedModelRequest name
                         */
    
                        /**
                         * Constructs a new GetTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a GetTunedModelRequest.
                         * @implements IGetTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest=} [properties] Properties to set
                         */
                        function GetTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetTunedModelRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest
                         * @instance
                         */
                        GetTunedModelRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.GetTunedModelRequest} GetTunedModelRequest instance
                         */
                        GetTunedModelRequest.create = function create(properties) {
                            return new GetTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest} message GetTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest} message GetTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.GetTunedModelRequest} GetTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GetTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.GetTunedModelRequest} GetTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.GetTunedModelRequest} GetTunedModelRequest
                         */
                        GetTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.GetTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.GetTunedModelRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.GetTunedModelRequest} message GetTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GetTunedModelRequest";
                        };
    
                        return GetTunedModelRequest;
                    })();
    
                    v1beta3.ListTunedModelsRequest = (function() {
    
                        /**
                         * Properties of a ListTunedModelsRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IListTunedModelsRequest
                         * @property {number|null} [pageSize] ListTunedModelsRequest pageSize
                         * @property {string|null} [pageToken] ListTunedModelsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListTunedModelsRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a ListTunedModelsRequest.
                         * @implements IListTunedModelsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest=} [properties] Properties to set
                         */
                        function ListTunedModelsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListTunedModelsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @instance
                         */
                        ListTunedModelsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListTunedModelsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @instance
                         */
                        ListTunedModelsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListTunedModelsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsRequest} ListTunedModelsRequest instance
                         */
                        ListTunedModelsRequest.create = function create(properties) {
                            return new ListTunedModelsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest} message ListTunedModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest} message ListTunedModelsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListTunedModelsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsRequest} ListTunedModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListTunedModelsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsRequest} ListTunedModelsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListTunedModelsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListTunedModelsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListTunedModelsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsRequest} ListTunedModelsRequest
                         */
                        ListTunedModelsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest();
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListTunedModelsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ListTunedModelsRequest} message ListTunedModelsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListTunedModelsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListTunedModelsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListTunedModelsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListTunedModelsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListTunedModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListTunedModelsRequest";
                        };
    
                        return ListTunedModelsRequest;
                    })();
    
                    v1beta3.ListTunedModelsResponse = (function() {
    
                        /**
                         * Properties of a ListTunedModelsResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IListTunedModelsResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta3.ITunedModel>|null} [tunedModels] ListTunedModelsResponse tunedModels
                         * @property {string|null} [nextPageToken] ListTunedModelsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListTunedModelsResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a ListTunedModelsResponse.
                         * @implements IListTunedModelsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsResponse=} [properties] Properties to set
                         */
                        function ListTunedModelsResponse(properties) {
                            this.tunedModels = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListTunedModelsResponse tunedModels.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.ITunedModel>} tunedModels
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @instance
                         */
                        ListTunedModelsResponse.prototype.tunedModels = $util.emptyArray;
    
                        /**
                         * ListTunedModelsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @instance
                         */
                        ListTunedModelsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListTunedModelsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} ListTunedModelsResponse instance
                         */
                        ListTunedModelsResponse.create = function create(properties) {
                            return new ListTunedModelsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsResponse} message ListTunedModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModels != null && message.tunedModels.length)
                                for (var i = 0; i < message.tunedModels.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.TunedModel.encode(message.tunedModels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListTunedModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsResponse} message ListTunedModelsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListTunedModelsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListTunedModelsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} ListTunedModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListTunedModelsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.tunedModels && message.tunedModels.length))
                                            message.tunedModels = [];
                                        message.tunedModels.push($root.google.ai.generativelanguage.v1beta3.TunedModel.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListTunedModelsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} ListTunedModelsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListTunedModelsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListTunedModelsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListTunedModelsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModels != null && message.hasOwnProperty("tunedModels")) {
                                if (!Array.isArray(message.tunedModels))
                                    return "tunedModels: array expected";
                                for (var i = 0; i < message.tunedModels.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.TunedModel.verify(message.tunedModels[i]);
                                    if (error)
                                        return "tunedModels." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListTunedModelsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} ListTunedModelsResponse
                         */
                        ListTunedModelsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListTunedModelsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.ListTunedModelsResponse();
                            if (object.tunedModels) {
                                if (!Array.isArray(object.tunedModels))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.ListTunedModelsResponse.tunedModels: array expected");
                                message.tunedModels = [];
                                for (var i = 0; i < object.tunedModels.length; ++i) {
                                    if (typeof object.tunedModels[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.ListTunedModelsResponse.tunedModels: object expected");
                                    message.tunedModels[i] = $root.google.ai.generativelanguage.v1beta3.TunedModel.fromObject(object.tunedModels[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListTunedModelsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} message ListTunedModelsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListTunedModelsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.tunedModels = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.tunedModels && message.tunedModels.length) {
                                object.tunedModels = [];
                                for (var j = 0; j < message.tunedModels.length; ++j)
                                    object.tunedModels[j] = $root.google.ai.generativelanguage.v1beta3.TunedModel.toObject(message.tunedModels[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListTunedModelsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListTunedModelsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListTunedModelsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListTunedModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListTunedModelsResponse";
                        };
    
                        return ListTunedModelsResponse;
                    })();
    
                    v1beta3.CreateTunedModelRequest = (function() {
    
                        /**
                         * Properties of a CreateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ICreateTunedModelRequest
                         * @property {string|null} [tunedModelId] CreateTunedModelRequest tunedModelId
                         * @property {google.ai.generativelanguage.v1beta3.ITunedModel|null} [tunedModel] CreateTunedModelRequest tunedModel
                         */
    
                        /**
                         * Constructs a new CreateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a CreateTunedModelRequest.
                         * @implements ICreateTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest=} [properties] Properties to set
                         */
                        function CreateTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateTunedModelRequest tunedModelId.
                         * @member {string|null|undefined} tunedModelId
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @instance
                         */
                        CreateTunedModelRequest.prototype.tunedModelId = null;
    
                        /**
                         * CreateTunedModelRequest tunedModel.
                         * @member {google.ai.generativelanguage.v1beta3.ITunedModel|null|undefined} tunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @instance
                         */
                        CreateTunedModelRequest.prototype.tunedModel = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * CreateTunedModelRequest _tunedModelId.
                         * @member {"tunedModelId"|undefined} _tunedModelId
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @instance
                         */
                        Object.defineProperty(CreateTunedModelRequest.prototype, "_tunedModelId", {
                            get: $util.oneOfGetter($oneOfFields = ["tunedModelId"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new CreateTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelRequest} CreateTunedModelRequest instance
                         */
                        CreateTunedModelRequest.create = function create(properties) {
                            return new CreateTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest} message CreateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModelId != null && Object.hasOwnProperty.call(message, "tunedModelId"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModelId);
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                $root.google.ai.generativelanguage.v1beta3.TunedModel.encode(message.tunedModel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest} message CreateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelRequest} CreateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tunedModelId = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelRequest} CreateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.tunedModelId != null && message.hasOwnProperty("tunedModelId")) {
                                properties._tunedModelId = 1;
                                if (!$util.isString(message.tunedModelId))
                                    return "tunedModelId: string expected";
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.TunedModel.verify(message.tunedModel);
                                if (error)
                                    return "tunedModel." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelRequest} CreateTunedModelRequest
                         */
                        CreateTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest();
                            if (object.tunedModelId != null)
                                message.tunedModelId = String(object.tunedModelId);
                            if (object.tunedModel != null) {
                                if (typeof object.tunedModel !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.CreateTunedModelRequest.tunedModel: object expected");
                                message.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.fromObject(object.tunedModel);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.CreateTunedModelRequest} message CreateTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.tunedModel = null;
                            if (message.tunedModelId != null && message.hasOwnProperty("tunedModelId")) {
                                object.tunedModelId = message.tunedModelId;
                                if (options.oneofs)
                                    object._tunedModelId = "tunedModelId";
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.toObject(message.tunedModel, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreateTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CreateTunedModelRequest";
                        };
    
                        return CreateTunedModelRequest;
                    })();
    
                    v1beta3.CreateTunedModelMetadata = (function() {
    
                        /**
                         * Properties of a CreateTunedModelMetadata.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ICreateTunedModelMetadata
                         * @property {string|null} [tunedModel] CreateTunedModelMetadata tunedModel
                         * @property {number|null} [totalSteps] CreateTunedModelMetadata totalSteps
                         * @property {number|null} [completedSteps] CreateTunedModelMetadata completedSteps
                         * @property {number|null} [completedPercent] CreateTunedModelMetadata completedPercent
                         * @property {Array.<google.ai.generativelanguage.v1beta3.ITuningSnapshot>|null} [snapshots] CreateTunedModelMetadata snapshots
                         */
    
                        /**
                         * Constructs a new CreateTunedModelMetadata.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a CreateTunedModelMetadata.
                         * @implements ICreateTunedModelMetadata
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata=} [properties] Properties to set
                         */
                        function CreateTunedModelMetadata(properties) {
                            this.snapshots = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreateTunedModelMetadata tunedModel.
                         * @member {string} tunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.tunedModel = "";
    
                        /**
                         * CreateTunedModelMetadata totalSteps.
                         * @member {number} totalSteps
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.totalSteps = 0;
    
                        /**
                         * CreateTunedModelMetadata completedSteps.
                         * @member {number} completedSteps
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.completedSteps = 0;
    
                        /**
                         * CreateTunedModelMetadata completedPercent.
                         * @member {number} completedPercent
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.completedPercent = 0;
    
                        /**
                         * CreateTunedModelMetadata snapshots.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.ITuningSnapshot>} snapshots
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @instance
                         */
                        CreateTunedModelMetadata.prototype.snapshots = $util.emptyArray;
    
                        /**
                         * Creates a new CreateTunedModelMetadata instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata} CreateTunedModelMetadata instance
                         */
                        CreateTunedModelMetadata.create = function create(properties) {
                            return new CreateTunedModelMetadata(properties);
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata} message CreateTunedModelMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelMetadata.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.totalSteps != null && Object.hasOwnProperty.call(message, "totalSteps"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalSteps);
                            if (message.completedSteps != null && Object.hasOwnProperty.call(message, "completedSteps"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.completedSteps);
                            if (message.completedPercent != null && Object.hasOwnProperty.call(message, "completedPercent"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.completedPercent);
                            if (message.snapshots != null && message.snapshots.length)
                                for (var i = 0; i < message.snapshots.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.encode(message.snapshots[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                writer.uint32(/* id 5, wireType 2 =*/42).string(message.tunedModel);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreateTunedModelMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata} message CreateTunedModelMetadata message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreateTunedModelMetadata.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreateTunedModelMetadata message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata} CreateTunedModelMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelMetadata.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 5: {
                                        message.tunedModel = reader.string();
                                        break;
                                    }
                                case 1: {
                                        message.totalSteps = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.completedSteps = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.completedPercent = reader.float();
                                        break;
                                    }
                                case 4: {
                                        if (!(message.snapshots && message.snapshots.length))
                                            message.snapshots = [];
                                        message.snapshots.push($root.google.ai.generativelanguage.v1beta3.TuningSnapshot.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreateTunedModelMetadata message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata} CreateTunedModelMetadata
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreateTunedModelMetadata.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreateTunedModelMetadata message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreateTunedModelMetadata.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                if (!$util.isString(message.tunedModel))
                                    return "tunedModel: string expected";
                            if (message.totalSteps != null && message.hasOwnProperty("totalSteps"))
                                if (!$util.isInteger(message.totalSteps))
                                    return "totalSteps: integer expected";
                            if (message.completedSteps != null && message.hasOwnProperty("completedSteps"))
                                if (!$util.isInteger(message.completedSteps))
                                    return "completedSteps: integer expected";
                            if (message.completedPercent != null && message.hasOwnProperty("completedPercent"))
                                if (typeof message.completedPercent !== "number")
                                    return "completedPercent: number expected";
                            if (message.snapshots != null && message.hasOwnProperty("snapshots")) {
                                if (!Array.isArray(message.snapshots))
                                    return "snapshots: array expected";
                                for (var i = 0; i < message.snapshots.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.verify(message.snapshots[i]);
                                    if (error)
                                        return "snapshots." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreateTunedModelMetadata message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata} CreateTunedModelMetadata
                         */
                        CreateTunedModelMetadata.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata();
                            if (object.tunedModel != null)
                                message.tunedModel = String(object.tunedModel);
                            if (object.totalSteps != null)
                                message.totalSteps = object.totalSteps | 0;
                            if (object.completedSteps != null)
                                message.completedSteps = object.completedSteps | 0;
                            if (object.completedPercent != null)
                                message.completedPercent = Number(object.completedPercent);
                            if (object.snapshots) {
                                if (!Array.isArray(object.snapshots))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata.snapshots: array expected");
                                message.snapshots = [];
                                for (var i = 0; i < object.snapshots.length; ++i) {
                                    if (typeof object.snapshots[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata.snapshots: object expected");
                                    message.snapshots[i] = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.fromObject(object.snapshots[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreateTunedModelMetadata message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata} message CreateTunedModelMetadata
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreateTunedModelMetadata.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.snapshots = [];
                            if (options.defaults) {
                                object.totalSteps = 0;
                                object.completedSteps = 0;
                                object.completedPercent = 0;
                                object.tunedModel = "";
                            }
                            if (message.totalSteps != null && message.hasOwnProperty("totalSteps"))
                                object.totalSteps = message.totalSteps;
                            if (message.completedSteps != null && message.hasOwnProperty("completedSteps"))
                                object.completedSteps = message.completedSteps;
                            if (message.completedPercent != null && message.hasOwnProperty("completedPercent"))
                                object.completedPercent = options.json && !isFinite(message.completedPercent) ? String(message.completedPercent) : message.completedPercent;
                            if (message.snapshots && message.snapshots.length) {
                                object.snapshots = [];
                                for (var j = 0; j < message.snapshots.length; ++j)
                                    object.snapshots[j] = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.toObject(message.snapshots[j], options);
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = message.tunedModel;
                            return object;
                        };
    
                        /**
                         * Converts this CreateTunedModelMetadata to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreateTunedModelMetadata.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreateTunedModelMetadata
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreateTunedModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata";
                        };
    
                        return CreateTunedModelMetadata;
                    })();
    
                    v1beta3.UpdateTunedModelRequest = (function() {
    
                        /**
                         * Properties of an UpdateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IUpdateTunedModelRequest
                         * @property {google.ai.generativelanguage.v1beta3.ITunedModel|null} [tunedModel] UpdateTunedModelRequest tunedModel
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTunedModelRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdateTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents an UpdateTunedModelRequest.
                         * @implements IUpdateTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest=} [properties] Properties to set
                         */
                        function UpdateTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdateTunedModelRequest tunedModel.
                         * @member {google.ai.generativelanguage.v1beta3.ITunedModel|null|undefined} tunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @instance
                         */
                        UpdateTunedModelRequest.prototype.tunedModel = null;
    
                        /**
                         * UpdateTunedModelRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @instance
                         */
                        UpdateTunedModelRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdateTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest} UpdateTunedModelRequest instance
                         */
                        UpdateTunedModelRequest.create = function create(properties) {
                            return new UpdateTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest} message UpdateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                $root.google.ai.generativelanguage.v1beta3.TunedModel.encode(message.tunedModel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest} message UpdateTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdateTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdateTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest} UpdateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdateTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest} UpdateTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdateTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdateTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdateTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.TunedModel.verify(message.tunedModel);
                                if (error)
                                    return "tunedModel." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdateTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest} UpdateTunedModelRequest
                         */
                        UpdateTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest();
                            if (object.tunedModel != null) {
                                if (typeof object.tunedModel !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.tunedModel: object expected");
                                message.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.fromObject(object.tunedModel);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdateTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest} message UpdateTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdateTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.tunedModel = null;
                                object.updateMask = null;
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.toObject(message.tunedModel, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdateTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdateTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdateTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdateTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest";
                        };
    
                        return UpdateTunedModelRequest;
                    })();
    
                    v1beta3.DeleteTunedModelRequest = (function() {
    
                        /**
                         * Properties of a DeleteTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IDeleteTunedModelRequest
                         * @property {string|null} [name] DeleteTunedModelRequest name
                         */
    
                        /**
                         * Constructs a new DeleteTunedModelRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a DeleteTunedModelRequest.
                         * @implements IDeleteTunedModelRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest=} [properties] Properties to set
                         */
                        function DeleteTunedModelRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeleteTunedModelRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest
                         * @instance
                         */
                        DeleteTunedModelRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeleteTunedModelRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest} DeleteTunedModelRequest instance
                         */
                        DeleteTunedModelRequest.create = function create(properties) {
                            return new DeleteTunedModelRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeleteTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest} message DeleteTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteTunedModelRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeleteTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest} message DeleteTunedModelRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeleteTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeleteTunedModelRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest} DeleteTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteTunedModelRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeleteTunedModelRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest} DeleteTunedModelRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeleteTunedModelRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeleteTunedModelRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeleteTunedModelRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeleteTunedModelRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest} DeleteTunedModelRequest
                         */
                        DeleteTunedModelRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeleteTunedModelRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest} message DeleteTunedModelRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeleteTunedModelRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeleteTunedModelRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeleteTunedModelRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeleteTunedModelRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeleteTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest";
                        };
    
                        return DeleteTunedModelRequest;
                    })();
    
                    v1beta3.TunedModel = (function() {
    
                        /**
                         * Properties of a TunedModel.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ITunedModel
                         * @property {google.ai.generativelanguage.v1beta3.ITunedModelSource|null} [tunedModelSource] TunedModel tunedModelSource
                         * @property {string|null} [baseModel] TunedModel baseModel
                         * @property {string|null} [name] TunedModel name
                         * @property {string|null} [displayName] TunedModel displayName
                         * @property {string|null} [description] TunedModel description
                         * @property {number|null} [temperature] TunedModel temperature
                         * @property {number|null} [topP] TunedModel topP
                         * @property {number|null} [topK] TunedModel topK
                         * @property {google.ai.generativelanguage.v1beta3.TunedModel.State|null} [state] TunedModel state
                         * @property {google.protobuf.ITimestamp|null} [createTime] TunedModel createTime
                         * @property {google.protobuf.ITimestamp|null} [updateTime] TunedModel updateTime
                         * @property {google.ai.generativelanguage.v1beta3.ITuningTask|null} [tuningTask] TunedModel tuningTask
                         */
    
                        /**
                         * Constructs a new TunedModel.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a TunedModel.
                         * @implements ITunedModel
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ITunedModel=} [properties] Properties to set
                         */
                        function TunedModel(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TunedModel tunedModelSource.
                         * @member {google.ai.generativelanguage.v1beta3.ITunedModelSource|null|undefined} tunedModelSource
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.tunedModelSource = null;
    
                        /**
                         * TunedModel baseModel.
                         * @member {string|null|undefined} baseModel
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.baseModel = null;
    
                        /**
                         * TunedModel name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.name = "";
    
                        /**
                         * TunedModel displayName.
                         * @member {string} displayName
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.displayName = "";
    
                        /**
                         * TunedModel description.
                         * @member {string} description
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.description = "";
    
                        /**
                         * TunedModel temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.temperature = null;
    
                        /**
                         * TunedModel topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.topP = null;
    
                        /**
                         * TunedModel topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.topK = null;
    
                        /**
                         * TunedModel state.
                         * @member {google.ai.generativelanguage.v1beta3.TunedModel.State} state
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.state = 0;
    
                        /**
                         * TunedModel createTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} createTime
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.createTime = null;
    
                        /**
                         * TunedModel updateTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} updateTime
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.updateTime = null;
    
                        /**
                         * TunedModel tuningTask.
                         * @member {google.ai.generativelanguage.v1beta3.ITuningTask|null|undefined} tuningTask
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        TunedModel.prototype.tuningTask = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TunedModel sourceModel.
                         * @member {"tunedModelSource"|"baseModel"|undefined} sourceModel
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "sourceModel", {
                            get: $util.oneOfGetter($oneOfFields = ["tunedModelSource", "baseModel"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * TunedModel _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * TunedModel _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * TunedModel _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         */
                        Object.defineProperty(TunedModel.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TunedModel instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITunedModel=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.TunedModel} TunedModel instance
                         */
                        TunedModel.create = function create(properties) {
                            return new TunedModel(properties);
                        };
    
                        /**
                         * Encodes the specified TunedModel message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModel.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITunedModel} message TunedModel message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModel.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.tunedModelSource != null && Object.hasOwnProperty.call(message, "tunedModelSource"))
                                $root.google.ai.generativelanguage.v1beta3.TunedModelSource.encode(message.tunedModelSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel"))
                                writer.uint32(/* id 4, wireType 2 =*/34).string(message.baseModel);
                            if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
                                writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName);
                            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                                writer.uint32(/* id 6, wireType 2 =*/50).string(message.description);
                            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state);
                            if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
                                $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
                                $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                            if (message.tuningTask != null && Object.hasOwnProperty.call(message, "tuningTask"))
                                $root.google.ai.generativelanguage.v1beta3.TuningTask.encode(message.tuningTask, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 11, wireType 5 =*/93).float(message.temperature);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 12, wireType 5 =*/101).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 13, wireType 0 =*/104).int32(message.topK);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TunedModel message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModel.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITunedModel} message TunedModel message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModel.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TunedModel message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.TunedModel} TunedModel
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModel.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TunedModel();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 3: {
                                        message.tunedModelSource = $root.google.ai.generativelanguage.v1beta3.TunedModelSource.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 4: {
                                        message.baseModel = reader.string();
                                        break;
                                    }
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 5: {
                                        message.displayName = reader.string();
                                        break;
                                    }
                                case 6: {
                                        message.description = reader.string();
                                        break;
                                    }
                                case 11: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 12: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 13: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                case 7: {
                                        message.state = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 9: {
                                        message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 10: {
                                        message.tuningTask = $root.google.ai.generativelanguage.v1beta3.TuningTask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TunedModel message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.TunedModel} TunedModel
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModel.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TunedModel message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TunedModel.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.tunedModelSource != null && message.hasOwnProperty("tunedModelSource")) {
                                properties.sourceModel = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta3.TunedModelSource.verify(message.tunedModelSource);
                                    if (error)
                                        return "tunedModelSource." + error;
                                }
                            }
                            if (message.baseModel != null && message.hasOwnProperty("baseModel")) {
                                if (properties.sourceModel === 1)
                                    return "sourceModel: multiple values";
                                properties.sourceModel = 1;
                                if (!$util.isString(message.baseModel))
                                    return "baseModel: string expected";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                if (!$util.isString(message.displayName))
                                    return "displayName: string expected";
                            if (message.description != null && message.hasOwnProperty("description"))
                                if (!$util.isString(message.description))
                                    return "description: string expected";
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            if (message.state != null && message.hasOwnProperty("state"))
                                switch (message.state) {
                                default:
                                    return "state: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            if (message.createTime != null && message.hasOwnProperty("createTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.createTime);
                                if (error)
                                    return "createTime." + error;
                            }
                            if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
                                if (error)
                                    return "updateTime." + error;
                            }
                            if (message.tuningTask != null && message.hasOwnProperty("tuningTask")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.TuningTask.verify(message.tuningTask);
                                if (error)
                                    return "tuningTask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TunedModel message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.TunedModel} TunedModel
                         */
                        TunedModel.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.TunedModel)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.TunedModel();
                            if (object.tunedModelSource != null) {
                                if (typeof object.tunedModelSource !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.tunedModelSource: object expected");
                                message.tunedModelSource = $root.google.ai.generativelanguage.v1beta3.TunedModelSource.fromObject(object.tunedModelSource);
                            }
                            if (object.baseModel != null)
                                message.baseModel = String(object.baseModel);
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.displayName != null)
                                message.displayName = String(object.displayName);
                            if (object.description != null)
                                message.description = String(object.description);
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            switch (object.state) {
                            default:
                                if (typeof object.state === "number") {
                                    message.state = object.state;
                                    break;
                                }
                                break;
                            case "STATE_UNSPECIFIED":
                            case 0:
                                message.state = 0;
                                break;
                            case "CREATING":
                            case 1:
                                message.state = 1;
                                break;
                            case "ACTIVE":
                            case 2:
                                message.state = 2;
                                break;
                            case "FAILED":
                            case 3:
                                message.state = 3;
                                break;
                            }
                            if (object.createTime != null) {
                                if (typeof object.createTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.createTime: object expected");
                                message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
                            }
                            if (object.updateTime != null) {
                                if (typeof object.updateTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.updateTime: object expected");
                                message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
                            }
                            if (object.tuningTask != null) {
                                if (typeof object.tuningTask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.tuningTask: object expected");
                                message.tuningTask = $root.google.ai.generativelanguage.v1beta3.TuningTask.fromObject(object.tuningTask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TunedModel message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.TunedModel} message TunedModel
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TunedModel.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.displayName = "";
                                object.description = "";
                                object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
                                object.createTime = null;
                                object.updateTime = null;
                                object.tuningTask = null;
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.tunedModelSource != null && message.hasOwnProperty("tunedModelSource")) {
                                object.tunedModelSource = $root.google.ai.generativelanguage.v1beta3.TunedModelSource.toObject(message.tunedModelSource, options);
                                if (options.oneofs)
                                    object.sourceModel = "tunedModelSource";
                            }
                            if (message.baseModel != null && message.hasOwnProperty("baseModel")) {
                                object.baseModel = message.baseModel;
                                if (options.oneofs)
                                    object.sourceModel = "baseModel";
                            }
                            if (message.displayName != null && message.hasOwnProperty("displayName"))
                                object.displayName = message.displayName;
                            if (message.description != null && message.hasOwnProperty("description"))
                                object.description = message.description;
                            if (message.state != null && message.hasOwnProperty("state"))
                                object.state = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.TunedModel.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1beta3.TunedModel.State[message.state] : message.state;
                            if (message.createTime != null && message.hasOwnProperty("createTime"))
                                object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
                            if (message.updateTime != null && message.hasOwnProperty("updateTime"))
                                object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
                            if (message.tuningTask != null && message.hasOwnProperty("tuningTask"))
                                object.tuningTask = $root.google.ai.generativelanguage.v1beta3.TuningTask.toObject(message.tuningTask, options);
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TunedModel to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TunedModel.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TunedModel
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModel
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TunedModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TunedModel";
                        };
    
                        /**
                         * State enum.
                         * @name google.ai.generativelanguage.v1beta3.TunedModel.State
                         * @enum {number}
                         * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value
                         * @property {number} CREATING=1 CREATING value
                         * @property {number} ACTIVE=2 ACTIVE value
                         * @property {number} FAILED=3 FAILED value
                         */
                        TunedModel.State = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "STATE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "CREATING"] = 1;
                            values[valuesById[2] = "ACTIVE"] = 2;
                            values[valuesById[3] = "FAILED"] = 3;
                            return values;
                        })();
    
                        return TunedModel;
                    })();
    
                    v1beta3.TunedModelSource = (function() {
    
                        /**
                         * Properties of a TunedModelSource.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ITunedModelSource
                         * @property {string|null} [tunedModel] TunedModelSource tunedModel
                         * @property {string|null} [baseModel] TunedModelSource baseModel
                         */
    
                        /**
                         * Constructs a new TunedModelSource.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a TunedModelSource.
                         * @implements ITunedModelSource
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ITunedModelSource=} [properties] Properties to set
                         */
                        function TunedModelSource(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TunedModelSource tunedModel.
                         * @member {string} tunedModel
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @instance
                         */
                        TunedModelSource.prototype.tunedModel = "";
    
                        /**
                         * TunedModelSource baseModel.
                         * @member {string} baseModel
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @instance
                         */
                        TunedModelSource.prototype.baseModel = "";
    
                        /**
                         * Creates a new TunedModelSource instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITunedModelSource=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.TunedModelSource} TunedModelSource instance
                         */
                        TunedModelSource.create = function create(properties) {
                            return new TunedModelSource(properties);
                        };
    
                        /**
                         * Encodes the specified TunedModelSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModelSource.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITunedModelSource} message TunedModelSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModelSource.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModel);
                            if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModel);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TunedModelSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModelSource.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITunedModelSource} message TunedModelSource message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TunedModelSource.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TunedModelSource message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.TunedModelSource} TunedModelSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModelSource.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TunedModelSource();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tunedModel = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.baseModel = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TunedModelSource message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.TunedModelSource} TunedModelSource
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TunedModelSource.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TunedModelSource message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TunedModelSource.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                if (!$util.isString(message.tunedModel))
                                    return "tunedModel: string expected";
                            if (message.baseModel != null && message.hasOwnProperty("baseModel"))
                                if (!$util.isString(message.baseModel))
                                    return "baseModel: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TunedModelSource message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.TunedModelSource} TunedModelSource
                         */
                        TunedModelSource.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.TunedModelSource)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.TunedModelSource();
                            if (object.tunedModel != null)
                                message.tunedModel = String(object.tunedModel);
                            if (object.baseModel != null)
                                message.baseModel = String(object.baseModel);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TunedModelSource message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.TunedModelSource} message TunedModelSource
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TunedModelSource.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.tunedModel = "";
                                object.baseModel = "";
                            }
                            if (message.tunedModel != null && message.hasOwnProperty("tunedModel"))
                                object.tunedModel = message.tunedModel;
                            if (message.baseModel != null && message.hasOwnProperty("baseModel"))
                                object.baseModel = message.baseModel;
                            return object;
                        };
    
                        /**
                         * Converts this TunedModelSource to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TunedModelSource.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TunedModelSource
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TunedModelSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TunedModelSource";
                        };
    
                        return TunedModelSource;
                    })();
    
                    v1beta3.TuningTask = (function() {
    
                        /**
                         * Properties of a TuningTask.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ITuningTask
                         * @property {google.protobuf.ITimestamp|null} [startTime] TuningTask startTime
                         * @property {google.protobuf.ITimestamp|null} [completeTime] TuningTask completeTime
                         * @property {Array.<google.ai.generativelanguage.v1beta3.ITuningSnapshot>|null} [snapshots] TuningTask snapshots
                         * @property {google.ai.generativelanguage.v1beta3.IDataset|null} [trainingData] TuningTask trainingData
                         * @property {google.ai.generativelanguage.v1beta3.IHyperparameters|null} [hyperparameters] TuningTask hyperparameters
                         */
    
                        /**
                         * Constructs a new TuningTask.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a TuningTask.
                         * @implements ITuningTask
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ITuningTask=} [properties] Properties to set
                         */
                        function TuningTask(properties) {
                            this.snapshots = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningTask startTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} startTime
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.startTime = null;
    
                        /**
                         * TuningTask completeTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} completeTime
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.completeTime = null;
    
                        /**
                         * TuningTask snapshots.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.ITuningSnapshot>} snapshots
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.snapshots = $util.emptyArray;
    
                        /**
                         * TuningTask trainingData.
                         * @member {google.ai.generativelanguage.v1beta3.IDataset|null|undefined} trainingData
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.trainingData = null;
    
                        /**
                         * TuningTask hyperparameters.
                         * @member {google.ai.generativelanguage.v1beta3.IHyperparameters|null|undefined} hyperparameters
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @instance
                         */
                        TuningTask.prototype.hyperparameters = null;
    
                        /**
                         * Creates a new TuningTask instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningTask=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.TuningTask} TuningTask instance
                         */
                        TuningTask.create = function create(properties) {
                            return new TuningTask(properties);
                        };
    
                        /**
                         * Encodes the specified TuningTask message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningTask.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningTask} message TuningTask message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningTask.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
                                $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime"))
                                $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.snapshots != null && message.snapshots.length)
                                for (var i = 0; i < message.snapshots.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.encode(message.snapshots[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.trainingData != null && Object.hasOwnProperty.call(message, "trainingData"))
                                $root.google.ai.generativelanguage.v1beta3.Dataset.encode(message.trainingData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            if (message.hyperparameters != null && Object.hasOwnProperty.call(message, "hyperparameters"))
                                $root.google.ai.generativelanguage.v1beta3.Hyperparameters.encode(message.hyperparameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningTask message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningTask.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningTask} message TuningTask message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningTask.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningTask message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.TuningTask} TuningTask
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningTask.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TuningTask();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        if (!(message.snapshots && message.snapshots.length))
                                            message.snapshots = [];
                                        message.snapshots.push($root.google.ai.generativelanguage.v1beta3.TuningSnapshot.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        message.trainingData = $root.google.ai.generativelanguage.v1beta3.Dataset.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 5: {
                                        message.hyperparameters = $root.google.ai.generativelanguage.v1beta3.Hyperparameters.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningTask message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.TuningTask} TuningTask
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningTask.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningTask message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningTask.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.startTime != null && message.hasOwnProperty("startTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.startTime);
                                if (error)
                                    return "startTime." + error;
                            }
                            if (message.completeTime != null && message.hasOwnProperty("completeTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.completeTime);
                                if (error)
                                    return "completeTime." + error;
                            }
                            if (message.snapshots != null && message.hasOwnProperty("snapshots")) {
                                if (!Array.isArray(message.snapshots))
                                    return "snapshots: array expected";
                                for (var i = 0; i < message.snapshots.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.verify(message.snapshots[i]);
                                    if (error)
                                        return "snapshots." + error;
                                }
                            }
                            if (message.trainingData != null && message.hasOwnProperty("trainingData")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.Dataset.verify(message.trainingData);
                                if (error)
                                    return "trainingData." + error;
                            }
                            if (message.hyperparameters != null && message.hasOwnProperty("hyperparameters")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.Hyperparameters.verify(message.hyperparameters);
                                if (error)
                                    return "hyperparameters." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TuningTask message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.TuningTask} TuningTask
                         */
                        TuningTask.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.TuningTask)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.TuningTask();
                            if (object.startTime != null) {
                                if (typeof object.startTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.startTime: object expected");
                                message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime);
                            }
                            if (object.completeTime != null) {
                                if (typeof object.completeTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.completeTime: object expected");
                                message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime);
                            }
                            if (object.snapshots) {
                                if (!Array.isArray(object.snapshots))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.snapshots: array expected");
                                message.snapshots = [];
                                for (var i = 0; i < object.snapshots.length; ++i) {
                                    if (typeof object.snapshots[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.snapshots: object expected");
                                    message.snapshots[i] = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.fromObject(object.snapshots[i]);
                                }
                            }
                            if (object.trainingData != null) {
                                if (typeof object.trainingData !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.trainingData: object expected");
                                message.trainingData = $root.google.ai.generativelanguage.v1beta3.Dataset.fromObject(object.trainingData);
                            }
                            if (object.hyperparameters != null) {
                                if (typeof object.hyperparameters !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.hyperparameters: object expected");
                                message.hyperparameters = $root.google.ai.generativelanguage.v1beta3.Hyperparameters.fromObject(object.hyperparameters);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningTask message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.TuningTask} message TuningTask
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningTask.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.snapshots = [];
                            if (options.defaults) {
                                object.startTime = null;
                                object.completeTime = null;
                                object.trainingData = null;
                                object.hyperparameters = null;
                            }
                            if (message.startTime != null && message.hasOwnProperty("startTime"))
                                object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options);
                            if (message.completeTime != null && message.hasOwnProperty("completeTime"))
                                object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options);
                            if (message.snapshots && message.snapshots.length) {
                                object.snapshots = [];
                                for (var j = 0; j < message.snapshots.length; ++j)
                                    object.snapshots[j] = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.toObject(message.snapshots[j], options);
                            }
                            if (message.trainingData != null && message.hasOwnProperty("trainingData"))
                                object.trainingData = $root.google.ai.generativelanguage.v1beta3.Dataset.toObject(message.trainingData, options);
                            if (message.hyperparameters != null && message.hasOwnProperty("hyperparameters"))
                                object.hyperparameters = $root.google.ai.generativelanguage.v1beta3.Hyperparameters.toObject(message.hyperparameters, options);
                            return object;
                        };
    
                        /**
                         * Converts this TuningTask to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningTask.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningTask
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.TuningTask
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TuningTask";
                        };
    
                        return TuningTask;
                    })();
    
                    v1beta3.Hyperparameters = (function() {
    
                        /**
                         * Properties of a Hyperparameters.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IHyperparameters
                         * @property {number|null} [epochCount] Hyperparameters epochCount
                         * @property {number|null} [batchSize] Hyperparameters batchSize
                         * @property {number|null} [learningRate] Hyperparameters learningRate
                         */
    
                        /**
                         * Constructs a new Hyperparameters.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a Hyperparameters.
                         * @implements IHyperparameters
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IHyperparameters=} [properties] Properties to set
                         */
                        function Hyperparameters(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Hyperparameters epochCount.
                         * @member {number|null|undefined} epochCount
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @instance
                         */
                        Hyperparameters.prototype.epochCount = null;
    
                        /**
                         * Hyperparameters batchSize.
                         * @member {number|null|undefined} batchSize
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @instance
                         */
                        Hyperparameters.prototype.batchSize = null;
    
                        /**
                         * Hyperparameters learningRate.
                         * @member {number|null|undefined} learningRate
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @instance
                         */
                        Hyperparameters.prototype.learningRate = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Hyperparameters _epochCount.
                         * @member {"epochCount"|undefined} _epochCount
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @instance
                         */
                        Object.defineProperty(Hyperparameters.prototype, "_epochCount", {
                            get: $util.oneOfGetter($oneOfFields = ["epochCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Hyperparameters _batchSize.
                         * @member {"batchSize"|undefined} _batchSize
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @instance
                         */
                        Object.defineProperty(Hyperparameters.prototype, "_batchSize", {
                            get: $util.oneOfGetter($oneOfFields = ["batchSize"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Hyperparameters _learningRate.
                         * @member {"learningRate"|undefined} _learningRate
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @instance
                         */
                        Object.defineProperty(Hyperparameters.prototype, "_learningRate", {
                            get: $util.oneOfGetter($oneOfFields = ["learningRate"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Hyperparameters instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IHyperparameters=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.Hyperparameters} Hyperparameters instance
                         */
                        Hyperparameters.create = function create(properties) {
                            return new Hyperparameters(properties);
                        };
    
                        /**
                         * Encodes the specified Hyperparameters message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Hyperparameters.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IHyperparameters} message Hyperparameters message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Hyperparameters.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.epochCount != null && Object.hasOwnProperty.call(message, "epochCount"))
                                writer.uint32(/* id 14, wireType 0 =*/112).int32(message.epochCount);
                            if (message.batchSize != null && Object.hasOwnProperty.call(message, "batchSize"))
                                writer.uint32(/* id 15, wireType 0 =*/120).int32(message.batchSize);
                            if (message.learningRate != null && Object.hasOwnProperty.call(message, "learningRate"))
                                writer.uint32(/* id 16, wireType 5 =*/133).float(message.learningRate);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Hyperparameters message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Hyperparameters.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IHyperparameters} message Hyperparameters message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Hyperparameters.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Hyperparameters message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.Hyperparameters} Hyperparameters
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Hyperparameters.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Hyperparameters();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 14: {
                                        message.epochCount = reader.int32();
                                        break;
                                    }
                                case 15: {
                                        message.batchSize = reader.int32();
                                        break;
                                    }
                                case 16: {
                                        message.learningRate = reader.float();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Hyperparameters message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.Hyperparameters} Hyperparameters
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Hyperparameters.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Hyperparameters message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Hyperparameters.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.epochCount != null && message.hasOwnProperty("epochCount")) {
                                properties._epochCount = 1;
                                if (!$util.isInteger(message.epochCount))
                                    return "epochCount: integer expected";
                            }
                            if (message.batchSize != null && message.hasOwnProperty("batchSize")) {
                                properties._batchSize = 1;
                                if (!$util.isInteger(message.batchSize))
                                    return "batchSize: integer expected";
                            }
                            if (message.learningRate != null && message.hasOwnProperty("learningRate")) {
                                properties._learningRate = 1;
                                if (typeof message.learningRate !== "number")
                                    return "learningRate: number expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Hyperparameters message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.Hyperparameters} Hyperparameters
                         */
                        Hyperparameters.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.Hyperparameters)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.Hyperparameters();
                            if (object.epochCount != null)
                                message.epochCount = object.epochCount | 0;
                            if (object.batchSize != null)
                                message.batchSize = object.batchSize | 0;
                            if (object.learningRate != null)
                                message.learningRate = Number(object.learningRate);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Hyperparameters message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.Hyperparameters} message Hyperparameters
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Hyperparameters.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.epochCount != null && message.hasOwnProperty("epochCount")) {
                                object.epochCount = message.epochCount;
                                if (options.oneofs)
                                    object._epochCount = "epochCount";
                            }
                            if (message.batchSize != null && message.hasOwnProperty("batchSize")) {
                                object.batchSize = message.batchSize;
                                if (options.oneofs)
                                    object._batchSize = "batchSize";
                            }
                            if (message.learningRate != null && message.hasOwnProperty("learningRate")) {
                                object.learningRate = options.json && !isFinite(message.learningRate) ? String(message.learningRate) : message.learningRate;
                                if (options.oneofs)
                                    object._learningRate = "learningRate";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Hyperparameters to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Hyperparameters.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Hyperparameters
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Hyperparameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Hyperparameters";
                        };
    
                        return Hyperparameters;
                    })();
    
                    v1beta3.Dataset = (function() {
    
                        /**
                         * Properties of a Dataset.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IDataset
                         * @property {google.ai.generativelanguage.v1beta3.ITuningExamples|null} [examples] Dataset examples
                         */
    
                        /**
                         * Constructs a new Dataset.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a Dataset.
                         * @implements IDataset
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IDataset=} [properties] Properties to set
                         */
                        function Dataset(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Dataset examples.
                         * @member {google.ai.generativelanguage.v1beta3.ITuningExamples|null|undefined} examples
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @instance
                         */
                        Dataset.prototype.examples = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Dataset dataset.
                         * @member {"examples"|undefined} dataset
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @instance
                         */
                        Object.defineProperty(Dataset.prototype, "dataset", {
                            get: $util.oneOfGetter($oneOfFields = ["examples"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Dataset instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IDataset=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.Dataset} Dataset instance
                         */
                        Dataset.create = function create(properties) {
                            return new Dataset(properties);
                        };
    
                        /**
                         * Encodes the specified Dataset message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Dataset.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IDataset} message Dataset message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Dataset.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.examples != null && Object.hasOwnProperty.call(message, "examples"))
                                $root.google.ai.generativelanguage.v1beta3.TuningExamples.encode(message.examples, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Dataset.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IDataset} message Dataset message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Dataset.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Dataset message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.Dataset} Dataset
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Dataset.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Dataset();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.examples = $root.google.ai.generativelanguage.v1beta3.TuningExamples.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Dataset message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.Dataset} Dataset
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Dataset.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Dataset message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Dataset.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                properties.dataset = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta3.TuningExamples.verify(message.examples);
                                    if (error)
                                        return "examples." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Dataset message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.Dataset} Dataset
                         */
                        Dataset.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.Dataset)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.Dataset();
                            if (object.examples != null) {
                                if (typeof object.examples !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.Dataset.examples: object expected");
                                message.examples = $root.google.ai.generativelanguage.v1beta3.TuningExamples.fromObject(object.examples);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Dataset message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.Dataset} message Dataset
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Dataset.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                object.examples = $root.google.ai.generativelanguage.v1beta3.TuningExamples.toObject(message.examples, options);
                                if (options.oneofs)
                                    object.dataset = "examples";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Dataset to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Dataset.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Dataset
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.Dataset
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Dataset";
                        };
    
                        return Dataset;
                    })();
    
                    v1beta3.TuningExamples = (function() {
    
                        /**
                         * Properties of a TuningExamples.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ITuningExamples
                         * @property {Array.<google.ai.generativelanguage.v1beta3.ITuningExample>|null} [examples] TuningExamples examples
                         */
    
                        /**
                         * Constructs a new TuningExamples.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a TuningExamples.
                         * @implements ITuningExamples
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ITuningExamples=} [properties] Properties to set
                         */
                        function TuningExamples(properties) {
                            this.examples = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningExamples examples.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.ITuningExample>} examples
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExamples
                         * @instance
                         */
                        TuningExamples.prototype.examples = $util.emptyArray;
    
                        /**
                         * Creates a new TuningExamples instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningExamples=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.TuningExamples} TuningExamples instance
                         */
                        TuningExamples.create = function create(properties) {
                            return new TuningExamples(properties);
                        };
    
                        /**
                         * Encodes the specified TuningExamples message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExamples.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningExamples} message TuningExamples message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExamples.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.examples != null && message.examples.length)
                                for (var i = 0; i < message.examples.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.TuningExample.encode(message.examples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningExamples message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExamples.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningExamples} message TuningExamples message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExamples.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningExamples message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExamples
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.TuningExamples} TuningExamples
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExamples.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TuningExamples();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.examples && message.examples.length))
                                            message.examples = [];
                                        message.examples.push($root.google.ai.generativelanguage.v1beta3.TuningExample.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningExamples message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExamples
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.TuningExamples} TuningExamples
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExamples.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningExamples message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExamples
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningExamples.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.examples != null && message.hasOwnProperty("examples")) {
                                if (!Array.isArray(message.examples))
                                    return "examples: array expected";
                                for (var i = 0; i < message.examples.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.TuningExample.verify(message.examples[i]);
                                    if (error)
                                        return "examples." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TuningExamples message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExamples
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.TuningExamples} TuningExamples
                         */
                        TuningExamples.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.TuningExamples)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.TuningExamples();
                            if (object.examples) {
                                if (!Array.isArray(object.examples))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TuningExamples.examples: array expected");
                                message.examples = [];
                                for (var i = 0; i < object.examples.length; ++i) {
                                    if (typeof object.examples[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.TuningExamples.examples: object expected");
                                    message.examples[i] = $root.google.ai.generativelanguage.v1beta3.TuningExample.fromObject(object.examples[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningExamples message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExamples
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.TuningExamples} message TuningExamples
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningExamples.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.examples = [];
                            if (message.examples && message.examples.length) {
                                object.examples = [];
                                for (var j = 0; j < message.examples.length; ++j)
                                    object.examples[j] = $root.google.ai.generativelanguage.v1beta3.TuningExample.toObject(message.examples[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TuningExamples to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExamples
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningExamples.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningExamples
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExamples
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningExamples.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TuningExamples";
                        };
    
                        return TuningExamples;
                    })();
    
                    v1beta3.TuningExample = (function() {
    
                        /**
                         * Properties of a TuningExample.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ITuningExample
                         * @property {string|null} [textInput] TuningExample textInput
                         * @property {string|null} [output] TuningExample output
                         */
    
                        /**
                         * Constructs a new TuningExample.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a TuningExample.
                         * @implements ITuningExample
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ITuningExample=} [properties] Properties to set
                         */
                        function TuningExample(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningExample textInput.
                         * @member {string|null|undefined} textInput
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @instance
                         */
                        TuningExample.prototype.textInput = null;
    
                        /**
                         * TuningExample output.
                         * @member {string} output
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @instance
                         */
                        TuningExample.prototype.output = "";
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TuningExample modelInput.
                         * @member {"textInput"|undefined} modelInput
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @instance
                         */
                        Object.defineProperty(TuningExample.prototype, "modelInput", {
                            get: $util.oneOfGetter($oneOfFields = ["textInput"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TuningExample instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningExample=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.TuningExample} TuningExample instance
                         */
                        TuningExample.create = function create(properties) {
                            return new TuningExample(properties);
                        };
    
                        /**
                         * Encodes the specified TuningExample message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExample.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningExample} message TuningExample message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExample.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.textInput != null && Object.hasOwnProperty.call(message, "textInput"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.textInput);
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.output);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningExample message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExample.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningExample} message TuningExample message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningExample.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningExample message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.TuningExample} TuningExample
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExample.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TuningExample();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.textInput = reader.string();
                                        break;
                                    }
                                case 3: {
                                        message.output = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningExample message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.TuningExample} TuningExample
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningExample.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningExample message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningExample.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.textInput != null && message.hasOwnProperty("textInput")) {
                                properties.modelInput = 1;
                                if (!$util.isString(message.textInput))
                                    return "textInput: string expected";
                            }
                            if (message.output != null && message.hasOwnProperty("output"))
                                if (!$util.isString(message.output))
                                    return "output: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TuningExample message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.TuningExample} TuningExample
                         */
                        TuningExample.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.TuningExample)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.TuningExample();
                            if (object.textInput != null)
                                message.textInput = String(object.textInput);
                            if (object.output != null)
                                message.output = String(object.output);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningExample message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.TuningExample} message TuningExample
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningExample.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.output = "";
                            if (message.textInput != null && message.hasOwnProperty("textInput")) {
                                object.textInput = message.textInput;
                                if (options.oneofs)
                                    object.modelInput = "textInput";
                            }
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = message.output;
                            return object;
                        };
    
                        /**
                         * Converts this TuningExample to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningExample.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningExample
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.TuningExample
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningExample.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TuningExample";
                        };
    
                        return TuningExample;
                    })();
    
                    v1beta3.TuningSnapshot = (function() {
    
                        /**
                         * Properties of a TuningSnapshot.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ITuningSnapshot
                         * @property {number|null} [step] TuningSnapshot step
                         * @property {number|null} [epoch] TuningSnapshot epoch
                         * @property {number|null} [meanLoss] TuningSnapshot meanLoss
                         * @property {google.protobuf.ITimestamp|null} [computeTime] TuningSnapshot computeTime
                         */
    
                        /**
                         * Constructs a new TuningSnapshot.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a TuningSnapshot.
                         * @implements ITuningSnapshot
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ITuningSnapshot=} [properties] Properties to set
                         */
                        function TuningSnapshot(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TuningSnapshot step.
                         * @member {number} step
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.step = 0;
    
                        /**
                         * TuningSnapshot epoch.
                         * @member {number} epoch
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.epoch = 0;
    
                        /**
                         * TuningSnapshot meanLoss.
                         * @member {number} meanLoss
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.meanLoss = 0;
    
                        /**
                         * TuningSnapshot computeTime.
                         * @member {google.protobuf.ITimestamp|null|undefined} computeTime
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @instance
                         */
                        TuningSnapshot.prototype.computeTime = null;
    
                        /**
                         * Creates a new TuningSnapshot instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningSnapshot=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.TuningSnapshot} TuningSnapshot instance
                         */
                        TuningSnapshot.create = function create(properties) {
                            return new TuningSnapshot(properties);
                        };
    
                        /**
                         * Encodes the specified TuningSnapshot message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningSnapshot.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningSnapshot} message TuningSnapshot message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningSnapshot.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.step != null && Object.hasOwnProperty.call(message, "step"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.step);
                            if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.epoch);
                            if (message.meanLoss != null && Object.hasOwnProperty.call(message, "meanLoss"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.meanLoss);
                            if (message.computeTime != null && Object.hasOwnProperty.call(message, "computeTime"))
                                $root.google.protobuf.Timestamp.encode(message.computeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TuningSnapshot message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningSnapshot.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITuningSnapshot} message TuningSnapshot message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TuningSnapshot.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TuningSnapshot message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.TuningSnapshot} TuningSnapshot
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningSnapshot.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TuningSnapshot();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.step = reader.int32();
                                        break;
                                    }
                                case 2: {
                                        message.epoch = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.meanLoss = reader.float();
                                        break;
                                    }
                                case 4: {
                                        message.computeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TuningSnapshot message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.TuningSnapshot} TuningSnapshot
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TuningSnapshot.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TuningSnapshot message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TuningSnapshot.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.step != null && message.hasOwnProperty("step"))
                                if (!$util.isInteger(message.step))
                                    return "step: integer expected";
                            if (message.epoch != null && message.hasOwnProperty("epoch"))
                                if (!$util.isInteger(message.epoch))
                                    return "epoch: integer expected";
                            if (message.meanLoss != null && message.hasOwnProperty("meanLoss"))
                                if (typeof message.meanLoss !== "number")
                                    return "meanLoss: number expected";
                            if (message.computeTime != null && message.hasOwnProperty("computeTime")) {
                                var error = $root.google.protobuf.Timestamp.verify(message.computeTime);
                                if (error)
                                    return "computeTime." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TuningSnapshot message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.TuningSnapshot} TuningSnapshot
                         */
                        TuningSnapshot.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.TuningSnapshot)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.TuningSnapshot();
                            if (object.step != null)
                                message.step = object.step | 0;
                            if (object.epoch != null)
                                message.epoch = object.epoch | 0;
                            if (object.meanLoss != null)
                                message.meanLoss = Number(object.meanLoss);
                            if (object.computeTime != null) {
                                if (typeof object.computeTime !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TuningSnapshot.computeTime: object expected");
                                message.computeTime = $root.google.protobuf.Timestamp.fromObject(object.computeTime);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TuningSnapshot message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.TuningSnapshot} message TuningSnapshot
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TuningSnapshot.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.step = 0;
                                object.epoch = 0;
                                object.meanLoss = 0;
                                object.computeTime = null;
                            }
                            if (message.step != null && message.hasOwnProperty("step"))
                                object.step = message.step;
                            if (message.epoch != null && message.hasOwnProperty("epoch"))
                                object.epoch = message.epoch;
                            if (message.meanLoss != null && message.hasOwnProperty("meanLoss"))
                                object.meanLoss = options.json && !isFinite(message.meanLoss) ? String(message.meanLoss) : message.meanLoss;
                            if (message.computeTime != null && message.hasOwnProperty("computeTime"))
                                object.computeTime = $root.google.protobuf.Timestamp.toObject(message.computeTime, options);
                            return object;
                        };
    
                        /**
                         * Converts this TuningSnapshot to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TuningSnapshot.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TuningSnapshot
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TuningSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TuningSnapshot";
                        };
    
                        return TuningSnapshot;
                    })();
    
                    v1beta3.Permission = (function() {
    
                        /**
                         * Properties of a Permission.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IPermission
                         * @property {string|null} [name] Permission name
                         * @property {google.ai.generativelanguage.v1beta3.Permission.GranteeType|null} [granteeType] Permission granteeType
                         * @property {string|null} [emailAddress] Permission emailAddress
                         * @property {google.ai.generativelanguage.v1beta3.Permission.Role|null} [role] Permission role
                         */
    
                        /**
                         * Constructs a new Permission.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a Permission.
                         * @implements IPermission
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IPermission=} [properties] Properties to set
                         */
                        function Permission(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Permission name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @instance
                         */
                        Permission.prototype.name = "";
    
                        /**
                         * Permission granteeType.
                         * @member {google.ai.generativelanguage.v1beta3.Permission.GranteeType|null|undefined} granteeType
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @instance
                         */
                        Permission.prototype.granteeType = null;
    
                        /**
                         * Permission emailAddress.
                         * @member {string|null|undefined} emailAddress
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @instance
                         */
                        Permission.prototype.emailAddress = null;
    
                        /**
                         * Permission role.
                         * @member {google.ai.generativelanguage.v1beta3.Permission.Role|null|undefined} role
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @instance
                         */
                        Permission.prototype.role = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * Permission _granteeType.
                         * @member {"granteeType"|undefined} _granteeType
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @instance
                         */
                        Object.defineProperty(Permission.prototype, "_granteeType", {
                            get: $util.oneOfGetter($oneOfFields = ["granteeType"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Permission _emailAddress.
                         * @member {"emailAddress"|undefined} _emailAddress
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @instance
                         */
                        Object.defineProperty(Permission.prototype, "_emailAddress", {
                            get: $util.oneOfGetter($oneOfFields = ["emailAddress"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Permission _role.
                         * @member {"role"|undefined} _role
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @instance
                         */
                        Object.defineProperty(Permission.prototype, "_role", {
                            get: $util.oneOfGetter($oneOfFields = ["role"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new Permission instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IPermission=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.Permission} Permission instance
                         */
                        Permission.create = function create(properties) {
                            return new Permission(properties);
                        };
    
                        /**
                         * Encodes the specified Permission message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Permission.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IPermission} message Permission message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Permission.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.granteeType != null && Object.hasOwnProperty.call(message, "granteeType"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.granteeType);
                            if (message.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.emailAddress);
                            if (message.role != null && Object.hasOwnProperty.call(message, "role"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.role);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Permission message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Permission.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IPermission} message Permission message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Permission.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a Permission message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.Permission} Permission
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Permission.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Permission();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.granteeType = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.emailAddress = reader.string();
                                        break;
                                    }
                                case 4: {
                                        message.role = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a Permission message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.Permission} Permission
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Permission.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a Permission message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Permission.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.granteeType != null && message.hasOwnProperty("granteeType")) {
                                properties._granteeType = 1;
                                switch (message.granteeType) {
                                default:
                                    return "granteeType: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            }
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) {
                                properties._emailAddress = 1;
                                if (!$util.isString(message.emailAddress))
                                    return "emailAddress: string expected";
                            }
                            if (message.role != null && message.hasOwnProperty("role")) {
                                properties._role = 1;
                                switch (message.role) {
                                default:
                                    return "role: enum value expected";
                                case 0:
                                case 1:
                                case 2:
                                case 3:
                                    break;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a Permission message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.Permission} Permission
                         */
                        Permission.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.Permission)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.Permission();
                            if (object.name != null)
                                message.name = String(object.name);
                            switch (object.granteeType) {
                            default:
                                if (typeof object.granteeType === "number") {
                                    message.granteeType = object.granteeType;
                                    break;
                                }
                                break;
                            case "GRANTEE_TYPE_UNSPECIFIED":
                            case 0:
                                message.granteeType = 0;
                                break;
                            case "USER":
                            case 1:
                                message.granteeType = 1;
                                break;
                            case "GROUP":
                            case 2:
                                message.granteeType = 2;
                                break;
                            case "EVERYONE":
                            case 3:
                                message.granteeType = 3;
                                break;
                            }
                            if (object.emailAddress != null)
                                message.emailAddress = String(object.emailAddress);
                            switch (object.role) {
                            default:
                                if (typeof object.role === "number") {
                                    message.role = object.role;
                                    break;
                                }
                                break;
                            case "ROLE_UNSPECIFIED":
                            case 0:
                                message.role = 0;
                                break;
                            case "OWNER":
                            case 1:
                                message.role = 1;
                                break;
                            case "WRITER":
                            case 2:
                                message.role = 2;
                                break;
                            case "READER":
                            case 3:
                                message.role = 3;
                                break;
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a Permission message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.Permission} message Permission
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Permission.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.granteeType != null && message.hasOwnProperty("granteeType")) {
                                object.granteeType = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.Permission.GranteeType[message.granteeType] === undefined ? message.granteeType : $root.google.ai.generativelanguage.v1beta3.Permission.GranteeType[message.granteeType] : message.granteeType;
                                if (options.oneofs)
                                    object._granteeType = "granteeType";
                            }
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) {
                                object.emailAddress = message.emailAddress;
                                if (options.oneofs)
                                    object._emailAddress = "emailAddress";
                            }
                            if (message.role != null && message.hasOwnProperty("role")) {
                                object.role = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.Permission.Role[message.role] === undefined ? message.role : $root.google.ai.generativelanguage.v1beta3.Permission.Role[message.role] : message.role;
                                if (options.oneofs)
                                    object._role = "role";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Permission to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Permission.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Permission
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.Permission
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Permission.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Permission";
                        };
    
                        /**
                         * GranteeType enum.
                         * @name google.ai.generativelanguage.v1beta3.Permission.GranteeType
                         * @enum {number}
                         * @property {number} GRANTEE_TYPE_UNSPECIFIED=0 GRANTEE_TYPE_UNSPECIFIED value
                         * @property {number} USER=1 USER value
                         * @property {number} GROUP=2 GROUP value
                         * @property {number} EVERYONE=3 EVERYONE value
                         */
                        Permission.GranteeType = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "GRANTEE_TYPE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "USER"] = 1;
                            values[valuesById[2] = "GROUP"] = 2;
                            values[valuesById[3] = "EVERYONE"] = 3;
                            return values;
                        })();
    
                        /**
                         * Role enum.
                         * @name google.ai.generativelanguage.v1beta3.Permission.Role
                         * @enum {number}
                         * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value
                         * @property {number} OWNER=1 OWNER value
                         * @property {number} WRITER=2 WRITER value
                         * @property {number} READER=3 READER value
                         */
                        Permission.Role = (function() {
                            var valuesById = {}, values = Object.create(valuesById);
                            values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0;
                            values[valuesById[1] = "OWNER"] = 1;
                            values[valuesById[2] = "WRITER"] = 2;
                            values[valuesById[3] = "READER"] = 3;
                            return values;
                        })();
    
                        return Permission;
                    })();
    
                    v1beta3.PermissionService = (function() {
    
                        /**
                         * Constructs a new PermissionService service.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a PermissionService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function PermissionService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (PermissionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PermissionService;
    
                        /**
                         * Creates new PermissionService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {PermissionService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        PermissionService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|createPermission}.
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @typedef CreatePermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.Permission} [response] Permission
                         */
    
                        /**
                         * Calls CreatePermission.
                         * @function createPermission
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest} request CreatePermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.PermissionService.CreatePermissionCallback} callback Node-style callback called with the error, if any, and Permission
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.createPermission = function createPermission(request, callback) {
                            return this.rpcCall(createPermission, $root.google.ai.generativelanguage.v1beta3.CreatePermissionRequest, $root.google.ai.generativelanguage.v1beta3.Permission, request, callback);
                        }, "name", { value: "CreatePermission" });
    
                        /**
                         * Calls CreatePermission.
                         * @function createPermission
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest} request CreatePermissionRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.Permission>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|getPermission}.
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @typedef GetPermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.Permission} [response] Permission
                         */
    
                        /**
                         * Calls GetPermission.
                         * @function getPermission
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest} request GetPermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.PermissionService.GetPermissionCallback} callback Node-style callback called with the error, if any, and Permission
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.getPermission = function getPermission(request, callback) {
                            return this.rpcCall(getPermission, $root.google.ai.generativelanguage.v1beta3.GetPermissionRequest, $root.google.ai.generativelanguage.v1beta3.Permission, request, callback);
                        }, "name", { value: "GetPermission" });
    
                        /**
                         * Calls GetPermission.
                         * @function getPermission
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest} request GetPermissionRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.Permission>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|listPermissions}.
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @typedef ListPermissionsCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} [response] ListPermissionsResponse
                         */
    
                        /**
                         * Calls ListPermissions.
                         * @function listPermissions
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest} request ListPermissionsRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.PermissionService.ListPermissionsCallback} callback Node-style callback called with the error, if any, and ListPermissionsResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.listPermissions = function listPermissions(request, callback) {
                            return this.rpcCall(listPermissions, $root.google.ai.generativelanguage.v1beta3.ListPermissionsRequest, $root.google.ai.generativelanguage.v1beta3.ListPermissionsResponse, request, callback);
                        }, "name", { value: "ListPermissions" });
    
                        /**
                         * Calls ListPermissions.
                         * @function listPermissions
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest} request ListPermissionsRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.ListPermissionsResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|updatePermission}.
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @typedef UpdatePermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.Permission} [response] Permission
                         */
    
                        /**
                         * Calls UpdatePermission.
                         * @function updatePermission
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest} request UpdatePermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.PermissionService.UpdatePermissionCallback} callback Node-style callback called with the error, if any, and Permission
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.updatePermission = function updatePermission(request, callback) {
                            return this.rpcCall(updatePermission, $root.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest, $root.google.ai.generativelanguage.v1beta3.Permission, request, callback);
                        }, "name", { value: "UpdatePermission" });
    
                        /**
                         * Calls UpdatePermission.
                         * @function updatePermission
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest} request UpdatePermissionRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.Permission>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|deletePermission}.
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @typedef DeletePermissionCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.protobuf.Empty} [response] Empty
                         */
    
                        /**
                         * Calls DeletePermission.
                         * @function deletePermission
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest} request DeletePermissionRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.PermissionService.DeletePermissionCallback} callback Node-style callback called with the error, if any, and Empty
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.deletePermission = function deletePermission(request, callback) {
                            return this.rpcCall(deletePermission, $root.google.ai.generativelanguage.v1beta3.DeletePermissionRequest, $root.google.protobuf.Empty, request, callback);
                        }, "name", { value: "DeletePermission" });
    
                        /**
                         * Calls DeletePermission.
                         * @function deletePermission
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest} request DeletePermissionRequest message or plain object
                         * @returns {Promise<google.protobuf.Empty>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|transferOwnership}.
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @typedef TransferOwnershipCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} [response] TransferOwnershipResponse
                         */
    
                        /**
                         * Calls TransferOwnership.
                         * @function transferOwnership
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest} request TransferOwnershipRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.PermissionService.TransferOwnershipCallback} callback Node-style callback called with the error, if any, and TransferOwnershipResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(PermissionService.prototype.transferOwnership = function transferOwnership(request, callback) {
                            return this.rpcCall(transferOwnership, $root.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest, $root.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse, request, callback);
                        }, "name", { value: "TransferOwnership" });
    
                        /**
                         * Calls TransferOwnership.
                         * @function transferOwnership
                         * @memberof google.ai.generativelanguage.v1beta3.PermissionService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest} request TransferOwnershipRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.TransferOwnershipResponse>} Promise
                         * @variation 2
                         */
    
                        return PermissionService;
                    })();
    
                    v1beta3.CreatePermissionRequest = (function() {
    
                        /**
                         * Properties of a CreatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ICreatePermissionRequest
                         * @property {string|null} [parent] CreatePermissionRequest parent
                         * @property {google.ai.generativelanguage.v1beta3.IPermission|null} [permission] CreatePermissionRequest permission
                         */
    
                        /**
                         * Constructs a new CreatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a CreatePermissionRequest.
                         * @implements ICreatePermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest=} [properties] Properties to set
                         */
                        function CreatePermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CreatePermissionRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @instance
                         */
                        CreatePermissionRequest.prototype.parent = "";
    
                        /**
                         * CreatePermissionRequest permission.
                         * @member {google.ai.generativelanguage.v1beta3.IPermission|null|undefined} permission
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @instance
                         */
                        CreatePermissionRequest.prototype.permission = null;
    
                        /**
                         * Creates a new CreatePermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.CreatePermissionRequest} CreatePermissionRequest instance
                         */
                        CreatePermissionRequest.create = function create(properties) {
                            return new CreatePermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CreatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreatePermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest} message CreatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreatePermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.permission != null && Object.hasOwnProperty.call(message, "permission"))
                                $root.google.ai.generativelanguage.v1beta3.Permission.encode(message.permission, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CreatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreatePermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest} message CreatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CreatePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CreatePermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.CreatePermissionRequest} CreatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreatePermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CreatePermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.permission = $root.google.ai.generativelanguage.v1beta3.Permission.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CreatePermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.CreatePermissionRequest} CreatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CreatePermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CreatePermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CreatePermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.permission != null && message.hasOwnProperty("permission")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.Permission.verify(message.permission);
                                if (error)
                                    return "permission." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CreatePermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.CreatePermissionRequest} CreatePermissionRequest
                         */
                        CreatePermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.CreatePermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.CreatePermissionRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.permission != null) {
                                if (typeof object.permission !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.CreatePermissionRequest.permission: object expected");
                                message.permission = $root.google.ai.generativelanguage.v1beta3.Permission.fromObject(object.permission);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CreatePermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.CreatePermissionRequest} message CreatePermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CreatePermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.permission = null;
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.permission != null && message.hasOwnProperty("permission"))
                                object.permission = $root.google.ai.generativelanguage.v1beta3.Permission.toObject(message.permission, options);
                            return object;
                        };
    
                        /**
                         * Converts this CreatePermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CreatePermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CreatePermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CreatePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CreatePermissionRequest";
                        };
    
                        return CreatePermissionRequest;
                    })();
    
                    v1beta3.GetPermissionRequest = (function() {
    
                        /**
                         * Properties of a GetPermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IGetPermissionRequest
                         * @property {string|null} [name] GetPermissionRequest name
                         */
    
                        /**
                         * Constructs a new GetPermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a GetPermissionRequest.
                         * @implements IGetPermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest=} [properties] Properties to set
                         */
                        function GetPermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GetPermissionRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest
                         * @instance
                         */
                        GetPermissionRequest.prototype.name = "";
    
                        /**
                         * Creates a new GetPermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.GetPermissionRequest} GetPermissionRequest instance
                         */
                        GetPermissionRequest.create = function create(properties) {
                            return new GetPermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GetPermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetPermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest} message GetPermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetPermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GetPermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetPermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest} message GetPermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GetPermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GetPermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.GetPermissionRequest} GetPermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetPermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GetPermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GetPermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.GetPermissionRequest} GetPermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GetPermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GetPermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GetPermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a GetPermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.GetPermissionRequest} GetPermissionRequest
                         */
                        GetPermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.GetPermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.GetPermissionRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GetPermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.GetPermissionRequest} message GetPermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GetPermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this GetPermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GetPermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GetPermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GetPermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GetPermissionRequest";
                        };
    
                        return GetPermissionRequest;
                    })();
    
                    v1beta3.ListPermissionsRequest = (function() {
    
                        /**
                         * Properties of a ListPermissionsRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IListPermissionsRequest
                         * @property {string|null} [parent] ListPermissionsRequest parent
                         * @property {number|null} [pageSize] ListPermissionsRequest pageSize
                         * @property {string|null} [pageToken] ListPermissionsRequest pageToken
                         */
    
                        /**
                         * Constructs a new ListPermissionsRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a ListPermissionsRequest.
                         * @implements IListPermissionsRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest=} [properties] Properties to set
                         */
                        function ListPermissionsRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListPermissionsRequest parent.
                         * @member {string} parent
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @instance
                         */
                        ListPermissionsRequest.prototype.parent = "";
    
                        /**
                         * ListPermissionsRequest pageSize.
                         * @member {number} pageSize
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @instance
                         */
                        ListPermissionsRequest.prototype.pageSize = 0;
    
                        /**
                         * ListPermissionsRequest pageToken.
                         * @member {string} pageToken
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @instance
                         */
                        ListPermissionsRequest.prototype.pageToken = "";
    
                        /**
                         * Creates a new ListPermissionsRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsRequest} ListPermissionsRequest instance
                         */
                        ListPermissionsRequest.create = function create(properties) {
                            return new ListPermissionsRequest(properties);
                        };
    
                        /**
                         * Encodes the specified ListPermissionsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
                            if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                            if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListPermissionsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListPermissionsRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsRequest} ListPermissionsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListPermissionsRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.parent = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.pageSize = reader.int32();
                                        break;
                                    }
                                case 3: {
                                        message.pageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListPermissionsRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsRequest} ListPermissionsRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListPermissionsRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListPermissionsRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                if (!$util.isString(message.parent))
                                    return "parent: string expected";
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                if (!$util.isInteger(message.pageSize))
                                    return "pageSize: integer expected";
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                if (!$util.isString(message.pageToken))
                                    return "pageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListPermissionsRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsRequest} ListPermissionsRequest
                         */
                        ListPermissionsRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListPermissionsRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.ListPermissionsRequest();
                            if (object.parent != null)
                                message.parent = String(object.parent);
                            if (object.pageSize != null)
                                message.pageSize = object.pageSize | 0;
                            if (object.pageToken != null)
                                message.pageToken = String(object.pageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListPermissionsRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ListPermissionsRequest} message ListPermissionsRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListPermissionsRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.parent = "";
                                object.pageSize = 0;
                                object.pageToken = "";
                            }
                            if (message.parent != null && message.hasOwnProperty("parent"))
                                object.parent = message.parent;
                            if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                                object.pageSize = message.pageSize;
                            if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                                object.pageToken = message.pageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListPermissionsRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListPermissionsRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListPermissionsRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListPermissionsRequest";
                        };
    
                        return ListPermissionsRequest;
                    })();
    
                    v1beta3.ListPermissionsResponse = (function() {
    
                        /**
                         * Properties of a ListPermissionsResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IListPermissionsResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta3.IPermission>|null} [permissions] ListPermissionsResponse permissions
                         * @property {string|null} [nextPageToken] ListPermissionsResponse nextPageToken
                         */
    
                        /**
                         * Constructs a new ListPermissionsResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a ListPermissionsResponse.
                         * @implements IListPermissionsResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IListPermissionsResponse=} [properties] Properties to set
                         */
                        function ListPermissionsResponse(properties) {
                            this.permissions = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * ListPermissionsResponse permissions.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.IPermission>} permissions
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @instance
                         */
                        ListPermissionsResponse.prototype.permissions = $util.emptyArray;
    
                        /**
                         * ListPermissionsResponse nextPageToken.
                         * @member {string} nextPageToken
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @instance
                         */
                        ListPermissionsResponse.prototype.nextPageToken = "";
    
                        /**
                         * Creates a new ListPermissionsResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListPermissionsResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} ListPermissionsResponse instance
                         */
                        ListPermissionsResponse.create = function create(properties) {
                            return new ListPermissionsResponse(properties);
                        };
    
                        /**
                         * Encodes the specified ListPermissionsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.permissions != null && message.permissions.length)
                                for (var i = 0; i < message.permissions.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.Permission.encode(message.permissions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified ListPermissionsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        ListPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a ListPermissionsResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} ListPermissionsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListPermissionsResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.permissions && message.permissions.length))
                                            message.permissions = [];
                                        message.permissions.push($root.google.ai.generativelanguage.v1beta3.Permission.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 2: {
                                        message.nextPageToken = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a ListPermissionsResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} ListPermissionsResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        ListPermissionsResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a ListPermissionsResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        ListPermissionsResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.permissions != null && message.hasOwnProperty("permissions")) {
                                if (!Array.isArray(message.permissions))
                                    return "permissions: array expected";
                                for (var i = 0; i < message.permissions.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.Permission.verify(message.permissions[i]);
                                    if (error)
                                        return "permissions." + error;
                                }
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                if (!$util.isString(message.nextPageToken))
                                    return "nextPageToken: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a ListPermissionsResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} ListPermissionsResponse
                         */
                        ListPermissionsResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListPermissionsResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.ListPermissionsResponse();
                            if (object.permissions) {
                                if (!Array.isArray(object.permissions))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.ListPermissionsResponse.permissions: array expected");
                                message.permissions = [];
                                for (var i = 0; i < object.permissions.length; ++i) {
                                    if (typeof object.permissions[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.ListPermissionsResponse.permissions: object expected");
                                    message.permissions[i] = $root.google.ai.generativelanguage.v1beta3.Permission.fromObject(object.permissions[i]);
                                }
                            }
                            if (object.nextPageToken != null)
                                message.nextPageToken = String(object.nextPageToken);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a ListPermissionsResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} message ListPermissionsResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        ListPermissionsResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.permissions = [];
                            if (options.defaults)
                                object.nextPageToken = "";
                            if (message.permissions && message.permissions.length) {
                                object.permissions = [];
                                for (var j = 0; j < message.permissions.length; ++j)
                                    object.permissions[j] = $root.google.ai.generativelanguage.v1beta3.Permission.toObject(message.permissions[j], options);
                            }
                            if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                                object.nextPageToken = message.nextPageToken;
                            return object;
                        };
    
                        /**
                         * Converts this ListPermissionsResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        ListPermissionsResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for ListPermissionsResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        ListPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListPermissionsResponse";
                        };
    
                        return ListPermissionsResponse;
                    })();
    
                    v1beta3.UpdatePermissionRequest = (function() {
    
                        /**
                         * Properties of an UpdatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IUpdatePermissionRequest
                         * @property {google.ai.generativelanguage.v1beta3.IPermission|null} [permission] UpdatePermissionRequest permission
                         * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePermissionRequest updateMask
                         */
    
                        /**
                         * Constructs a new UpdatePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents an UpdatePermissionRequest.
                         * @implements IUpdatePermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest=} [properties] Properties to set
                         */
                        function UpdatePermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * UpdatePermissionRequest permission.
                         * @member {google.ai.generativelanguage.v1beta3.IPermission|null|undefined} permission
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @instance
                         */
                        UpdatePermissionRequest.prototype.permission = null;
    
                        /**
                         * UpdatePermissionRequest updateMask.
                         * @member {google.protobuf.IFieldMask|null|undefined} updateMask
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @instance
                         */
                        UpdatePermissionRequest.prototype.updateMask = null;
    
                        /**
                         * Creates a new UpdatePermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.UpdatePermissionRequest} UpdatePermissionRequest instance
                         */
                        UpdatePermissionRequest.create = function create(properties) {
                            return new UpdatePermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified UpdatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest} message UpdatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdatePermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.permission != null && Object.hasOwnProperty.call(message, "permission"))
                                $root.google.ai.generativelanguage.v1beta3.Permission.encode(message.permission, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
                                $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified UpdatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest} message UpdatePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        UpdatePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an UpdatePermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.UpdatePermissionRequest} UpdatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdatePermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.permission = $root.google.ai.generativelanguage.v1beta3.Permission.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 2: {
                                        message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an UpdatePermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.UpdatePermissionRequest} UpdatePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        UpdatePermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an UpdatePermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        UpdatePermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.permission != null && message.hasOwnProperty("permission")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.Permission.verify(message.permission);
                                if (error)
                                    return "permission." + error;
                            }
                            if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
                                var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
                                if (error)
                                    return "updateMask." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates an UpdatePermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.UpdatePermissionRequest} UpdatePermissionRequest
                         */
                        UpdatePermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest();
                            if (object.permission != null) {
                                if (typeof object.permission !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.permission: object expected");
                                message.permission = $root.google.ai.generativelanguage.v1beta3.Permission.fromObject(object.permission);
                            }
                            if (object.updateMask != null) {
                                if (typeof object.updateMask !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.updateMask: object expected");
                                message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an UpdatePermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.UpdatePermissionRequest} message UpdatePermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        UpdatePermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.permission = null;
                                object.updateMask = null;
                            }
                            if (message.permission != null && message.hasOwnProperty("permission"))
                                object.permission = $root.google.ai.generativelanguage.v1beta3.Permission.toObject(message.permission, options);
                            if (message.updateMask != null && message.hasOwnProperty("updateMask"))
                                object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
                            return object;
                        };
    
                        /**
                         * Converts this UpdatePermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        UpdatePermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for UpdatePermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        UpdatePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.UpdatePermissionRequest";
                        };
    
                        return UpdatePermissionRequest;
                    })();
    
                    v1beta3.DeletePermissionRequest = (function() {
    
                        /**
                         * Properties of a DeletePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IDeletePermissionRequest
                         * @property {string|null} [name] DeletePermissionRequest name
                         */
    
                        /**
                         * Constructs a new DeletePermissionRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a DeletePermissionRequest.
                         * @implements IDeletePermissionRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest=} [properties] Properties to set
                         */
                        function DeletePermissionRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * DeletePermissionRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest
                         * @instance
                         */
                        DeletePermissionRequest.prototype.name = "";
    
                        /**
                         * Creates a new DeletePermissionRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.DeletePermissionRequest} DeletePermissionRequest instance
                         */
                        DeletePermissionRequest.create = function create(properties) {
                            return new DeletePermissionRequest(properties);
                        };
    
                        /**
                         * Encodes the specified DeletePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeletePermissionRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest} message DeletePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeletePermissionRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified DeletePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeletePermissionRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest} message DeletePermissionRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        DeletePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a DeletePermissionRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.DeletePermissionRequest} DeletePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeletePermissionRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.DeletePermissionRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a DeletePermissionRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.DeletePermissionRequest} DeletePermissionRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        DeletePermissionRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a DeletePermissionRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        DeletePermissionRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a DeletePermissionRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.DeletePermissionRequest} DeletePermissionRequest
                         */
                        DeletePermissionRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.DeletePermissionRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.DeletePermissionRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a DeletePermissionRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.DeletePermissionRequest} message DeletePermissionRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        DeletePermissionRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.name = "";
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            return object;
                        };
    
                        /**
                         * Converts this DeletePermissionRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        DeletePermissionRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for DeletePermissionRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        DeletePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.DeletePermissionRequest";
                        };
    
                        return DeletePermissionRequest;
                    })();
    
                    v1beta3.TransferOwnershipRequest = (function() {
    
                        /**
                         * Properties of a TransferOwnershipRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ITransferOwnershipRequest
                         * @property {string|null} [name] TransferOwnershipRequest name
                         * @property {string|null} [emailAddress] TransferOwnershipRequest emailAddress
                         */
    
                        /**
                         * Constructs a new TransferOwnershipRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a TransferOwnershipRequest.
                         * @implements ITransferOwnershipRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest=} [properties] Properties to set
                         */
                        function TransferOwnershipRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TransferOwnershipRequest name.
                         * @member {string} name
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @instance
                         */
                        TransferOwnershipRequest.prototype.name = "";
    
                        /**
                         * TransferOwnershipRequest emailAddress.
                         * @member {string} emailAddress
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @instance
                         */
                        TransferOwnershipRequest.prototype.emailAddress = "";
    
                        /**
                         * Creates a new TransferOwnershipRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipRequest} TransferOwnershipRequest instance
                         */
                        TransferOwnershipRequest.create = function create(properties) {
                            return new TransferOwnershipRequest(properties);
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest} message TransferOwnershipRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                            if (message.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.emailAddress);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest} message TransferOwnershipRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TransferOwnershipRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipRequest} TransferOwnershipRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.name = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.emailAddress = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TransferOwnershipRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipRequest} TransferOwnershipRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TransferOwnershipRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TransferOwnershipRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.name != null && message.hasOwnProperty("name"))
                                if (!$util.isString(message.name))
                                    return "name: string expected";
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress"))
                                if (!$util.isString(message.emailAddress))
                                    return "emailAddress: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TransferOwnershipRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipRequest} TransferOwnershipRequest
                         */
                        TransferOwnershipRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest();
                            if (object.name != null)
                                message.name = String(object.name);
                            if (object.emailAddress != null)
                                message.emailAddress = String(object.emailAddress);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TransferOwnershipRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.TransferOwnershipRequest} message TransferOwnershipRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TransferOwnershipRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.name = "";
                                object.emailAddress = "";
                            }
                            if (message.name != null && message.hasOwnProperty("name"))
                                object.name = message.name;
                            if (message.emailAddress != null && message.hasOwnProperty("emailAddress"))
                                object.emailAddress = message.emailAddress;
                            return object;
                        };
    
                        /**
                         * Converts this TransferOwnershipRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TransferOwnershipRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TransferOwnershipRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TransferOwnershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TransferOwnershipRequest";
                        };
    
                        return TransferOwnershipRequest;
                    })();
    
                    v1beta3.TransferOwnershipResponse = (function() {
    
                        /**
                         * Properties of a TransferOwnershipResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ITransferOwnershipResponse
                         */
    
                        /**
                         * Constructs a new TransferOwnershipResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a TransferOwnershipResponse.
                         * @implements ITransferOwnershipResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse=} [properties] Properties to set
                         */
                        function TransferOwnershipResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Creates a new TransferOwnershipResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} TransferOwnershipResponse instance
                         */
                        TransferOwnershipResponse.create = function create(properties) {
                            return new TransferOwnershipResponse(properties);
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse} message TransferOwnershipResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TransferOwnershipResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse} message TransferOwnershipResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TransferOwnershipResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TransferOwnershipResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} TransferOwnershipResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TransferOwnershipResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} TransferOwnershipResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TransferOwnershipResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TransferOwnershipResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TransferOwnershipResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            return null;
                        };
    
                        /**
                         * Creates a TransferOwnershipResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} TransferOwnershipResponse
                         */
                        TransferOwnershipResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse)
                                return object;
                            return new $root.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse();
                        };
    
                        /**
                         * Creates a plain object from a TransferOwnershipResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} message TransferOwnershipResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TransferOwnershipResponse.toObject = function toObject() {
                            return {};
                        };
    
                        /**
                         * Converts this TransferOwnershipResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TransferOwnershipResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TransferOwnershipResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TransferOwnershipResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TransferOwnershipResponse";
                        };
    
                        return TransferOwnershipResponse;
                    })();
    
                    v1beta3.TextService = (function() {
    
                        /**
                         * Constructs a new TextService service.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a TextService
                         * @extends $protobuf.rpc.Service
                         * @constructor
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         */
                        function TextService(rpcImpl, requestDelimited, responseDelimited) {
                            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                        }
    
                        (TextService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TextService;
    
                        /**
                         * Creates new TextService service using the specified rpc implementation.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @static
                         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                         * @returns {TextService} RPC service. Useful where requests and/or responses are streamed.
                         */
                        TextService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                            return new this(rpcImpl, requestDelimited, responseDelimited);
                        };
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|generateText}.
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @typedef GenerateTextCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.GenerateTextResponse} [response] GenerateTextResponse
                         */
    
                        /**
                         * Calls GenerateText.
                         * @function generateText
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest} request GenerateTextRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.TextService.GenerateTextCallback} callback Node-style callback called with the error, if any, and GenerateTextResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.generateText = function generateText(request, callback) {
                            return this.rpcCall(generateText, $root.google.ai.generativelanguage.v1beta3.GenerateTextRequest, $root.google.ai.generativelanguage.v1beta3.GenerateTextResponse, request, callback);
                        }, "name", { value: "GenerateText" });
    
                        /**
                         * Calls GenerateText.
                         * @function generateText
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest} request GenerateTextRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.GenerateTextResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|embedText}.
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @typedef EmbedTextCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.EmbedTextResponse} [response] EmbedTextResponse
                         */
    
                        /**
                         * Calls EmbedText.
                         * @function embedText
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest} request EmbedTextRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.TextService.EmbedTextCallback} callback Node-style callback called with the error, if any, and EmbedTextResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.embedText = function embedText(request, callback) {
                            return this.rpcCall(embedText, $root.google.ai.generativelanguage.v1beta3.EmbedTextRequest, $root.google.ai.generativelanguage.v1beta3.EmbedTextResponse, request, callback);
                        }, "name", { value: "EmbedText" });
    
                        /**
                         * Calls EmbedText.
                         * @function embedText
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest} request EmbedTextRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.EmbedTextResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|batchEmbedText}.
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @typedef BatchEmbedTextCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} [response] BatchEmbedTextResponse
                         */
    
                        /**
                         * Calls BatchEmbedText.
                         * @function batchEmbedText
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest} request BatchEmbedTextRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.TextService.BatchEmbedTextCallback} callback Node-style callback called with the error, if any, and BatchEmbedTextResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.batchEmbedText = function batchEmbedText(request, callback) {
                            return this.rpcCall(batchEmbedText, $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest, $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse, request, callback);
                        }, "name", { value: "BatchEmbedText" });
    
                        /**
                         * Calls BatchEmbedText.
                         * @function batchEmbedText
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest} request BatchEmbedTextRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse>} Promise
                         * @variation 2
                         */
    
                        /**
                         * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|countTextTokens}.
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @typedef CountTextTokensCallback
                         * @type {function}
                         * @param {Error|null} error Error, if any
                         * @param {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} [response] CountTextTokensResponse
                         */
    
                        /**
                         * Calls CountTextTokens.
                         * @function countTextTokens
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest} request CountTextTokensRequest message or plain object
                         * @param {google.ai.generativelanguage.v1beta3.TextService.CountTextTokensCallback} callback Node-style callback called with the error, if any, and CountTextTokensResponse
                         * @returns {undefined}
                         * @variation 1
                         */
                        Object.defineProperty(TextService.prototype.countTextTokens = function countTextTokens(request, callback) {
                            return this.rpcCall(countTextTokens, $root.google.ai.generativelanguage.v1beta3.CountTextTokensRequest, $root.google.ai.generativelanguage.v1beta3.CountTextTokensResponse, request, callback);
                        }, "name", { value: "CountTextTokens" });
    
                        /**
                         * Calls CountTextTokens.
                         * @function countTextTokens
                         * @memberof google.ai.generativelanguage.v1beta3.TextService
                         * @instance
                         * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest} request CountTextTokensRequest message or plain object
                         * @returns {Promise<google.ai.generativelanguage.v1beta3.CountTextTokensResponse>} Promise
                         * @variation 2
                         */
    
                        return TextService;
                    })();
    
                    v1beta3.GenerateTextRequest = (function() {
    
                        /**
                         * Properties of a GenerateTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IGenerateTextRequest
                         * @property {string|null} [model] GenerateTextRequest model
                         * @property {google.ai.generativelanguage.v1beta3.ITextPrompt|null} [prompt] GenerateTextRequest prompt
                         * @property {number|null} [temperature] GenerateTextRequest temperature
                         * @property {number|null} [candidateCount] GenerateTextRequest candidateCount
                         * @property {number|null} [maxOutputTokens] GenerateTextRequest maxOutputTokens
                         * @property {number|null} [topP] GenerateTextRequest topP
                         * @property {number|null} [topK] GenerateTextRequest topK
                         * @property {Array.<google.ai.generativelanguage.v1beta3.ISafetySetting>|null} [safetySettings] GenerateTextRequest safetySettings
                         * @property {Array.<string>|null} [stopSequences] GenerateTextRequest stopSequences
                         */
    
                        /**
                         * Constructs a new GenerateTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a GenerateTextRequest.
                         * @implements IGenerateTextRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest=} [properties] Properties to set
                         */
                        function GenerateTextRequest(properties) {
                            this.safetySettings = [];
                            this.stopSequences = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateTextRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.model = "";
    
                        /**
                         * GenerateTextRequest prompt.
                         * @member {google.ai.generativelanguage.v1beta3.ITextPrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.prompt = null;
    
                        /**
                         * GenerateTextRequest temperature.
                         * @member {number|null|undefined} temperature
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.temperature = null;
    
                        /**
                         * GenerateTextRequest candidateCount.
                         * @member {number|null|undefined} candidateCount
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.candidateCount = null;
    
                        /**
                         * GenerateTextRequest maxOutputTokens.
                         * @member {number|null|undefined} maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.maxOutputTokens = null;
    
                        /**
                         * GenerateTextRequest topP.
                         * @member {number|null|undefined} topP
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.topP = null;
    
                        /**
                         * GenerateTextRequest topK.
                         * @member {number|null|undefined} topK
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.topK = null;
    
                        /**
                         * GenerateTextRequest safetySettings.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.ISafetySetting>} safetySettings
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.safetySettings = $util.emptyArray;
    
                        /**
                         * GenerateTextRequest stopSequences.
                         * @member {Array.<string>} stopSequences
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        GenerateTextRequest.prototype.stopSequences = $util.emptyArray;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * GenerateTextRequest _temperature.
                         * @member {"temperature"|undefined} _temperature
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_temperature", {
                            get: $util.oneOfGetter($oneOfFields = ["temperature"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _candidateCount.
                         * @member {"candidateCount"|undefined} _candidateCount
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_candidateCount", {
                            get: $util.oneOfGetter($oneOfFields = ["candidateCount"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _maxOutputTokens.
                         * @member {"maxOutputTokens"|undefined} _maxOutputTokens
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_maxOutputTokens", {
                            get: $util.oneOfGetter($oneOfFields = ["maxOutputTokens"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _topP.
                         * @member {"topP"|undefined} _topP
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_topP", {
                            get: $util.oneOfGetter($oneOfFields = ["topP"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * GenerateTextRequest _topK.
                         * @member {"topK"|undefined} _topK
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         */
                        Object.defineProperty(GenerateTextRequest.prototype, "_topK", {
                            get: $util.oneOfGetter($oneOfFields = ["topK"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new GenerateTextRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateTextRequest} GenerateTextRequest instance
                         */
                        GenerateTextRequest.create = function create(properties) {
                            return new GenerateTextRequest(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1beta3.TextPrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature"))
                                writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature);
                            if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount"))
                                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount);
                            if (message.maxOutputTokens != null && Object.hasOwnProperty.call(message, "maxOutputTokens"))
                                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxOutputTokens);
                            if (message.topP != null && Object.hasOwnProperty.call(message, "topP"))
                                writer.uint32(/* id 6, wireType 5 =*/53).float(message.topP);
                            if (message.topK != null && Object.hasOwnProperty.call(message, "topK"))
                                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.topK);
                            if (message.safetySettings != null && message.safetySettings.length)
                                for (var i = 0; i < message.safetySettings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                            if (message.stopSequences != null && message.stopSequences.length)
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    writer.uint32(/* id 9, wireType 2 =*/74).string(message.stopSequences[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateTextRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateTextRequest} GenerateTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GenerateTextRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                case 3: {
                                        message.temperature = reader.float();
                                        break;
                                    }
                                case 4: {
                                        message.candidateCount = reader.int32();
                                        break;
                                    }
                                case 5: {
                                        message.maxOutputTokens = reader.int32();
                                        break;
                                    }
                                case 6: {
                                        message.topP = reader.float();
                                        break;
                                    }
                                case 7: {
                                        message.topK = reader.int32();
                                        break;
                                    }
                                case 8: {
                                        if (!(message.safetySettings && message.safetySettings.length))
                                            message.safetySettings = [];
                                        message.safetySettings.push($root.google.ai.generativelanguage.v1beta3.SafetySetting.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 9: {
                                        if (!(message.stopSequences && message.stopSequences.length))
                                            message.stopSequences = [];
                                        message.stopSequences.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateTextRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateTextRequest} GenerateTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateTextRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateTextRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.TextPrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                properties._temperature = 1;
                                if (typeof message.temperature !== "number")
                                    return "temperature: number expected";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                properties._candidateCount = 1;
                                if (!$util.isInteger(message.candidateCount))
                                    return "candidateCount: integer expected";
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                properties._maxOutputTokens = 1;
                                if (!$util.isInteger(message.maxOutputTokens))
                                    return "maxOutputTokens: integer expected";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                properties._topP = 1;
                                if (typeof message.topP !== "number")
                                    return "topP: number expected";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                properties._topK = 1;
                                if (!$util.isInteger(message.topK))
                                    return "topK: integer expected";
                            }
                            if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) {
                                if (!Array.isArray(message.safetySettings))
                                    return "safetySettings: array expected";
                                for (var i = 0; i < message.safetySettings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.SafetySetting.verify(message.safetySettings[i]);
                                    if (error)
                                        return "safetySettings." + error;
                                }
                            }
                            if (message.stopSequences != null && message.hasOwnProperty("stopSequences")) {
                                if (!Array.isArray(message.stopSequences))
                                    return "stopSequences: array expected";
                                for (var i = 0; i < message.stopSequences.length; ++i)
                                    if (!$util.isString(message.stopSequences[i]))
                                        return "stopSequences: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateTextRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateTextRequest} GenerateTextRequest
                         */
                        GenerateTextRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.GenerateTextRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.GenerateTextRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.fromObject(object.prompt);
                            }
                            if (object.temperature != null)
                                message.temperature = Number(object.temperature);
                            if (object.candidateCount != null)
                                message.candidateCount = object.candidateCount | 0;
                            if (object.maxOutputTokens != null)
                                message.maxOutputTokens = object.maxOutputTokens | 0;
                            if (object.topP != null)
                                message.topP = Number(object.topP);
                            if (object.topK != null)
                                message.topK = object.topK | 0;
                            if (object.safetySettings) {
                                if (!Array.isArray(object.safetySettings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextRequest.safetySettings: array expected");
                                message.safetySettings = [];
                                for (var i = 0; i < object.safetySettings.length; ++i) {
                                    if (typeof object.safetySettings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextRequest.safetySettings: object expected");
                                    message.safetySettings[i] = $root.google.ai.generativelanguage.v1beta3.SafetySetting.fromObject(object.safetySettings[i]);
                                }
                            }
                            if (object.stopSequences) {
                                if (!Array.isArray(object.stopSequences))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextRequest.stopSequences: array expected");
                                message.stopSequences = [];
                                for (var i = 0; i < object.stopSequences.length; ++i)
                                    message.stopSequences[i] = String(object.stopSequences[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateTextRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.GenerateTextRequest} message GenerateTextRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateTextRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.safetySettings = [];
                                object.stopSequences = [];
                            }
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.toObject(message.prompt, options);
                            if (message.temperature != null && message.hasOwnProperty("temperature")) {
                                object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature;
                                if (options.oneofs)
                                    object._temperature = "temperature";
                            }
                            if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) {
                                object.candidateCount = message.candidateCount;
                                if (options.oneofs)
                                    object._candidateCount = "candidateCount";
                            }
                            if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) {
                                object.maxOutputTokens = message.maxOutputTokens;
                                if (options.oneofs)
                                    object._maxOutputTokens = "maxOutputTokens";
                            }
                            if (message.topP != null && message.hasOwnProperty("topP")) {
                                object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP;
                                if (options.oneofs)
                                    object._topP = "topP";
                            }
                            if (message.topK != null && message.hasOwnProperty("topK")) {
                                object.topK = message.topK;
                                if (options.oneofs)
                                    object._topK = "topK";
                            }
                            if (message.safetySettings && message.safetySettings.length) {
                                object.safetySettings = [];
                                for (var j = 0; j < message.safetySettings.length; ++j)
                                    object.safetySettings[j] = $root.google.ai.generativelanguage.v1beta3.SafetySetting.toObject(message.safetySettings[j], options);
                            }
                            if (message.stopSequences && message.stopSequences.length) {
                                object.stopSequences = [];
                                for (var j = 0; j < message.stopSequences.length; ++j)
                                    object.stopSequences[j] = message.stopSequences[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateTextRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateTextRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateTextRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GenerateTextRequest";
                        };
    
                        return GenerateTextRequest;
                    })();
    
                    v1beta3.GenerateTextResponse = (function() {
    
                        /**
                         * Properties of a GenerateTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IGenerateTextResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta3.ITextCompletion>|null} [candidates] GenerateTextResponse candidates
                         * @property {Array.<google.ai.generativelanguage.v1beta3.IContentFilter>|null} [filters] GenerateTextResponse filters
                         * @property {Array.<google.ai.generativelanguage.v1beta3.ISafetyFeedback>|null} [safetyFeedback] GenerateTextResponse safetyFeedback
                         */
    
                        /**
                         * Constructs a new GenerateTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a GenerateTextResponse.
                         * @implements IGenerateTextResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateTextResponse=} [properties] Properties to set
                         */
                        function GenerateTextResponse(properties) {
                            this.candidates = [];
                            this.filters = [];
                            this.safetyFeedback = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * GenerateTextResponse candidates.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.ITextCompletion>} candidates
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.candidates = $util.emptyArray;
    
                        /**
                         * GenerateTextResponse filters.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.IContentFilter>} filters
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.filters = $util.emptyArray;
    
                        /**
                         * GenerateTextResponse safetyFeedback.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.ISafetyFeedback>} safetyFeedback
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @instance
                         */
                        GenerateTextResponse.prototype.safetyFeedback = $util.emptyArray;
    
                        /**
                         * Creates a new GenerateTextResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateTextResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateTextResponse} GenerateTextResponse instance
                         */
                        GenerateTextResponse.create = function create(properties) {
                            return new GenerateTextResponse(properties);
                        };
    
                        /**
                         * Encodes the specified GenerateTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.candidates != null && message.candidates.length)
                                for (var i = 0; i < message.candidates.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.TextCompletion.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            if (message.filters != null && message.filters.length)
                                for (var i = 0; i < message.filters.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            if (message.safetyFeedback != null && message.safetyFeedback.length)
                                for (var i = 0; i < message.safetyFeedback.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.SafetyFeedback.encode(message.safetyFeedback[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified GenerateTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        GenerateTextResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a GenerateTextResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateTextResponse} GenerateTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GenerateTextResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.candidates && message.candidates.length))
                                            message.candidates = [];
                                        message.candidates.push($root.google.ai.generativelanguage.v1beta3.TextCompletion.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        if (!(message.filters && message.filters.length))
                                            message.filters = [];
                                        message.filters.push($root.google.ai.generativelanguage.v1beta3.ContentFilter.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 4: {
                                        if (!(message.safetyFeedback && message.safetyFeedback.length))
                                            message.safetyFeedback = [];
                                        message.safetyFeedback.push($root.google.ai.generativelanguage.v1beta3.SafetyFeedback.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a GenerateTextResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateTextResponse} GenerateTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        GenerateTextResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a GenerateTextResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        GenerateTextResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.candidates != null && message.hasOwnProperty("candidates")) {
                                if (!Array.isArray(message.candidates))
                                    return "candidates: array expected";
                                for (var i = 0; i < message.candidates.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.TextCompletion.verify(message.candidates[i]);
                                    if (error)
                                        return "candidates." + error;
                                }
                            }
                            if (message.filters != null && message.hasOwnProperty("filters")) {
                                if (!Array.isArray(message.filters))
                                    return "filters: array expected";
                                for (var i = 0; i < message.filters.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.ContentFilter.verify(message.filters[i]);
                                    if (error)
                                        return "filters." + error;
                                }
                            }
                            if (message.safetyFeedback != null && message.hasOwnProperty("safetyFeedback")) {
                                if (!Array.isArray(message.safetyFeedback))
                                    return "safetyFeedback: array expected";
                                for (var i = 0; i < message.safetyFeedback.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.SafetyFeedback.verify(message.safetyFeedback[i]);
                                    if (error)
                                        return "safetyFeedback." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a GenerateTextResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.GenerateTextResponse} GenerateTextResponse
                         */
                        GenerateTextResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.GenerateTextResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.GenerateTextResponse();
                            if (object.candidates) {
                                if (!Array.isArray(object.candidates))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.candidates: array expected");
                                message.candidates = [];
                                for (var i = 0; i < object.candidates.length; ++i) {
                                    if (typeof object.candidates[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.candidates: object expected");
                                    message.candidates[i] = $root.google.ai.generativelanguage.v1beta3.TextCompletion.fromObject(object.candidates[i]);
                                }
                            }
                            if (object.filters) {
                                if (!Array.isArray(object.filters))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.filters: array expected");
                                message.filters = [];
                                for (var i = 0; i < object.filters.length; ++i) {
                                    if (typeof object.filters[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.filters: object expected");
                                    message.filters[i] = $root.google.ai.generativelanguage.v1beta3.ContentFilter.fromObject(object.filters[i]);
                                }
                            }
                            if (object.safetyFeedback) {
                                if (!Array.isArray(object.safetyFeedback))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.safetyFeedback: array expected");
                                message.safetyFeedback = [];
                                for (var i = 0; i < object.safetyFeedback.length; ++i) {
                                    if (typeof object.safetyFeedback[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.safetyFeedback: object expected");
                                    message.safetyFeedback[i] = $root.google.ai.generativelanguage.v1beta3.SafetyFeedback.fromObject(object.safetyFeedback[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a GenerateTextResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.GenerateTextResponse} message GenerateTextResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        GenerateTextResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults) {
                                object.candidates = [];
                                object.filters = [];
                                object.safetyFeedback = [];
                            }
                            if (message.candidates && message.candidates.length) {
                                object.candidates = [];
                                for (var j = 0; j < message.candidates.length; ++j)
                                    object.candidates[j] = $root.google.ai.generativelanguage.v1beta3.TextCompletion.toObject(message.candidates[j], options);
                            }
                            if (message.filters && message.filters.length) {
                                object.filters = [];
                                for (var j = 0; j < message.filters.length; ++j)
                                    object.filters[j] = $root.google.ai.generativelanguage.v1beta3.ContentFilter.toObject(message.filters[j], options);
                            }
                            if (message.safetyFeedback && message.safetyFeedback.length) {
                                object.safetyFeedback = [];
                                for (var j = 0; j < message.safetyFeedback.length; ++j)
                                    object.safetyFeedback[j] = $root.google.ai.generativelanguage.v1beta3.SafetyFeedback.toObject(message.safetyFeedback[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this GenerateTextResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        GenerateTextResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for GenerateTextResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        GenerateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GenerateTextResponse";
                        };
    
                        return GenerateTextResponse;
                    })();
    
                    v1beta3.TextPrompt = (function() {
    
                        /**
                         * Properties of a TextPrompt.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ITextPrompt
                         * @property {string|null} [text] TextPrompt text
                         */
    
                        /**
                         * Constructs a new TextPrompt.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a TextPrompt.
                         * @implements ITextPrompt
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ITextPrompt=} [properties] Properties to set
                         */
                        function TextPrompt(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TextPrompt text.
                         * @member {string} text
                         * @memberof google.ai.generativelanguage.v1beta3.TextPrompt
                         * @instance
                         */
                        TextPrompt.prototype.text = "";
    
                        /**
                         * Creates a new TextPrompt instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITextPrompt=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.TextPrompt} TextPrompt instance
                         */
                        TextPrompt.create = function create(properties) {
                            return new TextPrompt(properties);
                        };
    
                        /**
                         * Encodes the specified TextPrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextPrompt.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITextPrompt} message TextPrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextPrompt.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TextPrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextPrompt.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITextPrompt} message TextPrompt message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextPrompt.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TextPrompt message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.TextPrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.TextPrompt} TextPrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextPrompt.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TextPrompt();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TextPrompt message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TextPrompt
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.TextPrompt} TextPrompt
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextPrompt.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TextPrompt message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.TextPrompt
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TextPrompt.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.text != null && message.hasOwnProperty("text"))
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            return null;
                        };
    
                        /**
                         * Creates a TextPrompt message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.TextPrompt
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.TextPrompt} TextPrompt
                         */
                        TextPrompt.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.TextPrompt)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.TextPrompt();
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TextPrompt message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.TextPrompt
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.TextPrompt} message TextPrompt
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TextPrompt.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.text = "";
                            if (message.text != null && message.hasOwnProperty("text"))
                                object.text = message.text;
                            return object;
                        };
    
                        /**
                         * Converts this TextPrompt to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.TextPrompt
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TextPrompt.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TextPrompt
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.TextPrompt
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TextPrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TextPrompt";
                        };
    
                        return TextPrompt;
                    })();
    
                    v1beta3.TextCompletion = (function() {
    
                        /**
                         * Properties of a TextCompletion.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ITextCompletion
                         * @property {string|null} [output] TextCompletion output
                         * @property {Array.<google.ai.generativelanguage.v1beta3.ISafetyRating>|null} [safetyRatings] TextCompletion safetyRatings
                         * @property {google.ai.generativelanguage.v1beta3.ICitationMetadata|null} [citationMetadata] TextCompletion citationMetadata
                         */
    
                        /**
                         * Constructs a new TextCompletion.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a TextCompletion.
                         * @implements ITextCompletion
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ITextCompletion=} [properties] Properties to set
                         */
                        function TextCompletion(properties) {
                            this.safetyRatings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * TextCompletion output.
                         * @member {string} output
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.output = "";
    
                        /**
                         * TextCompletion safetyRatings.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.ISafetyRating>} safetyRatings
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.safetyRatings = $util.emptyArray;
    
                        /**
                         * TextCompletion citationMetadata.
                         * @member {google.ai.generativelanguage.v1beta3.ICitationMetadata|null|undefined} citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @instance
                         */
                        TextCompletion.prototype.citationMetadata = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * TextCompletion _citationMetadata.
                         * @member {"citationMetadata"|undefined} _citationMetadata
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @instance
                         */
                        Object.defineProperty(TextCompletion.prototype, "_citationMetadata", {
                            get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new TextCompletion instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITextCompletion=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.TextCompletion} TextCompletion instance
                         */
                        TextCompletion.create = function create(properties) {
                            return new TextCompletion(properties);
                        };
    
                        /**
                         * Encodes the specified TextCompletion message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextCompletion.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITextCompletion} message TextCompletion message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextCompletion.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.output);
                            if (message.safetyRatings != null && message.safetyRatings.length)
                                for (var i = 0; i < message.safetyRatings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata"))
                                $root.google.ai.generativelanguage.v1beta3.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified TextCompletion message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextCompletion.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ITextCompletion} message TextCompletion message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        TextCompletion.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a TextCompletion message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.TextCompletion} TextCompletion
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextCompletion.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TextCompletion();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.output = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.safetyRatings && message.safetyRatings.length))
                                            message.safetyRatings = [];
                                        message.safetyRatings.push($root.google.ai.generativelanguage.v1beta3.SafetyRating.decode(reader, reader.uint32()));
                                        break;
                                    }
                                case 3: {
                                        message.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a TextCompletion message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.TextCompletion} TextCompletion
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        TextCompletion.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a TextCompletion message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        TextCompletion.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.output != null && message.hasOwnProperty("output"))
                                if (!$util.isString(message.output))
                                    return "output: string expected";
                            if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) {
                                if (!Array.isArray(message.safetyRatings))
                                    return "safetyRatings: array expected";
                                for (var i = 0; i < message.safetyRatings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.SafetyRating.verify(message.safetyRatings[i]);
                                    if (error)
                                        return "safetyRatings." + error;
                                }
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                properties._citationMetadata = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.verify(message.citationMetadata);
                                    if (error)
                                        return "citationMetadata." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a TextCompletion message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.TextCompletion} TextCompletion
                         */
                        TextCompletion.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.TextCompletion)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.TextCompletion();
                            if (object.output != null)
                                message.output = String(object.output);
                            if (object.safetyRatings) {
                                if (!Array.isArray(object.safetyRatings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TextCompletion.safetyRatings: array expected");
                                message.safetyRatings = [];
                                for (var i = 0; i < object.safetyRatings.length; ++i) {
                                    if (typeof object.safetyRatings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.TextCompletion.safetyRatings: object expected");
                                    message.safetyRatings[i] = $root.google.ai.generativelanguage.v1beta3.SafetyRating.fromObject(object.safetyRatings[i]);
                                }
                            }
                            if (object.citationMetadata != null) {
                                if (typeof object.citationMetadata !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.TextCompletion.citationMetadata: object expected");
                                message.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.fromObject(object.citationMetadata);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a TextCompletion message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.TextCompletion} message TextCompletion
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        TextCompletion.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.safetyRatings = [];
                            if (options.defaults)
                                object.output = "";
                            if (message.output != null && message.hasOwnProperty("output"))
                                object.output = message.output;
                            if (message.safetyRatings && message.safetyRatings.length) {
                                object.safetyRatings = [];
                                for (var j = 0; j < message.safetyRatings.length; ++j)
                                    object.safetyRatings[j] = $root.google.ai.generativelanguage.v1beta3.SafetyRating.toObject(message.safetyRatings[j], options);
                            }
                            if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) {
                                object.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.toObject(message.citationMetadata, options);
                                if (options.oneofs)
                                    object._citationMetadata = "citationMetadata";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this TextCompletion to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        TextCompletion.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for TextCompletion
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.TextCompletion
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        TextCompletion.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TextCompletion";
                        };
    
                        return TextCompletion;
                    })();
    
                    v1beta3.EmbedTextRequest = (function() {
    
                        /**
                         * Properties of an EmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IEmbedTextRequest
                         * @property {string|null} [model] EmbedTextRequest model
                         * @property {string|null} [text] EmbedTextRequest text
                         */
    
                        /**
                         * Constructs a new EmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents an EmbedTextRequest.
                         * @implements IEmbedTextRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest=} [properties] Properties to set
                         */
                        function EmbedTextRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedTextRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @instance
                         */
                        EmbedTextRequest.prototype.model = "";
    
                        /**
                         * EmbedTextRequest text.
                         * @member {string} text
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @instance
                         */
                        EmbedTextRequest.prototype.text = "";
    
                        /**
                         * Creates a new EmbedTextRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.EmbedTextRequest} EmbedTextRequest instance
                         */
                        EmbedTextRequest.create = function create(properties) {
                            return new EmbedTextRequest(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.text != null && Object.hasOwnProperty.call(message, "text"))
                                writer.uint32(/* id 2, wireType 2 =*/18).string(message.text);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedTextRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.EmbedTextRequest} EmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.EmbedTextRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.text = reader.string();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedTextRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.EmbedTextRequest} EmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedTextRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedTextRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.text != null && message.hasOwnProperty("text"))
                                if (!$util.isString(message.text))
                                    return "text: string expected";
                            return null;
                        };
    
                        /**
                         * Creates an EmbedTextRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.EmbedTextRequest} EmbedTextRequest
                         */
                        EmbedTextRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.EmbedTextRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.EmbedTextRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.text != null)
                                message.text = String(object.text);
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedTextRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.EmbedTextRequest} message EmbedTextRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedTextRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.text = "";
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.text != null && message.hasOwnProperty("text"))
                                object.text = message.text;
                            return object;
                        };
    
                        /**
                         * Converts this EmbedTextRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedTextRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedTextRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.EmbedTextRequest";
                        };
    
                        return EmbedTextRequest;
                    })();
    
                    v1beta3.EmbedTextResponse = (function() {
    
                        /**
                         * Properties of an EmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IEmbedTextResponse
                         * @property {google.ai.generativelanguage.v1beta3.IEmbedding|null} [embedding] EmbedTextResponse embedding
                         */
    
                        /**
                         * Constructs a new EmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents an EmbedTextResponse.
                         * @implements IEmbedTextResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedTextResponse=} [properties] Properties to set
                         */
                        function EmbedTextResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * EmbedTextResponse embedding.
                         * @member {google.ai.generativelanguage.v1beta3.IEmbedding|null|undefined} embedding
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @instance
                         */
                        EmbedTextResponse.prototype.embedding = null;
    
                        // OneOf field names bound to virtual getters and setters
                        var $oneOfFields;
    
                        /**
                         * EmbedTextResponse _embedding.
                         * @member {"embedding"|undefined} _embedding
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @instance
                         */
                        Object.defineProperty(EmbedTextResponse.prototype, "_embedding", {
                            get: $util.oneOfGetter($oneOfFields = ["embedding"]),
                            set: $util.oneOfSetter($oneOfFields)
                        });
    
                        /**
                         * Creates a new EmbedTextResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedTextResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.EmbedTextResponse} EmbedTextResponse instance
                         */
                        EmbedTextResponse.create = function create(properties) {
                            return new EmbedTextResponse(properties);
                        };
    
                        /**
                         * Encodes the specified EmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embedding != null && Object.hasOwnProperty.call(message, "embedding"))
                                $root.google.ai.generativelanguage.v1beta3.Embedding.encode(message.embedding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified EmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        EmbedTextResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an EmbedTextResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.EmbedTextResponse} EmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.EmbedTextResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.embedding = $root.google.ai.generativelanguage.v1beta3.Embedding.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an EmbedTextResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.EmbedTextResponse} EmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        EmbedTextResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an EmbedTextResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        EmbedTextResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            var properties = {};
                            if (message.embedding != null && message.hasOwnProperty("embedding")) {
                                properties._embedding = 1;
                                {
                                    var error = $root.google.ai.generativelanguage.v1beta3.Embedding.verify(message.embedding);
                                    if (error)
                                        return "embedding." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates an EmbedTextResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.EmbedTextResponse} EmbedTextResponse
                         */
                        EmbedTextResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.EmbedTextResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.EmbedTextResponse();
                            if (object.embedding != null) {
                                if (typeof object.embedding !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.EmbedTextResponse.embedding: object expected");
                                message.embedding = $root.google.ai.generativelanguage.v1beta3.Embedding.fromObject(object.embedding);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an EmbedTextResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.EmbedTextResponse} message EmbedTextResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        EmbedTextResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (message.embedding != null && message.hasOwnProperty("embedding")) {
                                object.embedding = $root.google.ai.generativelanguage.v1beta3.Embedding.toObject(message.embedding, options);
                                if (options.oneofs)
                                    object._embedding = "embedding";
                            }
                            return object;
                        };
    
                        /**
                         * Converts this EmbedTextResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        EmbedTextResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for EmbedTextResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        EmbedTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.EmbedTextResponse";
                        };
    
                        return EmbedTextResponse;
                    })();
    
                    v1beta3.BatchEmbedTextRequest = (function() {
    
                        /**
                         * Properties of a BatchEmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IBatchEmbedTextRequest
                         * @property {string|null} [model] BatchEmbedTextRequest model
                         * @property {Array.<string>|null} [texts] BatchEmbedTextRequest texts
                         */
    
                        /**
                         * Constructs a new BatchEmbedTextRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a BatchEmbedTextRequest.
                         * @implements IBatchEmbedTextRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest=} [properties] Properties to set
                         */
                        function BatchEmbedTextRequest(properties) {
                            this.texts = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedTextRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @instance
                         */
                        BatchEmbedTextRequest.prototype.model = "";
    
                        /**
                         * BatchEmbedTextRequest texts.
                         * @member {Array.<string>} texts
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @instance
                         */
                        BatchEmbedTextRequest.prototype.texts = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedTextRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest} BatchEmbedTextRequest instance
                         */
                        BatchEmbedTextRequest.create = function create(properties) {
                            return new BatchEmbedTextRequest(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest} message BatchEmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.texts != null && message.texts.length)
                                for (var i = 0; i < message.texts.length; ++i)
                                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.texts[i]);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest} message BatchEmbedTextRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedTextRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest} BatchEmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        if (!(message.texts && message.texts.length))
                                            message.texts = [];
                                        message.texts.push(reader.string());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedTextRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest} BatchEmbedTextRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedTextRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedTextRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.texts != null && message.hasOwnProperty("texts")) {
                                if (!Array.isArray(message.texts))
                                    return "texts: array expected";
                                for (var i = 0; i < message.texts.length; ++i)
                                    if (!$util.isString(message.texts[i]))
                                        return "texts: string[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedTextRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest} BatchEmbedTextRequest
                         */
                        BatchEmbedTextRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.texts) {
                                if (!Array.isArray(object.texts))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest.texts: array expected");
                                message.texts = [];
                                for (var i = 0; i < object.texts.length; ++i)
                                    message.texts[i] = String(object.texts[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedTextRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest} message BatchEmbedTextRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedTextRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.texts = [];
                            if (options.defaults)
                                object.model = "";
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.texts && message.texts.length) {
                                object.texts = [];
                                for (var j = 0; j < message.texts.length; ++j)
                                    object.texts[j] = message.texts[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedTextRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedTextRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedTextRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest";
                        };
    
                        return BatchEmbedTextRequest;
                    })();
    
                    v1beta3.BatchEmbedTextResponse = (function() {
    
                        /**
                         * Properties of a BatchEmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IBatchEmbedTextResponse
                         * @property {Array.<google.ai.generativelanguage.v1beta3.IEmbedding>|null} [embeddings] BatchEmbedTextResponse embeddings
                         */
    
                        /**
                         * Constructs a new BatchEmbedTextResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a BatchEmbedTextResponse.
                         * @implements IBatchEmbedTextResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse=} [properties] Properties to set
                         */
                        function BatchEmbedTextResponse(properties) {
                            this.embeddings = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * BatchEmbedTextResponse embeddings.
                         * @member {Array.<google.ai.generativelanguage.v1beta3.IEmbedding>} embeddings
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse
                         * @instance
                         */
                        BatchEmbedTextResponse.prototype.embeddings = $util.emptyArray;
    
                        /**
                         * Creates a new BatchEmbedTextResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} BatchEmbedTextResponse instance
                         */
                        BatchEmbedTextResponse.create = function create(properties) {
                            return new BatchEmbedTextResponse(properties);
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse} message BatchEmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.embeddings != null && message.embeddings.length)
                                for (var i = 0; i < message.embeddings.length; ++i)
                                    $root.google.ai.generativelanguage.v1beta3.Embedding.encode(message.embeddings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified BatchEmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse} message BatchEmbedTextResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        BatchEmbedTextResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a BatchEmbedTextResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} BatchEmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.embeddings && message.embeddings.length))
                                            message.embeddings = [];
                                        message.embeddings.push($root.google.ai.generativelanguage.v1beta3.Embedding.decode(reader, reader.uint32()));
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a BatchEmbedTextResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} BatchEmbedTextResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        BatchEmbedTextResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a BatchEmbedTextResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        BatchEmbedTextResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.embeddings != null && message.hasOwnProperty("embeddings")) {
                                if (!Array.isArray(message.embeddings))
                                    return "embeddings: array expected";
                                for (var i = 0; i < message.embeddings.length; ++i) {
                                    var error = $root.google.ai.generativelanguage.v1beta3.Embedding.verify(message.embeddings[i]);
                                    if (error)
                                        return "embeddings." + error;
                                }
                            }
                            return null;
                        };
    
                        /**
                         * Creates a BatchEmbedTextResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} BatchEmbedTextResponse
                         */
                        BatchEmbedTextResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse();
                            if (object.embeddings) {
                                if (!Array.isArray(object.embeddings))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse.embeddings: array expected");
                                message.embeddings = [];
                                for (var i = 0; i < object.embeddings.length; ++i) {
                                    if (typeof object.embeddings[i] !== "object")
                                        throw TypeError(".google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse.embeddings: object expected");
                                    message.embeddings[i] = $root.google.ai.generativelanguage.v1beta3.Embedding.fromObject(object.embeddings[i]);
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a BatchEmbedTextResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} message BatchEmbedTextResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        BatchEmbedTextResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.embeddings = [];
                            if (message.embeddings && message.embeddings.length) {
                                object.embeddings = [];
                                for (var j = 0; j < message.embeddings.length; ++j)
                                    object.embeddings[j] = $root.google.ai.generativelanguage.v1beta3.Embedding.toObject(message.embeddings[j], options);
                            }
                            return object;
                        };
    
                        /**
                         * Converts this BatchEmbedTextResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        BatchEmbedTextResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for BatchEmbedTextResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        BatchEmbedTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse";
                        };
    
                        return BatchEmbedTextResponse;
                    })();
    
                    v1beta3.Embedding = (function() {
    
                        /**
                         * Properties of an Embedding.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface IEmbedding
                         * @property {Array.<number>|null} [value] Embedding value
                         */
    
                        /**
                         * Constructs a new Embedding.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents an Embedding.
                         * @implements IEmbedding
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedding=} [properties] Properties to set
                         */
                        function Embedding(properties) {
                            this.value = [];
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * Embedding value.
                         * @member {Array.<number>} value
                         * @memberof google.ai.generativelanguage.v1beta3.Embedding
                         * @instance
                         */
                        Embedding.prototype.value = $util.emptyArray;
    
                        /**
                         * Creates a new Embedding instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedding=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.Embedding} Embedding instance
                         */
                        Embedding.create = function create(properties) {
                            return new Embedding(properties);
                        };
    
                        /**
                         * Encodes the specified Embedding message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Embedding.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedding} message Embedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Embedding.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.value != null && message.value.length) {
                                writer.uint32(/* id 1, wireType 2 =*/10).fork();
                                for (var i = 0; i < message.value.length; ++i)
                                    writer.float(message.value[i]);
                                writer.ldelim();
                            }
                            return writer;
                        };
    
                        /**
                         * Encodes the specified Embedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Embedding.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.IEmbedding} message Embedding message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        Embedding.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes an Embedding message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.Embedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.Embedding} Embedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Embedding.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Embedding();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        if (!(message.value && message.value.length))
                                            message.value = [];
                                        if ((tag & 7) === 2) {
                                            var end2 = reader.uint32() + reader.pos;
                                            while (reader.pos < end2)
                                                message.value.push(reader.float());
                                        } else
                                            message.value.push(reader.float());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes an Embedding message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.Embedding
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.Embedding} Embedding
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        Embedding.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies an Embedding message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.Embedding
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        Embedding.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.value != null && message.hasOwnProperty("value")) {
                                if (!Array.isArray(message.value))
                                    return "value: array expected";
                                for (var i = 0; i < message.value.length; ++i)
                                    if (typeof message.value[i] !== "number")
                                        return "value: number[] expected";
                            }
                            return null;
                        };
    
                        /**
                         * Creates an Embedding message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.Embedding
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.Embedding} Embedding
                         */
                        Embedding.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.Embedding)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.Embedding();
                            if (object.value) {
                                if (!Array.isArray(object.value))
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.Embedding.value: array expected");
                                message.value = [];
                                for (var i = 0; i < object.value.length; ++i)
                                    message.value[i] = Number(object.value[i]);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from an Embedding message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.Embedding
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.Embedding} message Embedding
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        Embedding.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.arrays || options.defaults)
                                object.value = [];
                            if (message.value && message.value.length) {
                                object.value = [];
                                for (var j = 0; j < message.value.length; ++j)
                                    object.value[j] = options.json && !isFinite(message.value[j]) ? String(message.value[j]) : message.value[j];
                            }
                            return object;
                        };
    
                        /**
                         * Converts this Embedding to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.Embedding
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        Embedding.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for Embedding
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.Embedding
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        Embedding.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Embedding";
                        };
    
                        return Embedding;
                    })();
    
                    v1beta3.CountTextTokensRequest = (function() {
    
                        /**
                         * Properties of a CountTextTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ICountTextTokensRequest
                         * @property {string|null} [model] CountTextTokensRequest model
                         * @property {google.ai.generativelanguage.v1beta3.ITextPrompt|null} [prompt] CountTextTokensRequest prompt
                         */
    
                        /**
                         * Constructs a new CountTextTokensRequest.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a CountTextTokensRequest.
                         * @implements ICountTextTokensRequest
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest=} [properties] Properties to set
                         */
                        function CountTextTokensRequest(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTextTokensRequest model.
                         * @member {string} model
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @instance
                         */
                        CountTextTokensRequest.prototype.model = "";
    
                        /**
                         * CountTextTokensRequest prompt.
                         * @member {google.ai.generativelanguage.v1beta3.ITextPrompt|null|undefined} prompt
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @instance
                         */
                        CountTextTokensRequest.prototype.prompt = null;
    
                        /**
                         * Creates a new CountTextTokensRequest instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensRequest} CountTextTokensRequest instance
                         */
                        CountTextTokensRequest.create = function create(properties) {
                            return new CountTextTokensRequest(properties);
                        };
    
                        /**
                         * Encodes the specified CountTextTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensRequest.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest} message CountTextTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensRequest.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                                writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
                            if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
                                $root.google.ai.generativelanguage.v1beta3.TextPrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTextTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensRequest.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest} message CountTextTokensRequest message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensRequest.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTextTokensRequest message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensRequest} CountTextTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensRequest.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CountTextTokensRequest();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.model = reader.string();
                                        break;
                                    }
                                case 2: {
                                        message.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.decode(reader, reader.uint32());
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTextTokensRequest message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensRequest} CountTextTokensRequest
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensRequest.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTextTokensRequest message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTextTokensRequest.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.model != null && message.hasOwnProperty("model"))
                                if (!$util.isString(message.model))
                                    return "model: string expected";
                            if (message.prompt != null && message.hasOwnProperty("prompt")) {
                                var error = $root.google.ai.generativelanguage.v1beta3.TextPrompt.verify(message.prompt);
                                if (error)
                                    return "prompt." + error;
                            }
                            return null;
                        };
    
                        /**
                         * Creates a CountTextTokensRequest message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensRequest} CountTextTokensRequest
                         */
                        CountTextTokensRequest.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.CountTextTokensRequest)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.CountTextTokensRequest();
                            if (object.model != null)
                                message.model = String(object.model);
                            if (object.prompt != null) {
                                if (typeof object.prompt !== "object")
                                    throw TypeError(".google.ai.generativelanguage.v1beta3.CountTextTokensRequest.prompt: object expected");
                                message.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.fromObject(object.prompt);
                            }
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTextTokensRequest message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.CountTextTokensRequest} message CountTextTokensRequest
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTextTokensRequest.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults) {
                                object.model = "";
                                object.prompt = null;
                            }
                            if (message.model != null && message.hasOwnProperty("model"))
                                object.model = message.model;
                            if (message.prompt != null && message.hasOwnProperty("prompt"))
                                object.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.toObject(message.prompt, options);
                            return object;
                        };
    
                        /**
                         * Converts this CountTextTokensRequest to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTextTokensRequest.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTextTokensRequest
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTextTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CountTextTokensRequest";
                        };
    
                        return CountTextTokensRequest;
                    })();
    
                    v1beta3.CountTextTokensResponse = (function() {
    
                        /**
                         * Properties of a CountTextTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @interface ICountTextTokensResponse
                         * @property {number|null} [tokenCount] CountTextTokensResponse tokenCount
                         */
    
                        /**
                         * Constructs a new CountTextTokensResponse.
                         * @memberof google.ai.generativelanguage.v1beta3
                         * @classdesc Represents a CountTextTokensResponse.
                         * @implements ICountTextTokensResponse
                         * @constructor
                         * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensResponse=} [properties] Properties to set
                         */
                        function CountTextTokensResponse(properties) {
                            if (properties)
                                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                    if (properties[keys[i]] != null)
                                        this[keys[i]] = properties[keys[i]];
                        }
    
                        /**
                         * CountTextTokensResponse tokenCount.
                         * @member {number} tokenCount
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse
                         * @instance
                         */
                        CountTextTokensResponse.prototype.tokenCount = 0;
    
                        /**
                         * Creates a new CountTextTokensResponse instance using the specified properties.
                         * @function create
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensResponse=} [properties] Properties to set
                         * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} CountTextTokensResponse instance
                         */
                        CountTextTokensResponse.create = function create(properties) {
                            return new CountTextTokensResponse(properties);
                        };
    
                        /**
                         * Encodes the specified CountTextTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensResponse.verify|verify} messages.
                         * @function encode
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensResponse} message CountTextTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensResponse.encode = function encode(message, writer) {
                            if (!writer)
                                writer = $Writer.create();
                            if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount"))
                                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tokenCount);
                            return writer;
                        };
    
                        /**
                         * Encodes the specified CountTextTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensResponse.verify|verify} messages.
                         * @function encodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensResponse} message CountTextTokensResponse message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        CountTextTokensResponse.encodeDelimited = function encodeDelimited(message, writer) {
                            return this.encode(message, writer).ldelim();
                        };
    
                        /**
                         * Decodes a CountTextTokensResponse message from the specified reader or buffer.
                         * @function decode
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} CountTextTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensResponse.decode = function decode(reader, length) {
                            if (!(reader instanceof $Reader))
                                reader = $Reader.create(reader);
                            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CountTextTokensResponse();
                            while (reader.pos < end) {
                                var tag = reader.uint32();
                                switch (tag >>> 3) {
                                case 1: {
                                        message.tokenCount = reader.int32();
                                        break;
                                    }
                                default:
                                    reader.skipType(tag & 7);
                                    break;
                                }
                            }
                            return message;
                        };
    
                        /**
                         * Decodes a CountTextTokensResponse message from the specified reader or buffer, length delimited.
                         * @function decodeDelimited
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse
                         * @static
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} CountTextTokensResponse
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        CountTextTokensResponse.decodeDelimited = function decodeDelimited(reader) {
                            if (!(reader instanceof $Reader))
                                reader = new $Reader(reader);
                            return this.decode(reader, reader.uint32());
                        };
    
                        /**
                         * Verifies a CountTextTokensResponse message.
                         * @function verify
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse
                         * @static
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {string|null} `null` if valid, otherwise the reason why it is not
                         */
                        CountTextTokensResponse.verify = function verify(message) {
                            if (typeof message !== "object" || message === null)
                                return "object expected";
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                if (!$util.isInteger(message.tokenCount))
                                    return "tokenCount: integer expected";
                            return null;
                        };
    
                        /**
                         * Creates a CountTextTokensResponse message from a plain object. Also converts values to their respective internal types.
                         * @function fromObject
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse
                         * @static
                         * @param {Object.<string,*>} object Plain object
                         * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} CountTextTokensResponse
                         */
                        CountTextTokensResponse.fromObject = function fromObject(object) {
                            if (object instanceof $root.google.ai.generativelanguage.v1beta3.CountTextTokensResponse)
                                return object;
                            var message = new $root.google.ai.generativelanguage.v1beta3.CountTextTokensResponse();
                            if (object.tokenCount != null)
                                message.tokenCount = object.tokenCount | 0;
                            return message;
                        };
    
                        /**
                         * Creates a plain object from a CountTextTokensResponse message. Also converts values to other types if specified.
                         * @function toObject
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse
                         * @static
                         * @param {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} message CountTextTokensResponse
                         * @param {$protobuf.IConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        CountTextTokensResponse.toObject = function toObject(message, options) {
                            if (!options)
                                options = {};
                            var object = {};
                            if (options.defaults)
                                object.tokenCount = 0;
                            if (message.tokenCount != null && message.hasOwnProperty("tokenCount"))
                                object.tokenCount = message.tokenCount;
                            return object;
                        };
    
                        /**
                         * Converts this CountTextTokensResponse to JSON.
                         * @function toJSON
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse
                         * @instance
                         * @returns {Object.<string,*>} JSON object
                         */
                        CountTextTokensResponse.prototype.toJSON = function toJSON() {
                            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                        };
    
                        /**
                         * Gets the default type url for CountTextTokensResponse
                         * @function getTypeUrl
                         * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse
                         * @static
                         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                         * @returns {string} The default type url
                         */
                        CountTextTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                            if (typeUrlPrefix === undefined) {
                                typeUrlPrefix = "type.googleapis.com";
                            }
                            return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CountTextTokensResponse";
                        };
    
                        return CountTextTokensResponse;
                    })();
    
                    return v1beta3;
                })();
    
                return generativelanguage;
            })();
    
            return ai;
        })();
    
        google.api = (function() {
    
            /**
             * Namespace api.
             * @memberof google
             * @namespace
             */
            var api = {};
    
            /**
             * FieldBehavior enum.
             * @name google.api.FieldBehavior
             * @enum {number}
             * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value
             * @property {number} OPTIONAL=1 OPTIONAL value
             * @property {number} REQUIRED=2 REQUIRED value
             * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value
             * @property {number} INPUT_ONLY=4 INPUT_ONLY value
             * @property {number} IMMUTABLE=5 IMMUTABLE value
             * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value
             * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value
             * @property {number} IDENTIFIER=8 IDENTIFIER value
             */
            api.FieldBehavior = (function() {
                var valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0;
                values[valuesById[1] = "OPTIONAL"] = 1;
                values[valuesById[2] = "REQUIRED"] = 2;
                values[valuesById[3] = "OUTPUT_ONLY"] = 3;
                values[valuesById[4] = "INPUT_ONLY"] = 4;
                values[valuesById[5] = "IMMUTABLE"] = 5;
                values[valuesById[6] = "UNORDERED_LIST"] = 6;
                values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7;
                values[valuesById[8] = "IDENTIFIER"] = 8;
                return values;
            })();
    
            api.Http = (function() {
    
                /**
                 * Properties of a Http.
                 * @memberof google.api
                 * @interface IHttp
                 * @property {Array.<google.api.IHttpRule>|null} [rules] Http rules
                 * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion
                 */
    
                /**
                 * Constructs a new Http.
                 * @memberof google.api
                 * @classdesc Represents a Http.
                 * @implements IHttp
                 * @constructor
                 * @param {google.api.IHttp=} [properties] Properties to set
                 */
                function Http(properties) {
                    this.rules = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * Http rules.
                 * @member {Array.<google.api.IHttpRule>} rules
                 * @memberof google.api.Http
                 * @instance
                 */
                Http.prototype.rules = $util.emptyArray;
    
                /**
                 * Http fullyDecodeReservedExpansion.
                 * @member {boolean} fullyDecodeReservedExpansion
                 * @memberof google.api.Http
                 * @instance
                 */
                Http.prototype.fullyDecodeReservedExpansion = false;
    
                /**
                 * Creates a new Http instance using the specified properties.
                 * @function create
                 * @memberof google.api.Http
                 * @static
                 * @param {google.api.IHttp=} [properties] Properties to set
                 * @returns {google.api.Http} Http instance
                 */
                Http.create = function create(properties) {
                    return new Http(properties);
                };
    
                /**
                 * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.Http
                 * @static
                 * @param {google.api.IHttp} message Http message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Http.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.rules != null && message.rules.length)
                        for (var i = 0; i < message.rules.length; ++i)
                            $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion"))
                        writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion);
                    return writer;
                };
    
                /**
                 * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.Http
                 * @static
                 * @param {google.api.IHttp} message Http message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Http.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a Http message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.Http
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.Http} Http
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Http.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                if (!(message.rules && message.rules.length))
                                    message.rules = [];
                                message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32()));
                                break;
                            }
                        case 2: {
                                message.fullyDecodeReservedExpansion = reader.bool();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a Http message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.Http
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.Http} Http
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Http.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a Http message.
                 * @function verify
                 * @memberof google.api.Http
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                Http.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.rules != null && message.hasOwnProperty("rules")) {
                        if (!Array.isArray(message.rules))
                            return "rules: array expected";
                        for (var i = 0; i < message.rules.length; ++i) {
                            var error = $root.google.api.HttpRule.verify(message.rules[i]);
                            if (error)
                                return "rules." + error;
                        }
                    }
                    if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion"))
                        if (typeof message.fullyDecodeReservedExpansion !== "boolean")
                            return "fullyDecodeReservedExpansion: boolean expected";
                    return null;
                };
    
                /**
                 * Creates a Http message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.Http
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.Http} Http
                 */
                Http.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.Http)
                        return object;
                    var message = new $root.google.api.Http();
                    if (object.rules) {
                        if (!Array.isArray(object.rules))
                            throw TypeError(".google.api.Http.rules: array expected");
                        message.rules = [];
                        for (var i = 0; i < object.rules.length; ++i) {
                            if (typeof object.rules[i] !== "object")
                                throw TypeError(".google.api.Http.rules: object expected");
                            message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]);
                        }
                    }
                    if (object.fullyDecodeReservedExpansion != null)
                        message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion);
                    return message;
                };
    
                /**
                 * Creates a plain object from a Http message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.Http
                 * @static
                 * @param {google.api.Http} message Http
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                Http.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.rules = [];
                    if (options.defaults)
                        object.fullyDecodeReservedExpansion = false;
                    if (message.rules && message.rules.length) {
                        object.rules = [];
                        for (var j = 0; j < message.rules.length; ++j)
                            object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options);
                    }
                    if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion"))
                        object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion;
                    return object;
                };
    
                /**
                 * Converts this Http to JSON.
                 * @function toJSON
                 * @memberof google.api.Http
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                Http.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for Http
                 * @function getTypeUrl
                 * @memberof google.api.Http
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.Http";
                };
    
                return Http;
            })();
    
            api.HttpRule = (function() {
    
                /**
                 * Properties of a HttpRule.
                 * @memberof google.api
                 * @interface IHttpRule
                 * @property {string|null} [selector] HttpRule selector
                 * @property {string|null} [get] HttpRule get
                 * @property {string|null} [put] HttpRule put
                 * @property {string|null} [post] HttpRule post
                 * @property {string|null} ["delete"] HttpRule delete
                 * @property {string|null} [patch] HttpRule patch
                 * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom
                 * @property {string|null} [body] HttpRule body
                 * @property {string|null} [responseBody] HttpRule responseBody
                 * @property {Array.<google.api.IHttpRule>|null} [additionalBindings] HttpRule additionalBindings
                 */
    
                /**
                 * Constructs a new HttpRule.
                 * @memberof google.api
                 * @classdesc Represents a HttpRule.
                 * @implements IHttpRule
                 * @constructor
                 * @param {google.api.IHttpRule=} [properties] Properties to set
                 */
                function HttpRule(properties) {
                    this.additionalBindings = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * HttpRule selector.
                 * @member {string} selector
                 * @memberof google.api.HttpRule
                 * @instance
                 */
                HttpRule.prototype.selector = "";
    
                /**
                 * HttpRule get.
                 * @member {string|null|undefined} get
                 * @memberof google.api.HttpRule
                 * @instance
                 */
                HttpRule.prototype.get = null;
    
                /**
                 * HttpRule put.
                 * @member {string|null|undefined} put
                 * @memberof google.api.HttpRule
                 * @instance
                 */
                HttpRule.prototype.put = null;
    
                /**
                 * HttpRule post.
                 * @member {string|null|undefined} post
                 * @memberof google.api.HttpRule
                 * @instance
                 */
                HttpRule.prototype.post = null;
    
                /**
                 * HttpRule delete.
                 * @member {string|null|undefined} delete
                 * @memberof google.api.HttpRule
                 * @instance
                 */
                HttpRule.prototype["delete"] = null;
    
                /**
                 * HttpRule patch.
                 * @member {string|null|undefined} patch
                 * @memberof google.api.HttpRule
                 * @instance
                 */
                HttpRule.prototype.patch = null;
    
                /**
                 * HttpRule custom.
                 * @member {google.api.ICustomHttpPattern|null|undefined} custom
                 * @memberof google.api.HttpRule
                 * @instance
                 */
                HttpRule.prototype.custom = null;
    
                /**
                 * HttpRule body.
                 * @member {string} body
                 * @memberof google.api.HttpRule
                 * @instance
                 */
                HttpRule.prototype.body = "";
    
                /**
                 * HttpRule responseBody.
                 * @member {string} responseBody
                 * @memberof google.api.HttpRule
                 * @instance
                 */
                HttpRule.prototype.responseBody = "";
    
                /**
                 * HttpRule additionalBindings.
                 * @member {Array.<google.api.IHttpRule>} additionalBindings
                 * @memberof google.api.HttpRule
                 * @instance
                 */
                HttpRule.prototype.additionalBindings = $util.emptyArray;
    
                // OneOf field names bound to virtual getters and setters
                var $oneOfFields;
    
                /**
                 * HttpRule pattern.
                 * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern
                 * @memberof google.api.HttpRule
                 * @instance
                 */
                Object.defineProperty(HttpRule.prototype, "pattern", {
                    get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]),
                    set: $util.oneOfSetter($oneOfFields)
                });
    
                /**
                 * Creates a new HttpRule instance using the specified properties.
                 * @function create
                 * @memberof google.api.HttpRule
                 * @static
                 * @param {google.api.IHttpRule=} [properties] Properties to set
                 * @returns {google.api.HttpRule} HttpRule instance
                 */
                HttpRule.create = function create(properties) {
                    return new HttpRule(properties);
                };
    
                /**
                 * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.HttpRule
                 * @static
                 * @param {google.api.IHttpRule} message HttpRule message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                HttpRule.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.selector != null && Object.hasOwnProperty.call(message, "selector"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector);
                    if (message.get != null && Object.hasOwnProperty.call(message, "get"))
                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.get);
                    if (message.put != null && Object.hasOwnProperty.call(message, "put"))
                        writer.uint32(/* id 3, wireType 2 =*/26).string(message.put);
                    if (message.post != null && Object.hasOwnProperty.call(message, "post"))
                        writer.uint32(/* id 4, wireType 2 =*/34).string(message.post);
                    if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete"))
                        writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]);
                    if (message.patch != null && Object.hasOwnProperty.call(message, "patch"))
                        writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch);
                    if (message.body != null && Object.hasOwnProperty.call(message, "body"))
                        writer.uint32(/* id 7, wireType 2 =*/58).string(message.body);
                    if (message.custom != null && Object.hasOwnProperty.call(message, "custom"))
                        $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                    if (message.additionalBindings != null && message.additionalBindings.length)
                        for (var i = 0; i < message.additionalBindings.length; ++i)
                            $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
                    if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody"))
                        writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody);
                    return writer;
                };
    
                /**
                 * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.HttpRule
                 * @static
                 * @param {google.api.IHttpRule} message HttpRule message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                HttpRule.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a HttpRule message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.HttpRule
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.HttpRule} HttpRule
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                HttpRule.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.selector = reader.string();
                                break;
                            }
                        case 2: {
                                message.get = reader.string();
                                break;
                            }
                        case 3: {
                                message.put = reader.string();
                                break;
                            }
                        case 4: {
                                message.post = reader.string();
                                break;
                            }
                        case 5: {
                                message["delete"] = reader.string();
                                break;
                            }
                        case 6: {
                                message.patch = reader.string();
                                break;
                            }
                        case 8: {
                                message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32());
                                break;
                            }
                        case 7: {
                                message.body = reader.string();
                                break;
                            }
                        case 12: {
                                message.responseBody = reader.string();
                                break;
                            }
                        case 11: {
                                if (!(message.additionalBindings && message.additionalBindings.length))
                                    message.additionalBindings = [];
                                message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32()));
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a HttpRule message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.HttpRule
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.HttpRule} HttpRule
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                HttpRule.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a HttpRule message.
                 * @function verify
                 * @memberof google.api.HttpRule
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                HttpRule.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    var properties = {};
                    if (message.selector != null && message.hasOwnProperty("selector"))
                        if (!$util.isString(message.selector))
                            return "selector: string expected";
                    if (message.get != null && message.hasOwnProperty("get")) {
                        properties.pattern = 1;
                        if (!$util.isString(message.get))
                            return "get: string expected";
                    }
                    if (message.put != null && message.hasOwnProperty("put")) {
                        if (properties.pattern === 1)
                            return "pattern: multiple values";
                        properties.pattern = 1;
                        if (!$util.isString(message.put))
                            return "put: string expected";
                    }
                    if (message.post != null && message.hasOwnProperty("post")) {
                        if (properties.pattern === 1)
                            return "pattern: multiple values";
                        properties.pattern = 1;
                        if (!$util.isString(message.post))
                            return "post: string expected";
                    }
                    if (message["delete"] != null && message.hasOwnProperty("delete")) {
                        if (properties.pattern === 1)
                            return "pattern: multiple values";
                        properties.pattern = 1;
                        if (!$util.isString(message["delete"]))
                            return "delete: string expected";
                    }
                    if (message.patch != null && message.hasOwnProperty("patch")) {
                        if (properties.pattern === 1)
                            return "pattern: multiple values";
                        properties.pattern = 1;
                        if (!$util.isString(message.patch))
                            return "patch: string expected";
                    }
                    if (message.custom != null && message.hasOwnProperty("custom")) {
                        if (properties.pattern === 1)
                            return "pattern: multiple values";
                        properties.pattern = 1;
                        {
                            var error = $root.google.api.CustomHttpPattern.verify(message.custom);
                            if (error)
                                return "custom." + error;
                        }
                    }
                    if (message.body != null && message.hasOwnProperty("body"))
                        if (!$util.isString(message.body))
                            return "body: string expected";
                    if (message.responseBody != null && message.hasOwnProperty("responseBody"))
                        if (!$util.isString(message.responseBody))
                            return "responseBody: string expected";
                    if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) {
                        if (!Array.isArray(message.additionalBindings))
                            return "additionalBindings: array expected";
                        for (var i = 0; i < message.additionalBindings.length; ++i) {
                            var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]);
                            if (error)
                                return "additionalBindings." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates a HttpRule message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.HttpRule
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.HttpRule} HttpRule
                 */
                HttpRule.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.HttpRule)
                        return object;
                    var message = new $root.google.api.HttpRule();
                    if (object.selector != null)
                        message.selector = String(object.selector);
                    if (object.get != null)
                        message.get = String(object.get);
                    if (object.put != null)
                        message.put = String(object.put);
                    if (object.post != null)
                        message.post = String(object.post);
                    if (object["delete"] != null)
                        message["delete"] = String(object["delete"]);
                    if (object.patch != null)
                        message.patch = String(object.patch);
                    if (object.custom != null) {
                        if (typeof object.custom !== "object")
                            throw TypeError(".google.api.HttpRule.custom: object expected");
                        message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom);
                    }
                    if (object.body != null)
                        message.body = String(object.body);
                    if (object.responseBody != null)
                        message.responseBody = String(object.responseBody);
                    if (object.additionalBindings) {
                        if (!Array.isArray(object.additionalBindings))
                            throw TypeError(".google.api.HttpRule.additionalBindings: array expected");
                        message.additionalBindings = [];
                        for (var i = 0; i < object.additionalBindings.length; ++i) {
                            if (typeof object.additionalBindings[i] !== "object")
                                throw TypeError(".google.api.HttpRule.additionalBindings: object expected");
                            message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]);
                        }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a HttpRule message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.HttpRule
                 * @static
                 * @param {google.api.HttpRule} message HttpRule
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                HttpRule.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.additionalBindings = [];
                    if (options.defaults) {
                        object.selector = "";
                        object.body = "";
                        object.responseBody = "";
                    }
                    if (message.selector != null && message.hasOwnProperty("selector"))
                        object.selector = message.selector;
                    if (message.get != null && message.hasOwnProperty("get")) {
                        object.get = message.get;
                        if (options.oneofs)
                            object.pattern = "get";
                    }
                    if (message.put != null && message.hasOwnProperty("put")) {
                        object.put = message.put;
                        if (options.oneofs)
                            object.pattern = "put";
                    }
                    if (message.post != null && message.hasOwnProperty("post")) {
                        object.post = message.post;
                        if (options.oneofs)
                            object.pattern = "post";
                    }
                    if (message["delete"] != null && message.hasOwnProperty("delete")) {
                        object["delete"] = message["delete"];
                        if (options.oneofs)
                            object.pattern = "delete";
                    }
                    if (message.patch != null && message.hasOwnProperty("patch")) {
                        object.patch = message.patch;
                        if (options.oneofs)
                            object.pattern = "patch";
                    }
                    if (message.body != null && message.hasOwnProperty("body"))
                        object.body = message.body;
                    if (message.custom != null && message.hasOwnProperty("custom")) {
                        object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options);
                        if (options.oneofs)
                            object.pattern = "custom";
                    }
                    if (message.additionalBindings && message.additionalBindings.length) {
                        object.additionalBindings = [];
                        for (var j = 0; j < message.additionalBindings.length; ++j)
                            object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options);
                    }
                    if (message.responseBody != null && message.hasOwnProperty("responseBody"))
                        object.responseBody = message.responseBody;
                    return object;
                };
    
                /**
                 * Converts this HttpRule to JSON.
                 * @function toJSON
                 * @memberof google.api.HttpRule
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                HttpRule.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for HttpRule
                 * @function getTypeUrl
                 * @memberof google.api.HttpRule
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.HttpRule";
                };
    
                return HttpRule;
            })();
    
            api.CustomHttpPattern = (function() {
    
                /**
                 * Properties of a CustomHttpPattern.
                 * @memberof google.api
                 * @interface ICustomHttpPattern
                 * @property {string|null} [kind] CustomHttpPattern kind
                 * @property {string|null} [path] CustomHttpPattern path
                 */
    
                /**
                 * Constructs a new CustomHttpPattern.
                 * @memberof google.api
                 * @classdesc Represents a CustomHttpPattern.
                 * @implements ICustomHttpPattern
                 * @constructor
                 * @param {google.api.ICustomHttpPattern=} [properties] Properties to set
                 */
                function CustomHttpPattern(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * CustomHttpPattern kind.
                 * @member {string} kind
                 * @memberof google.api.CustomHttpPattern
                 * @instance
                 */
                CustomHttpPattern.prototype.kind = "";
    
                /**
                 * CustomHttpPattern path.
                 * @member {string} path
                 * @memberof google.api.CustomHttpPattern
                 * @instance
                 */
                CustomHttpPattern.prototype.path = "";
    
                /**
                 * Creates a new CustomHttpPattern instance using the specified properties.
                 * @function create
                 * @memberof google.api.CustomHttpPattern
                 * @static
                 * @param {google.api.ICustomHttpPattern=} [properties] Properties to set
                 * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance
                 */
                CustomHttpPattern.create = function create(properties) {
                    return new CustomHttpPattern(properties);
                };
    
                /**
                 * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.CustomHttpPattern
                 * @static
                 * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                CustomHttpPattern.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.kind != null && Object.hasOwnProperty.call(message, "kind"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind);
                    if (message.path != null && Object.hasOwnProperty.call(message, "path"))
                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.path);
                    return writer;
                };
    
                /**
                 * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.CustomHttpPattern
                 * @static
                 * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a CustomHttpPattern message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.CustomHttpPattern
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.CustomHttpPattern} CustomHttpPattern
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                CustomHttpPattern.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.kind = reader.string();
                                break;
                            }
                        case 2: {
                                message.path = reader.string();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.CustomHttpPattern
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.CustomHttpPattern} CustomHttpPattern
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a CustomHttpPattern message.
                 * @function verify
                 * @memberof google.api.CustomHttpPattern
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                CustomHttpPattern.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.kind != null && message.hasOwnProperty("kind"))
                        if (!$util.isString(message.kind))
                            return "kind: string expected";
                    if (message.path != null && message.hasOwnProperty("path"))
                        if (!$util.isString(message.path))
                            return "path: string expected";
                    return null;
                };
    
                /**
                 * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.CustomHttpPattern
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.CustomHttpPattern} CustomHttpPattern
                 */
                CustomHttpPattern.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.CustomHttpPattern)
                        return object;
                    var message = new $root.google.api.CustomHttpPattern();
                    if (object.kind != null)
                        message.kind = String(object.kind);
                    if (object.path != null)
                        message.path = String(object.path);
                    return message;
                };
    
                /**
                 * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.CustomHttpPattern
                 * @static
                 * @param {google.api.CustomHttpPattern} message CustomHttpPattern
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                CustomHttpPattern.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.kind = "";
                        object.path = "";
                    }
                    if (message.kind != null && message.hasOwnProperty("kind"))
                        object.kind = message.kind;
                    if (message.path != null && message.hasOwnProperty("path"))
                        object.path = message.path;
                    return object;
                };
    
                /**
                 * Converts this CustomHttpPattern to JSON.
                 * @function toJSON
                 * @memberof google.api.CustomHttpPattern
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                CustomHttpPattern.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for CustomHttpPattern
                 * @function getTypeUrl
                 * @memberof google.api.CustomHttpPattern
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.CustomHttpPattern";
                };
    
                return CustomHttpPattern;
            })();
    
            api.CommonLanguageSettings = (function() {
    
                /**
                 * Properties of a CommonLanguageSettings.
                 * @memberof google.api
                 * @interface ICommonLanguageSettings
                 * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri
                 * @property {Array.<google.api.ClientLibraryDestination>|null} [destinations] CommonLanguageSettings destinations
                 */
    
                /**
                 * Constructs a new CommonLanguageSettings.
                 * @memberof google.api
                 * @classdesc Represents a CommonLanguageSettings.
                 * @implements ICommonLanguageSettings
                 * @constructor
                 * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set
                 */
                function CommonLanguageSettings(properties) {
                    this.destinations = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * CommonLanguageSettings referenceDocsUri.
                 * @member {string} referenceDocsUri
                 * @memberof google.api.CommonLanguageSettings
                 * @instance
                 */
                CommonLanguageSettings.prototype.referenceDocsUri = "";
    
                /**
                 * CommonLanguageSettings destinations.
                 * @member {Array.<google.api.ClientLibraryDestination>} destinations
                 * @memberof google.api.CommonLanguageSettings
                 * @instance
                 */
                CommonLanguageSettings.prototype.destinations = $util.emptyArray;
    
                /**
                 * Creates a new CommonLanguageSettings instance using the specified properties.
                 * @function create
                 * @memberof google.api.CommonLanguageSettings
                 * @static
                 * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set
                 * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance
                 */
                CommonLanguageSettings.create = function create(properties) {
                    return new CommonLanguageSettings(properties);
                };
    
                /**
                 * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.CommonLanguageSettings
                 * @static
                 * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                CommonLanguageSettings.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri);
                    if (message.destinations != null && message.destinations.length) {
                        writer.uint32(/* id 2, wireType 2 =*/18).fork();
                        for (var i = 0; i < message.destinations.length; ++i)
                            writer.int32(message.destinations[i]);
                        writer.ldelim();
                    }
                    return writer;
                };
    
                /**
                 * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.CommonLanguageSettings
                 * @static
                 * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a CommonLanguageSettings message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.CommonLanguageSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                CommonLanguageSettings.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.referenceDocsUri = reader.string();
                                break;
                            }
                        case 2: {
                                if (!(message.destinations && message.destinations.length))
                                    message.destinations = [];
                                if ((tag & 7) === 2) {
                                    var end2 = reader.uint32() + reader.pos;
                                    while (reader.pos < end2)
                                        message.destinations.push(reader.int32());
                                } else
                                    message.destinations.push(reader.int32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.CommonLanguageSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a CommonLanguageSettings message.
                 * @function verify
                 * @memberof google.api.CommonLanguageSettings
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                CommonLanguageSettings.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri"))
                        if (!$util.isString(message.referenceDocsUri))
                            return "referenceDocsUri: string expected";
                    if (message.destinations != null && message.hasOwnProperty("destinations")) {
                        if (!Array.isArray(message.destinations))
                            return "destinations: array expected";
                        for (var i = 0; i < message.destinations.length; ++i)
                            switch (message.destinations[i]) {
                            default:
                                return "destinations: enum value[] expected";
                            case 0:
                            case 10:
                            case 20:
                                break;
                            }
                    }
                    return null;
                };
    
                /**
                 * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.CommonLanguageSettings
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings
                 */
                CommonLanguageSettings.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.CommonLanguageSettings)
                        return object;
                    var message = new $root.google.api.CommonLanguageSettings();
                    if (object.referenceDocsUri != null)
                        message.referenceDocsUri = String(object.referenceDocsUri);
                    if (object.destinations) {
                        if (!Array.isArray(object.destinations))
                            throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected");
                        message.destinations = [];
                        for (var i = 0; i < object.destinations.length; ++i)
                            switch (object.destinations[i]) {
                            default:
                                if (typeof object.destinations[i] === "number") {
                                    message.destinations[i] = object.destinations[i];
                                    break;
                                }
                            case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED":
                            case 0:
                                message.destinations[i] = 0;
                                break;
                            case "GITHUB":
                            case 10:
                                message.destinations[i] = 10;
                                break;
                            case "PACKAGE_MANAGER":
                            case 20:
                                message.destinations[i] = 20;
                                break;
                            }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.CommonLanguageSettings
                 * @static
                 * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                CommonLanguageSettings.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.destinations = [];
                    if (options.defaults)
                        object.referenceDocsUri = "";
                    if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri"))
                        object.referenceDocsUri = message.referenceDocsUri;
                    if (message.destinations && message.destinations.length) {
                        object.destinations = [];
                        for (var j = 0; j < message.destinations.length; ++j)
                            object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j];
                    }
                    return object;
                };
    
                /**
                 * Converts this CommonLanguageSettings to JSON.
                 * @function toJSON
                 * @memberof google.api.CommonLanguageSettings
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                CommonLanguageSettings.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for CommonLanguageSettings
                 * @function getTypeUrl
                 * @memberof google.api.CommonLanguageSettings
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.CommonLanguageSettings";
                };
    
                return CommonLanguageSettings;
            })();
    
            api.ClientLibrarySettings = (function() {
    
                /**
                 * Properties of a ClientLibrarySettings.
                 * @memberof google.api
                 * @interface IClientLibrarySettings
                 * @property {string|null} [version] ClientLibrarySettings version
                 * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage
                 * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums
                 * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings
                 * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings
                 * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings
                 * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings
                 * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings
                 * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings
                 * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings
                 * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings
                 */
    
                /**
                 * Constructs a new ClientLibrarySettings.
                 * @memberof google.api
                 * @classdesc Represents a ClientLibrarySettings.
                 * @implements IClientLibrarySettings
                 * @constructor
                 * @param {google.api.IClientLibrarySettings=} [properties] Properties to set
                 */
                function ClientLibrarySettings(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * ClientLibrarySettings version.
                 * @member {string} version
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 */
                ClientLibrarySettings.prototype.version = "";
    
                /**
                 * ClientLibrarySettings launchStage.
                 * @member {google.api.LaunchStage} launchStage
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 */
                ClientLibrarySettings.prototype.launchStage = 0;
    
                /**
                 * ClientLibrarySettings restNumericEnums.
                 * @member {boolean} restNumericEnums
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 */
                ClientLibrarySettings.prototype.restNumericEnums = false;
    
                /**
                 * ClientLibrarySettings javaSettings.
                 * @member {google.api.IJavaSettings|null|undefined} javaSettings
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 */
                ClientLibrarySettings.prototype.javaSettings = null;
    
                /**
                 * ClientLibrarySettings cppSettings.
                 * @member {google.api.ICppSettings|null|undefined} cppSettings
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 */
                ClientLibrarySettings.prototype.cppSettings = null;
    
                /**
                 * ClientLibrarySettings phpSettings.
                 * @member {google.api.IPhpSettings|null|undefined} phpSettings
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 */
                ClientLibrarySettings.prototype.phpSettings = null;
    
                /**
                 * ClientLibrarySettings pythonSettings.
                 * @member {google.api.IPythonSettings|null|undefined} pythonSettings
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 */
                ClientLibrarySettings.prototype.pythonSettings = null;
    
                /**
                 * ClientLibrarySettings nodeSettings.
                 * @member {google.api.INodeSettings|null|undefined} nodeSettings
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 */
                ClientLibrarySettings.prototype.nodeSettings = null;
    
                /**
                 * ClientLibrarySettings dotnetSettings.
                 * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 */
                ClientLibrarySettings.prototype.dotnetSettings = null;
    
                /**
                 * ClientLibrarySettings rubySettings.
                 * @member {google.api.IRubySettings|null|undefined} rubySettings
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 */
                ClientLibrarySettings.prototype.rubySettings = null;
    
                /**
                 * ClientLibrarySettings goSettings.
                 * @member {google.api.IGoSettings|null|undefined} goSettings
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 */
                ClientLibrarySettings.prototype.goSettings = null;
    
                /**
                 * Creates a new ClientLibrarySettings instance using the specified properties.
                 * @function create
                 * @memberof google.api.ClientLibrarySettings
                 * @static
                 * @param {google.api.IClientLibrarySettings=} [properties] Properties to set
                 * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance
                 */
                ClientLibrarySettings.create = function create(properties) {
                    return new ClientLibrarySettings(properties);
                };
    
                /**
                 * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.ClientLibrarySettings
                 * @static
                 * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ClientLibrarySettings.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.version);
                    if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage"))
                        writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage);
                    if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums"))
                        writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums);
                    if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings"))
                        $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim();
                    if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings"))
                        $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim();
                    if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings"))
                        $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim();
                    if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings"))
                        $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim();
                    if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings"))
                        $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim();
                    if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings"))
                        $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim();
                    if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings"))
                        $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim();
                    if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings"))
                        $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.ClientLibrarySettings
                 * @static
                 * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a ClientLibrarySettings message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.ClientLibrarySettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ClientLibrarySettings.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.version = reader.string();
                                break;
                            }
                        case 2: {
                                message.launchStage = reader.int32();
                                break;
                            }
                        case 3: {
                                message.restNumericEnums = reader.bool();
                                break;
                            }
                        case 21: {
                                message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32());
                                break;
                            }
                        case 22: {
                                message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32());
                                break;
                            }
                        case 23: {
                                message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32());
                                break;
                            }
                        case 24: {
                                message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32());
                                break;
                            }
                        case 25: {
                                message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32());
                                break;
                            }
                        case 26: {
                                message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32());
                                break;
                            }
                        case 27: {
                                message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32());
                                break;
                            }
                        case 28: {
                                message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.ClientLibrarySettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a ClientLibrarySettings message.
                 * @function verify
                 * @memberof google.api.ClientLibrarySettings
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                ClientLibrarySettings.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.version != null && message.hasOwnProperty("version"))
                        if (!$util.isString(message.version))
                            return "version: string expected";
                    if (message.launchStage != null && message.hasOwnProperty("launchStage"))
                        switch (message.launchStage) {
                        default:
                            return "launchStage: enum value expected";
                        case 0:
                        case 6:
                        case 7:
                        case 1:
                        case 2:
                        case 3:
                        case 4:
                        case 5:
                            break;
                        }
                    if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums"))
                        if (typeof message.restNumericEnums !== "boolean")
                            return "restNumericEnums: boolean expected";
                    if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) {
                        var error = $root.google.api.JavaSettings.verify(message.javaSettings);
                        if (error)
                            return "javaSettings." + error;
                    }
                    if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) {
                        var error = $root.google.api.CppSettings.verify(message.cppSettings);
                        if (error)
                            return "cppSettings." + error;
                    }
                    if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) {
                        var error = $root.google.api.PhpSettings.verify(message.phpSettings);
                        if (error)
                            return "phpSettings." + error;
                    }
                    if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) {
                        var error = $root.google.api.PythonSettings.verify(message.pythonSettings);
                        if (error)
                            return "pythonSettings." + error;
                    }
                    if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) {
                        var error = $root.google.api.NodeSettings.verify(message.nodeSettings);
                        if (error)
                            return "nodeSettings." + error;
                    }
                    if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) {
                        var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings);
                        if (error)
                            return "dotnetSettings." + error;
                    }
                    if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) {
                        var error = $root.google.api.RubySettings.verify(message.rubySettings);
                        if (error)
                            return "rubySettings." + error;
                    }
                    if (message.goSettings != null && message.hasOwnProperty("goSettings")) {
                        var error = $root.google.api.GoSettings.verify(message.goSettings);
                        if (error)
                            return "goSettings." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.ClientLibrarySettings
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings
                 */
                ClientLibrarySettings.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.ClientLibrarySettings)
                        return object;
                    var message = new $root.google.api.ClientLibrarySettings();
                    if (object.version != null)
                        message.version = String(object.version);
                    switch (object.launchStage) {
                    default:
                        if (typeof object.launchStage === "number") {
                            message.launchStage = object.launchStage;
                            break;
                        }
                        break;
                    case "LAUNCH_STAGE_UNSPECIFIED":
                    case 0:
                        message.launchStage = 0;
                        break;
                    case "UNIMPLEMENTED":
                    case 6:
                        message.launchStage = 6;
                        break;
                    case "PRELAUNCH":
                    case 7:
                        message.launchStage = 7;
                        break;
                    case "EARLY_ACCESS":
                    case 1:
                        message.launchStage = 1;
                        break;
                    case "ALPHA":
                    case 2:
                        message.launchStage = 2;
                        break;
                    case "BETA":
                    case 3:
                        message.launchStage = 3;
                        break;
                    case "GA":
                    case 4:
                        message.launchStage = 4;
                        break;
                    case "DEPRECATED":
                    case 5:
                        message.launchStage = 5;
                        break;
                    }
                    if (object.restNumericEnums != null)
                        message.restNumericEnums = Boolean(object.restNumericEnums);
                    if (object.javaSettings != null) {
                        if (typeof object.javaSettings !== "object")
                            throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected");
                        message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings);
                    }
                    if (object.cppSettings != null) {
                        if (typeof object.cppSettings !== "object")
                            throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected");
                        message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings);
                    }
                    if (object.phpSettings != null) {
                        if (typeof object.phpSettings !== "object")
                            throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected");
                        message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings);
                    }
                    if (object.pythonSettings != null) {
                        if (typeof object.pythonSettings !== "object")
                            throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected");
                        message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings);
                    }
                    if (object.nodeSettings != null) {
                        if (typeof object.nodeSettings !== "object")
                            throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected");
                        message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings);
                    }
                    if (object.dotnetSettings != null) {
                        if (typeof object.dotnetSettings !== "object")
                            throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected");
                        message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings);
                    }
                    if (object.rubySettings != null) {
                        if (typeof object.rubySettings !== "object")
                            throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected");
                        message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings);
                    }
                    if (object.goSettings != null) {
                        if (typeof object.goSettings !== "object")
                            throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected");
                        message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.ClientLibrarySettings
                 * @static
                 * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                ClientLibrarySettings.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.version = "";
                        object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0;
                        object.restNumericEnums = false;
                        object.javaSettings = null;
                        object.cppSettings = null;
                        object.phpSettings = null;
                        object.pythonSettings = null;
                        object.nodeSettings = null;
                        object.dotnetSettings = null;
                        object.rubySettings = null;
                        object.goSettings = null;
                    }
                    if (message.version != null && message.hasOwnProperty("version"))
                        object.version = message.version;
                    if (message.launchStage != null && message.hasOwnProperty("launchStage"))
                        object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage;
                    if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums"))
                        object.restNumericEnums = message.restNumericEnums;
                    if (message.javaSettings != null && message.hasOwnProperty("javaSettings"))
                        object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options);
                    if (message.cppSettings != null && message.hasOwnProperty("cppSettings"))
                        object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options);
                    if (message.phpSettings != null && message.hasOwnProperty("phpSettings"))
                        object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options);
                    if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings"))
                        object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options);
                    if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings"))
                        object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options);
                    if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings"))
                        object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options);
                    if (message.rubySettings != null && message.hasOwnProperty("rubySettings"))
                        object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options);
                    if (message.goSettings != null && message.hasOwnProperty("goSettings"))
                        object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options);
                    return object;
                };
    
                /**
                 * Converts this ClientLibrarySettings to JSON.
                 * @function toJSON
                 * @memberof google.api.ClientLibrarySettings
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                ClientLibrarySettings.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for ClientLibrarySettings
                 * @function getTypeUrl
                 * @memberof google.api.ClientLibrarySettings
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.ClientLibrarySettings";
                };
    
                return ClientLibrarySettings;
            })();
    
            api.Publishing = (function() {
    
                /**
                 * Properties of a Publishing.
                 * @memberof google.api
                 * @interface IPublishing
                 * @property {Array.<google.api.IMethodSettings>|null} [methodSettings] Publishing methodSettings
                 * @property {string|null} [newIssueUri] Publishing newIssueUri
                 * @property {string|null} [documentationUri] Publishing documentationUri
                 * @property {string|null} [apiShortName] Publishing apiShortName
                 * @property {string|null} [githubLabel] Publishing githubLabel
                 * @property {Array.<string>|null} [codeownerGithubTeams] Publishing codeownerGithubTeams
                 * @property {string|null} [docTagPrefix] Publishing docTagPrefix
                 * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization
                 * @property {Array.<google.api.IClientLibrarySettings>|null} [librarySettings] Publishing librarySettings
                 * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri
                 */
    
                /**
                 * Constructs a new Publishing.
                 * @memberof google.api
                 * @classdesc Represents a Publishing.
                 * @implements IPublishing
                 * @constructor
                 * @param {google.api.IPublishing=} [properties] Properties to set
                 */
                function Publishing(properties) {
                    this.methodSettings = [];
                    this.codeownerGithubTeams = [];
                    this.librarySettings = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * Publishing methodSettings.
                 * @member {Array.<google.api.IMethodSettings>} methodSettings
                 * @memberof google.api.Publishing
                 * @instance
                 */
                Publishing.prototype.methodSettings = $util.emptyArray;
    
                /**
                 * Publishing newIssueUri.
                 * @member {string} newIssueUri
                 * @memberof google.api.Publishing
                 * @instance
                 */
                Publishing.prototype.newIssueUri = "";
    
                /**
                 * Publishing documentationUri.
                 * @member {string} documentationUri
                 * @memberof google.api.Publishing
                 * @instance
                 */
                Publishing.prototype.documentationUri = "";
    
                /**
                 * Publishing apiShortName.
                 * @member {string} apiShortName
                 * @memberof google.api.Publishing
                 * @instance
                 */
                Publishing.prototype.apiShortName = "";
    
                /**
                 * Publishing githubLabel.
                 * @member {string} githubLabel
                 * @memberof google.api.Publishing
                 * @instance
                 */
                Publishing.prototype.githubLabel = "";
    
                /**
                 * Publishing codeownerGithubTeams.
                 * @member {Array.<string>} codeownerGithubTeams
                 * @memberof google.api.Publishing
                 * @instance
                 */
                Publishing.prototype.codeownerGithubTeams = $util.emptyArray;
    
                /**
                 * Publishing docTagPrefix.
                 * @member {string} docTagPrefix
                 * @memberof google.api.Publishing
                 * @instance
                 */
                Publishing.prototype.docTagPrefix = "";
    
                /**
                 * Publishing organization.
                 * @member {google.api.ClientLibraryOrganization} organization
                 * @memberof google.api.Publishing
                 * @instance
                 */
                Publishing.prototype.organization = 0;
    
                /**
                 * Publishing librarySettings.
                 * @member {Array.<google.api.IClientLibrarySettings>} librarySettings
                 * @memberof google.api.Publishing
                 * @instance
                 */
                Publishing.prototype.librarySettings = $util.emptyArray;
    
                /**
                 * Publishing protoReferenceDocumentationUri.
                 * @member {string} protoReferenceDocumentationUri
                 * @memberof google.api.Publishing
                 * @instance
                 */
                Publishing.prototype.protoReferenceDocumentationUri = "";
    
                /**
                 * Creates a new Publishing instance using the specified properties.
                 * @function create
                 * @memberof google.api.Publishing
                 * @static
                 * @param {google.api.IPublishing=} [properties] Properties to set
                 * @returns {google.api.Publishing} Publishing instance
                 */
                Publishing.create = function create(properties) {
                    return new Publishing(properties);
                };
    
                /**
                 * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.Publishing
                 * @static
                 * @param {google.api.IPublishing} message Publishing message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Publishing.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.methodSettings != null && message.methodSettings.length)
                        for (var i = 0; i < message.methodSettings.length; ++i)
                            $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                    if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri"))
                        writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri);
                    if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri"))
                        writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri);
                    if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName"))
                        writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName);
                    if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel"))
                        writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel);
                    if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length)
                        for (var i = 0; i < message.codeownerGithubTeams.length; ++i)
                            writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]);
                    if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix"))
                        writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix);
                    if (message.organization != null && Object.hasOwnProperty.call(message, "organization"))
                        writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization);
                    if (message.librarySettings != null && message.librarySettings.length)
                        for (var i = 0; i < message.librarySettings.length; ++i)
                            $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim();
                    if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri"))
                        writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri);
                    return writer;
                };
    
                /**
                 * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.Publishing
                 * @static
                 * @param {google.api.IPublishing} message Publishing message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Publishing.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a Publishing message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.Publishing
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.Publishing} Publishing
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Publishing.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 2: {
                                if (!(message.methodSettings && message.methodSettings.length))
                                    message.methodSettings = [];
                                message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32()));
                                break;
                            }
                        case 101: {
                                message.newIssueUri = reader.string();
                                break;
                            }
                        case 102: {
                                message.documentationUri = reader.string();
                                break;
                            }
                        case 103: {
                                message.apiShortName = reader.string();
                                break;
                            }
                        case 104: {
                                message.githubLabel = reader.string();
                                break;
                            }
                        case 105: {
                                if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length))
                                    message.codeownerGithubTeams = [];
                                message.codeownerGithubTeams.push(reader.string());
                                break;
                            }
                        case 106: {
                                message.docTagPrefix = reader.string();
                                break;
                            }
                        case 107: {
                                message.organization = reader.int32();
                                break;
                            }
                        case 109: {
                                if (!(message.librarySettings && message.librarySettings.length))
                                    message.librarySettings = [];
                                message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32()));
                                break;
                            }
                        case 110: {
                                message.protoReferenceDocumentationUri = reader.string();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a Publishing message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.Publishing
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.Publishing} Publishing
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Publishing.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a Publishing message.
                 * @function verify
                 * @memberof google.api.Publishing
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                Publishing.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) {
                        if (!Array.isArray(message.methodSettings))
                            return "methodSettings: array expected";
                        for (var i = 0; i < message.methodSettings.length; ++i) {
                            var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]);
                            if (error)
                                return "methodSettings." + error;
                        }
                    }
                    if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri"))
                        if (!$util.isString(message.newIssueUri))
                            return "newIssueUri: string expected";
                    if (message.documentationUri != null && message.hasOwnProperty("documentationUri"))
                        if (!$util.isString(message.documentationUri))
                            return "documentationUri: string expected";
                    if (message.apiShortName != null && message.hasOwnProperty("apiShortName"))
                        if (!$util.isString(message.apiShortName))
                            return "apiShortName: string expected";
                    if (message.githubLabel != null && message.hasOwnProperty("githubLabel"))
                        if (!$util.isString(message.githubLabel))
                            return "githubLabel: string expected";
                    if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) {
                        if (!Array.isArray(message.codeownerGithubTeams))
                            return "codeownerGithubTeams: array expected";
                        for (var i = 0; i < message.codeownerGithubTeams.length; ++i)
                            if (!$util.isString(message.codeownerGithubTeams[i]))
                                return "codeownerGithubTeams: string[] expected";
                    }
                    if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix"))
                        if (!$util.isString(message.docTagPrefix))
                            return "docTagPrefix: string expected";
                    if (message.organization != null && message.hasOwnProperty("organization"))
                        switch (message.organization) {
                        default:
                            return "organization: enum value expected";
                        case 0:
                        case 1:
                        case 2:
                        case 3:
                        case 4:
                        case 5:
                        case 6:
                        case 7:
                            break;
                        }
                    if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) {
                        if (!Array.isArray(message.librarySettings))
                            return "librarySettings: array expected";
                        for (var i = 0; i < message.librarySettings.length; ++i) {
                            var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]);
                            if (error)
                                return "librarySettings." + error;
                        }
                    }
                    if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri"))
                        if (!$util.isString(message.protoReferenceDocumentationUri))
                            return "protoReferenceDocumentationUri: string expected";
                    return null;
                };
    
                /**
                 * Creates a Publishing message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.Publishing
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.Publishing} Publishing
                 */
                Publishing.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.Publishing)
                        return object;
                    var message = new $root.google.api.Publishing();
                    if (object.methodSettings) {
                        if (!Array.isArray(object.methodSettings))
                            throw TypeError(".google.api.Publishing.methodSettings: array expected");
                        message.methodSettings = [];
                        for (var i = 0; i < object.methodSettings.length; ++i) {
                            if (typeof object.methodSettings[i] !== "object")
                                throw TypeError(".google.api.Publishing.methodSettings: object expected");
                            message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]);
                        }
                    }
                    if (object.newIssueUri != null)
                        message.newIssueUri = String(object.newIssueUri);
                    if (object.documentationUri != null)
                        message.documentationUri = String(object.documentationUri);
                    if (object.apiShortName != null)
                        message.apiShortName = String(object.apiShortName);
                    if (object.githubLabel != null)
                        message.githubLabel = String(object.githubLabel);
                    if (object.codeownerGithubTeams) {
                        if (!Array.isArray(object.codeownerGithubTeams))
                            throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected");
                        message.codeownerGithubTeams = [];
                        for (var i = 0; i < object.codeownerGithubTeams.length; ++i)
                            message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]);
                    }
                    if (object.docTagPrefix != null)
                        message.docTagPrefix = String(object.docTagPrefix);
                    switch (object.organization) {
                    default:
                        if (typeof object.organization === "number") {
                            message.organization = object.organization;
                            break;
                        }
                        break;
                    case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED":
                    case 0:
                        message.organization = 0;
                        break;
                    case "CLOUD":
                    case 1:
                        message.organization = 1;
                        break;
                    case "ADS":
                    case 2:
                        message.organization = 2;
                        break;
                    case "PHOTOS":
                    case 3:
                        message.organization = 3;
                        break;
                    case "STREET_VIEW":
                    case 4:
                        message.organization = 4;
                        break;
                    case "SHOPPING":
                    case 5:
                        message.organization = 5;
                        break;
                    case "GEO":
                    case 6:
                        message.organization = 6;
                        break;
                    case "GENERATIVE_AI":
                    case 7:
                        message.organization = 7;
                        break;
                    }
                    if (object.librarySettings) {
                        if (!Array.isArray(object.librarySettings))
                            throw TypeError(".google.api.Publishing.librarySettings: array expected");
                        message.librarySettings = [];
                        for (var i = 0; i < object.librarySettings.length; ++i) {
                            if (typeof object.librarySettings[i] !== "object")
                                throw TypeError(".google.api.Publishing.librarySettings: object expected");
                            message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]);
                        }
                    }
                    if (object.protoReferenceDocumentationUri != null)
                        message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri);
                    return message;
                };
    
                /**
                 * Creates a plain object from a Publishing message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.Publishing
                 * @static
                 * @param {google.api.Publishing} message Publishing
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                Publishing.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults) {
                        object.methodSettings = [];
                        object.codeownerGithubTeams = [];
                        object.librarySettings = [];
                    }
                    if (options.defaults) {
                        object.newIssueUri = "";
                        object.documentationUri = "";
                        object.apiShortName = "";
                        object.githubLabel = "";
                        object.docTagPrefix = "";
                        object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0;
                        object.protoReferenceDocumentationUri = "";
                    }
                    if (message.methodSettings && message.methodSettings.length) {
                        object.methodSettings = [];
                        for (var j = 0; j < message.methodSettings.length; ++j)
                            object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options);
                    }
                    if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri"))
                        object.newIssueUri = message.newIssueUri;
                    if (message.documentationUri != null && message.hasOwnProperty("documentationUri"))
                        object.documentationUri = message.documentationUri;
                    if (message.apiShortName != null && message.hasOwnProperty("apiShortName"))
                        object.apiShortName = message.apiShortName;
                    if (message.githubLabel != null && message.hasOwnProperty("githubLabel"))
                        object.githubLabel = message.githubLabel;
                    if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) {
                        object.codeownerGithubTeams = [];
                        for (var j = 0; j < message.codeownerGithubTeams.length; ++j)
                            object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j];
                    }
                    if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix"))
                        object.docTagPrefix = message.docTagPrefix;
                    if (message.organization != null && message.hasOwnProperty("organization"))
                        object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization;
                    if (message.librarySettings && message.librarySettings.length) {
                        object.librarySettings = [];
                        for (var j = 0; j < message.librarySettings.length; ++j)
                            object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options);
                    }
                    if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri"))
                        object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri;
                    return object;
                };
    
                /**
                 * Converts this Publishing to JSON.
                 * @function toJSON
                 * @memberof google.api.Publishing
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                Publishing.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for Publishing
                 * @function getTypeUrl
                 * @memberof google.api.Publishing
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.Publishing";
                };
    
                return Publishing;
            })();
    
            api.JavaSettings = (function() {
    
                /**
                 * Properties of a JavaSettings.
                 * @memberof google.api
                 * @interface IJavaSettings
                 * @property {string|null} [libraryPackage] JavaSettings libraryPackage
                 * @property {Object.<string,string>|null} [serviceClassNames] JavaSettings serviceClassNames
                 * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common
                 */
    
                /**
                 * Constructs a new JavaSettings.
                 * @memberof google.api
                 * @classdesc Represents a JavaSettings.
                 * @implements IJavaSettings
                 * @constructor
                 * @param {google.api.IJavaSettings=} [properties] Properties to set
                 */
                function JavaSettings(properties) {
                    this.serviceClassNames = {};
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * JavaSettings libraryPackage.
                 * @member {string} libraryPackage
                 * @memberof google.api.JavaSettings
                 * @instance
                 */
                JavaSettings.prototype.libraryPackage = "";
    
                /**
                 * JavaSettings serviceClassNames.
                 * @member {Object.<string,string>} serviceClassNames
                 * @memberof google.api.JavaSettings
                 * @instance
                 */
                JavaSettings.prototype.serviceClassNames = $util.emptyObject;
    
                /**
                 * JavaSettings common.
                 * @member {google.api.ICommonLanguageSettings|null|undefined} common
                 * @memberof google.api.JavaSettings
                 * @instance
                 */
                JavaSettings.prototype.common = null;
    
                /**
                 * Creates a new JavaSettings instance using the specified properties.
                 * @function create
                 * @memberof google.api.JavaSettings
                 * @static
                 * @param {google.api.IJavaSettings=} [properties] Properties to set
                 * @returns {google.api.JavaSettings} JavaSettings instance
                 */
                JavaSettings.create = function create(properties) {
                    return new JavaSettings(properties);
                };
    
                /**
                 * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.JavaSettings
                 * @static
                 * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                JavaSettings.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage);
                    if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames"))
                        for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i)
                            writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim();
                    if (message.common != null && Object.hasOwnProperty.call(message, "common"))
                        $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.JavaSettings
                 * @static
                 * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                JavaSettings.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a JavaSettings message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.JavaSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.JavaSettings} JavaSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                JavaSettings.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value;
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.libraryPackage = reader.string();
                                break;
                            }
                        case 2: {
                                if (message.serviceClassNames === $util.emptyObject)
                                    message.serviceClassNames = {};
                                var end2 = reader.uint32() + reader.pos;
                                key = "";
                                value = "";
                                while (reader.pos < end2) {
                                    var tag2 = reader.uint32();
                                    switch (tag2 >>> 3) {
                                    case 1:
                                        key = reader.string();
                                        break;
                                    case 2:
                                        value = reader.string();
                                        break;
                                    default:
                                        reader.skipType(tag2 & 7);
                                        break;
                                    }
                                }
                                message.serviceClassNames[key] = value;
                                break;
                            }
                        case 3: {
                                message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a JavaSettings message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.JavaSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.JavaSettings} JavaSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                JavaSettings.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a JavaSettings message.
                 * @function verify
                 * @memberof google.api.JavaSettings
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                JavaSettings.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage"))
                        if (!$util.isString(message.libraryPackage))
                            return "libraryPackage: string expected";
                    if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) {
                        if (!$util.isObject(message.serviceClassNames))
                            return "serviceClassNames: object expected";
                        var key = Object.keys(message.serviceClassNames);
                        for (var i = 0; i < key.length; ++i)
                            if (!$util.isString(message.serviceClassNames[key[i]]))
                                return "serviceClassNames: string{k:string} expected";
                    }
                    if (message.common != null && message.hasOwnProperty("common")) {
                        var error = $root.google.api.CommonLanguageSettings.verify(message.common);
                        if (error)
                            return "common." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.JavaSettings
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.JavaSettings} JavaSettings
                 */
                JavaSettings.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.JavaSettings)
                        return object;
                    var message = new $root.google.api.JavaSettings();
                    if (object.libraryPackage != null)
                        message.libraryPackage = String(object.libraryPackage);
                    if (object.serviceClassNames) {
                        if (typeof object.serviceClassNames !== "object")
                            throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected");
                        message.serviceClassNames = {};
                        for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i)
                            message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]);
                    }
                    if (object.common != null) {
                        if (typeof object.common !== "object")
                            throw TypeError(".google.api.JavaSettings.common: object expected");
                        message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a JavaSettings message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.JavaSettings
                 * @static
                 * @param {google.api.JavaSettings} message JavaSettings
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                JavaSettings.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.objects || options.defaults)
                        object.serviceClassNames = {};
                    if (options.defaults) {
                        object.libraryPackage = "";
                        object.common = null;
                    }
                    if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage"))
                        object.libraryPackage = message.libraryPackage;
                    var keys2;
                    if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) {
                        object.serviceClassNames = {};
                        for (var j = 0; j < keys2.length; ++j)
                            object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]];
                    }
                    if (message.common != null && message.hasOwnProperty("common"))
                        object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);
                    return object;
                };
    
                /**
                 * Converts this JavaSettings to JSON.
                 * @function toJSON
                 * @memberof google.api.JavaSettings
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                JavaSettings.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for JavaSettings
                 * @function getTypeUrl
                 * @memberof google.api.JavaSettings
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.JavaSettings";
                };
    
                return JavaSettings;
            })();
    
            api.CppSettings = (function() {
    
                /**
                 * Properties of a CppSettings.
                 * @memberof google.api
                 * @interface ICppSettings
                 * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common
                 */
    
                /**
                 * Constructs a new CppSettings.
                 * @memberof google.api
                 * @classdesc Represents a CppSettings.
                 * @implements ICppSettings
                 * @constructor
                 * @param {google.api.ICppSettings=} [properties] Properties to set
                 */
                function CppSettings(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * CppSettings common.
                 * @member {google.api.ICommonLanguageSettings|null|undefined} common
                 * @memberof google.api.CppSettings
                 * @instance
                 */
                CppSettings.prototype.common = null;
    
                /**
                 * Creates a new CppSettings instance using the specified properties.
                 * @function create
                 * @memberof google.api.CppSettings
                 * @static
                 * @param {google.api.ICppSettings=} [properties] Properties to set
                 * @returns {google.api.CppSettings} CppSettings instance
                 */
                CppSettings.create = function create(properties) {
                    return new CppSettings(properties);
                };
    
                /**
                 * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.CppSettings
                 * @static
                 * @param {google.api.ICppSettings} message CppSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                CppSettings.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.common != null && Object.hasOwnProperty.call(message, "common"))
                        $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.CppSettings
                 * @static
                 * @param {google.api.ICppSettings} message CppSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                CppSettings.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a CppSettings message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.CppSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.CppSettings} CppSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                CppSettings.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a CppSettings message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.CppSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.CppSettings} CppSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                CppSettings.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a CppSettings message.
                 * @function verify
                 * @memberof google.api.CppSettings
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                CppSettings.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.common != null && message.hasOwnProperty("common")) {
                        var error = $root.google.api.CommonLanguageSettings.verify(message.common);
                        if (error)
                            return "common." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a CppSettings message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.CppSettings
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.CppSettings} CppSettings
                 */
                CppSettings.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.CppSettings)
                        return object;
                    var message = new $root.google.api.CppSettings();
                    if (object.common != null) {
                        if (typeof object.common !== "object")
                            throw TypeError(".google.api.CppSettings.common: object expected");
                        message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a CppSettings message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.CppSettings
                 * @static
                 * @param {google.api.CppSettings} message CppSettings
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                CppSettings.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults)
                        object.common = null;
                    if (message.common != null && message.hasOwnProperty("common"))
                        object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);
                    return object;
                };
    
                /**
                 * Converts this CppSettings to JSON.
                 * @function toJSON
                 * @memberof google.api.CppSettings
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                CppSettings.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for CppSettings
                 * @function getTypeUrl
                 * @memberof google.api.CppSettings
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.CppSettings";
                };
    
                return CppSettings;
            })();
    
            api.PhpSettings = (function() {
    
                /**
                 * Properties of a PhpSettings.
                 * @memberof google.api
                 * @interface IPhpSettings
                 * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common
                 */
    
                /**
                 * Constructs a new PhpSettings.
                 * @memberof google.api
                 * @classdesc Represents a PhpSettings.
                 * @implements IPhpSettings
                 * @constructor
                 * @param {google.api.IPhpSettings=} [properties] Properties to set
                 */
                function PhpSettings(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * PhpSettings common.
                 * @member {google.api.ICommonLanguageSettings|null|undefined} common
                 * @memberof google.api.PhpSettings
                 * @instance
                 */
                PhpSettings.prototype.common = null;
    
                /**
                 * Creates a new PhpSettings instance using the specified properties.
                 * @function create
                 * @memberof google.api.PhpSettings
                 * @static
                 * @param {google.api.IPhpSettings=} [properties] Properties to set
                 * @returns {google.api.PhpSettings} PhpSettings instance
                 */
                PhpSettings.create = function create(properties) {
                    return new PhpSettings(properties);
                };
    
                /**
                 * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.PhpSettings
                 * @static
                 * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                PhpSettings.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.common != null && Object.hasOwnProperty.call(message, "common"))
                        $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.PhpSettings
                 * @static
                 * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                PhpSettings.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a PhpSettings message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.PhpSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.PhpSettings} PhpSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                PhpSettings.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a PhpSettings message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.PhpSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.PhpSettings} PhpSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                PhpSettings.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a PhpSettings message.
                 * @function verify
                 * @memberof google.api.PhpSettings
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                PhpSettings.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.common != null && message.hasOwnProperty("common")) {
                        var error = $root.google.api.CommonLanguageSettings.verify(message.common);
                        if (error)
                            return "common." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.PhpSettings
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.PhpSettings} PhpSettings
                 */
                PhpSettings.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.PhpSettings)
                        return object;
                    var message = new $root.google.api.PhpSettings();
                    if (object.common != null) {
                        if (typeof object.common !== "object")
                            throw TypeError(".google.api.PhpSettings.common: object expected");
                        message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a PhpSettings message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.PhpSettings
                 * @static
                 * @param {google.api.PhpSettings} message PhpSettings
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                PhpSettings.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults)
                        object.common = null;
                    if (message.common != null && message.hasOwnProperty("common"))
                        object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);
                    return object;
                };
    
                /**
                 * Converts this PhpSettings to JSON.
                 * @function toJSON
                 * @memberof google.api.PhpSettings
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                PhpSettings.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for PhpSettings
                 * @function getTypeUrl
                 * @memberof google.api.PhpSettings
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.PhpSettings";
                };
    
                return PhpSettings;
            })();
    
            api.PythonSettings = (function() {
    
                /**
                 * Properties of a PythonSettings.
                 * @memberof google.api
                 * @interface IPythonSettings
                 * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common
                 */
    
                /**
                 * Constructs a new PythonSettings.
                 * @memberof google.api
                 * @classdesc Represents a PythonSettings.
                 * @implements IPythonSettings
                 * @constructor
                 * @param {google.api.IPythonSettings=} [properties] Properties to set
                 */
                function PythonSettings(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * PythonSettings common.
                 * @member {google.api.ICommonLanguageSettings|null|undefined} common
                 * @memberof google.api.PythonSettings
                 * @instance
                 */
                PythonSettings.prototype.common = null;
    
                /**
                 * Creates a new PythonSettings instance using the specified properties.
                 * @function create
                 * @memberof google.api.PythonSettings
                 * @static
                 * @param {google.api.IPythonSettings=} [properties] Properties to set
                 * @returns {google.api.PythonSettings} PythonSettings instance
                 */
                PythonSettings.create = function create(properties) {
                    return new PythonSettings(properties);
                };
    
                /**
                 * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.PythonSettings
                 * @static
                 * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                PythonSettings.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.common != null && Object.hasOwnProperty.call(message, "common"))
                        $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.PythonSettings
                 * @static
                 * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                PythonSettings.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a PythonSettings message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.PythonSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.PythonSettings} PythonSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                PythonSettings.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a PythonSettings message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.PythonSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.PythonSettings} PythonSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                PythonSettings.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a PythonSettings message.
                 * @function verify
                 * @memberof google.api.PythonSettings
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                PythonSettings.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.common != null && message.hasOwnProperty("common")) {
                        var error = $root.google.api.CommonLanguageSettings.verify(message.common);
                        if (error)
                            return "common." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.PythonSettings
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.PythonSettings} PythonSettings
                 */
                PythonSettings.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.PythonSettings)
                        return object;
                    var message = new $root.google.api.PythonSettings();
                    if (object.common != null) {
                        if (typeof object.common !== "object")
                            throw TypeError(".google.api.PythonSettings.common: object expected");
                        message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a PythonSettings message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.PythonSettings
                 * @static
                 * @param {google.api.PythonSettings} message PythonSettings
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                PythonSettings.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults)
                        object.common = null;
                    if (message.common != null && message.hasOwnProperty("common"))
                        object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);
                    return object;
                };
    
                /**
                 * Converts this PythonSettings to JSON.
                 * @function toJSON
                 * @memberof google.api.PythonSettings
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                PythonSettings.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for PythonSettings
                 * @function getTypeUrl
                 * @memberof google.api.PythonSettings
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.PythonSettings";
                };
    
                return PythonSettings;
            })();
    
            api.NodeSettings = (function() {
    
                /**
                 * Properties of a NodeSettings.
                 * @memberof google.api
                 * @interface INodeSettings
                 * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common
                 */
    
                /**
                 * Constructs a new NodeSettings.
                 * @memberof google.api
                 * @classdesc Represents a NodeSettings.
                 * @implements INodeSettings
                 * @constructor
                 * @param {google.api.INodeSettings=} [properties] Properties to set
                 */
                function NodeSettings(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * NodeSettings common.
                 * @member {google.api.ICommonLanguageSettings|null|undefined} common
                 * @memberof google.api.NodeSettings
                 * @instance
                 */
                NodeSettings.prototype.common = null;
    
                /**
                 * Creates a new NodeSettings instance using the specified properties.
                 * @function create
                 * @memberof google.api.NodeSettings
                 * @static
                 * @param {google.api.INodeSettings=} [properties] Properties to set
                 * @returns {google.api.NodeSettings} NodeSettings instance
                 */
                NodeSettings.create = function create(properties) {
                    return new NodeSettings(properties);
                };
    
                /**
                 * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.NodeSettings
                 * @static
                 * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                NodeSettings.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.common != null && Object.hasOwnProperty.call(message, "common"))
                        $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.NodeSettings
                 * @static
                 * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                NodeSettings.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a NodeSettings message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.NodeSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.NodeSettings} NodeSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                NodeSettings.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a NodeSettings message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.NodeSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.NodeSettings} NodeSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                NodeSettings.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a NodeSettings message.
                 * @function verify
                 * @memberof google.api.NodeSettings
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                NodeSettings.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.common != null && message.hasOwnProperty("common")) {
                        var error = $root.google.api.CommonLanguageSettings.verify(message.common);
                        if (error)
                            return "common." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.NodeSettings
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.NodeSettings} NodeSettings
                 */
                NodeSettings.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.NodeSettings)
                        return object;
                    var message = new $root.google.api.NodeSettings();
                    if (object.common != null) {
                        if (typeof object.common !== "object")
                            throw TypeError(".google.api.NodeSettings.common: object expected");
                        message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a NodeSettings message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.NodeSettings
                 * @static
                 * @param {google.api.NodeSettings} message NodeSettings
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                NodeSettings.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults)
                        object.common = null;
                    if (message.common != null && message.hasOwnProperty("common"))
                        object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);
                    return object;
                };
    
                /**
                 * Converts this NodeSettings to JSON.
                 * @function toJSON
                 * @memberof google.api.NodeSettings
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                NodeSettings.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for NodeSettings
                 * @function getTypeUrl
                 * @memberof google.api.NodeSettings
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.NodeSettings";
                };
    
                return NodeSettings;
            })();
    
            api.DotnetSettings = (function() {
    
                /**
                 * Properties of a DotnetSettings.
                 * @memberof google.api
                 * @interface IDotnetSettings
                 * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common
                 * @property {Object.<string,string>|null} [renamedServices] DotnetSettings renamedServices
                 * @property {Object.<string,string>|null} [renamedResources] DotnetSettings renamedResources
                 * @property {Array.<string>|null} [ignoredResources] DotnetSettings ignoredResources
                 * @property {Array.<string>|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases
                 * @property {Array.<string>|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures
                 */
    
                /**
                 * Constructs a new DotnetSettings.
                 * @memberof google.api
                 * @classdesc Represents a DotnetSettings.
                 * @implements IDotnetSettings
                 * @constructor
                 * @param {google.api.IDotnetSettings=} [properties] Properties to set
                 */
                function DotnetSettings(properties) {
                    this.renamedServices = {};
                    this.renamedResources = {};
                    this.ignoredResources = [];
                    this.forcedNamespaceAliases = [];
                    this.handwrittenSignatures = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * DotnetSettings common.
                 * @member {google.api.ICommonLanguageSettings|null|undefined} common
                 * @memberof google.api.DotnetSettings
                 * @instance
                 */
                DotnetSettings.prototype.common = null;
    
                /**
                 * DotnetSettings renamedServices.
                 * @member {Object.<string,string>} renamedServices
                 * @memberof google.api.DotnetSettings
                 * @instance
                 */
                DotnetSettings.prototype.renamedServices = $util.emptyObject;
    
                /**
                 * DotnetSettings renamedResources.
                 * @member {Object.<string,string>} renamedResources
                 * @memberof google.api.DotnetSettings
                 * @instance
                 */
                DotnetSettings.prototype.renamedResources = $util.emptyObject;
    
                /**
                 * DotnetSettings ignoredResources.
                 * @member {Array.<string>} ignoredResources
                 * @memberof google.api.DotnetSettings
                 * @instance
                 */
                DotnetSettings.prototype.ignoredResources = $util.emptyArray;
    
                /**
                 * DotnetSettings forcedNamespaceAliases.
                 * @member {Array.<string>} forcedNamespaceAliases
                 * @memberof google.api.DotnetSettings
                 * @instance
                 */
                DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray;
    
                /**
                 * DotnetSettings handwrittenSignatures.
                 * @member {Array.<string>} handwrittenSignatures
                 * @memberof google.api.DotnetSettings
                 * @instance
                 */
                DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray;
    
                /**
                 * Creates a new DotnetSettings instance using the specified properties.
                 * @function create
                 * @memberof google.api.DotnetSettings
                 * @static
                 * @param {google.api.IDotnetSettings=} [properties] Properties to set
                 * @returns {google.api.DotnetSettings} DotnetSettings instance
                 */
                DotnetSettings.create = function create(properties) {
                    return new DotnetSettings(properties);
                };
    
                /**
                 * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.DotnetSettings
                 * @static
                 * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                DotnetSettings.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.common != null && Object.hasOwnProperty.call(message, "common"))
                        $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices"))
                        for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i)
                            writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim();
                    if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources"))
                        for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i)
                            writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim();
                    if (message.ignoredResources != null && message.ignoredResources.length)
                        for (var i = 0; i < message.ignoredResources.length; ++i)
                            writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]);
                    if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length)
                        for (var i = 0; i < message.forcedNamespaceAliases.length; ++i)
                            writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]);
                    if (message.handwrittenSignatures != null && message.handwrittenSignatures.length)
                        for (var i = 0; i < message.handwrittenSignatures.length; ++i)
                            writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]);
                    return writer;
                };
    
                /**
                 * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.DotnetSettings
                 * @static
                 * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a DotnetSettings message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.DotnetSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.DotnetSettings} DotnetSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                DotnetSettings.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value;
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());
                                break;
                            }
                        case 2: {
                                if (message.renamedServices === $util.emptyObject)
                                    message.renamedServices = {};
                                var end2 = reader.uint32() + reader.pos;
                                key = "";
                                value = "";
                                while (reader.pos < end2) {
                                    var tag2 = reader.uint32();
                                    switch (tag2 >>> 3) {
                                    case 1:
                                        key = reader.string();
                                        break;
                                    case 2:
                                        value = reader.string();
                                        break;
                                    default:
                                        reader.skipType(tag2 & 7);
                                        break;
                                    }
                                }
                                message.renamedServices[key] = value;
                                break;
                            }
                        case 3: {
                                if (message.renamedResources === $util.emptyObject)
                                    message.renamedResources = {};
                                var end2 = reader.uint32() + reader.pos;
                                key = "";
                                value = "";
                                while (reader.pos < end2) {
                                    var tag2 = reader.uint32();
                                    switch (tag2 >>> 3) {
                                    case 1:
                                        key = reader.string();
                                        break;
                                    case 2:
                                        value = reader.string();
                                        break;
                                    default:
                                        reader.skipType(tag2 & 7);
                                        break;
                                    }
                                }
                                message.renamedResources[key] = value;
                                break;
                            }
                        case 4: {
                                if (!(message.ignoredResources && message.ignoredResources.length))
                                    message.ignoredResources = [];
                                message.ignoredResources.push(reader.string());
                                break;
                            }
                        case 5: {
                                if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length))
                                    message.forcedNamespaceAliases = [];
                                message.forcedNamespaceAliases.push(reader.string());
                                break;
                            }
                        case 6: {
                                if (!(message.handwrittenSignatures && message.handwrittenSignatures.length))
                                    message.handwrittenSignatures = [];
                                message.handwrittenSignatures.push(reader.string());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a DotnetSettings message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.DotnetSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.DotnetSettings} DotnetSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                DotnetSettings.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a DotnetSettings message.
                 * @function verify
                 * @memberof google.api.DotnetSettings
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                DotnetSettings.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.common != null && message.hasOwnProperty("common")) {
                        var error = $root.google.api.CommonLanguageSettings.verify(message.common);
                        if (error)
                            return "common." + error;
                    }
                    if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) {
                        if (!$util.isObject(message.renamedServices))
                            return "renamedServices: object expected";
                        var key = Object.keys(message.renamedServices);
                        for (var i = 0; i < key.length; ++i)
                            if (!$util.isString(message.renamedServices[key[i]]))
                                return "renamedServices: string{k:string} expected";
                    }
                    if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) {
                        if (!$util.isObject(message.renamedResources))
                            return "renamedResources: object expected";
                        var key = Object.keys(message.renamedResources);
                        for (var i = 0; i < key.length; ++i)
                            if (!$util.isString(message.renamedResources[key[i]]))
                                return "renamedResources: string{k:string} expected";
                    }
                    if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) {
                        if (!Array.isArray(message.ignoredResources))
                            return "ignoredResources: array expected";
                        for (var i = 0; i < message.ignoredResources.length; ++i)
                            if (!$util.isString(message.ignoredResources[i]))
                                return "ignoredResources: string[] expected";
                    }
                    if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) {
                        if (!Array.isArray(message.forcedNamespaceAliases))
                            return "forcedNamespaceAliases: array expected";
                        for (var i = 0; i < message.forcedNamespaceAliases.length; ++i)
                            if (!$util.isString(message.forcedNamespaceAliases[i]))
                                return "forcedNamespaceAliases: string[] expected";
                    }
                    if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) {
                        if (!Array.isArray(message.handwrittenSignatures))
                            return "handwrittenSignatures: array expected";
                        for (var i = 0; i < message.handwrittenSignatures.length; ++i)
                            if (!$util.isString(message.handwrittenSignatures[i]))
                                return "handwrittenSignatures: string[] expected";
                    }
                    return null;
                };
    
                /**
                 * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.DotnetSettings
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.DotnetSettings} DotnetSettings
                 */
                DotnetSettings.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.DotnetSettings)
                        return object;
                    var message = new $root.google.api.DotnetSettings();
                    if (object.common != null) {
                        if (typeof object.common !== "object")
                            throw TypeError(".google.api.DotnetSettings.common: object expected");
                        message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);
                    }
                    if (object.renamedServices) {
                        if (typeof object.renamedServices !== "object")
                            throw TypeError(".google.api.DotnetSettings.renamedServices: object expected");
                        message.renamedServices = {};
                        for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i)
                            message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]);
                    }
                    if (object.renamedResources) {
                        if (typeof object.renamedResources !== "object")
                            throw TypeError(".google.api.DotnetSettings.renamedResources: object expected");
                        message.renamedResources = {};
                        for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i)
                            message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]);
                    }
                    if (object.ignoredResources) {
                        if (!Array.isArray(object.ignoredResources))
                            throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected");
                        message.ignoredResources = [];
                        for (var i = 0; i < object.ignoredResources.length; ++i)
                            message.ignoredResources[i] = String(object.ignoredResources[i]);
                    }
                    if (object.forcedNamespaceAliases) {
                        if (!Array.isArray(object.forcedNamespaceAliases))
                            throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected");
                        message.forcedNamespaceAliases = [];
                        for (var i = 0; i < object.forcedNamespaceAliases.length; ++i)
                            message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]);
                    }
                    if (object.handwrittenSignatures) {
                        if (!Array.isArray(object.handwrittenSignatures))
                            throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected");
                        message.handwrittenSignatures = [];
                        for (var i = 0; i < object.handwrittenSignatures.length; ++i)
                            message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.DotnetSettings
                 * @static
                 * @param {google.api.DotnetSettings} message DotnetSettings
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                DotnetSettings.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults) {
                        object.ignoredResources = [];
                        object.forcedNamespaceAliases = [];
                        object.handwrittenSignatures = [];
                    }
                    if (options.objects || options.defaults) {
                        object.renamedServices = {};
                        object.renamedResources = {};
                    }
                    if (options.defaults)
                        object.common = null;
                    if (message.common != null && message.hasOwnProperty("common"))
                        object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);
                    var keys2;
                    if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) {
                        object.renamedServices = {};
                        for (var j = 0; j < keys2.length; ++j)
                            object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]];
                    }
                    if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) {
                        object.renamedResources = {};
                        for (var j = 0; j < keys2.length; ++j)
                            object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]];
                    }
                    if (message.ignoredResources && message.ignoredResources.length) {
                        object.ignoredResources = [];
                        for (var j = 0; j < message.ignoredResources.length; ++j)
                            object.ignoredResources[j] = message.ignoredResources[j];
                    }
                    if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) {
                        object.forcedNamespaceAliases = [];
                        for (var j = 0; j < message.forcedNamespaceAliases.length; ++j)
                            object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j];
                    }
                    if (message.handwrittenSignatures && message.handwrittenSignatures.length) {
                        object.handwrittenSignatures = [];
                        for (var j = 0; j < message.handwrittenSignatures.length; ++j)
                            object.handwrittenSignatures[j] = message.handwrittenSignatures[j];
                    }
                    return object;
                };
    
                /**
                 * Converts this DotnetSettings to JSON.
                 * @function toJSON
                 * @memberof google.api.DotnetSettings
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                DotnetSettings.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for DotnetSettings
                 * @function getTypeUrl
                 * @memberof google.api.DotnetSettings
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.DotnetSettings";
                };
    
                return DotnetSettings;
            })();
    
            api.RubySettings = (function() {
    
                /**
                 * Properties of a RubySettings.
                 * @memberof google.api
                 * @interface IRubySettings
                 * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common
                 */
    
                /**
                 * Constructs a new RubySettings.
                 * @memberof google.api
                 * @classdesc Represents a RubySettings.
                 * @implements IRubySettings
                 * @constructor
                 * @param {google.api.IRubySettings=} [properties] Properties to set
                 */
                function RubySettings(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * RubySettings common.
                 * @member {google.api.ICommonLanguageSettings|null|undefined} common
                 * @memberof google.api.RubySettings
                 * @instance
                 */
                RubySettings.prototype.common = null;
    
                /**
                 * Creates a new RubySettings instance using the specified properties.
                 * @function create
                 * @memberof google.api.RubySettings
                 * @static
                 * @param {google.api.IRubySettings=} [properties] Properties to set
                 * @returns {google.api.RubySettings} RubySettings instance
                 */
                RubySettings.create = function create(properties) {
                    return new RubySettings(properties);
                };
    
                /**
                 * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.RubySettings
                 * @static
                 * @param {google.api.IRubySettings} message RubySettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                RubySettings.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.common != null && Object.hasOwnProperty.call(message, "common"))
                        $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.RubySettings
                 * @static
                 * @param {google.api.IRubySettings} message RubySettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                RubySettings.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a RubySettings message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.RubySettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.RubySettings} RubySettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                RubySettings.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a RubySettings message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.RubySettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.RubySettings} RubySettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                RubySettings.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a RubySettings message.
                 * @function verify
                 * @memberof google.api.RubySettings
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                RubySettings.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.common != null && message.hasOwnProperty("common")) {
                        var error = $root.google.api.CommonLanguageSettings.verify(message.common);
                        if (error)
                            return "common." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a RubySettings message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.RubySettings
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.RubySettings} RubySettings
                 */
                RubySettings.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.RubySettings)
                        return object;
                    var message = new $root.google.api.RubySettings();
                    if (object.common != null) {
                        if (typeof object.common !== "object")
                            throw TypeError(".google.api.RubySettings.common: object expected");
                        message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a RubySettings message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.RubySettings
                 * @static
                 * @param {google.api.RubySettings} message RubySettings
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                RubySettings.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults)
                        object.common = null;
                    if (message.common != null && message.hasOwnProperty("common"))
                        object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);
                    return object;
                };
    
                /**
                 * Converts this RubySettings to JSON.
                 * @function toJSON
                 * @memberof google.api.RubySettings
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                RubySettings.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for RubySettings
                 * @function getTypeUrl
                 * @memberof google.api.RubySettings
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.RubySettings";
                };
    
                return RubySettings;
            })();
    
            api.GoSettings = (function() {
    
                /**
                 * Properties of a GoSettings.
                 * @memberof google.api
                 * @interface IGoSettings
                 * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common
                 */
    
                /**
                 * Constructs a new GoSettings.
                 * @memberof google.api
                 * @classdesc Represents a GoSettings.
                 * @implements IGoSettings
                 * @constructor
                 * @param {google.api.IGoSettings=} [properties] Properties to set
                 */
                function GoSettings(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * GoSettings common.
                 * @member {google.api.ICommonLanguageSettings|null|undefined} common
                 * @memberof google.api.GoSettings
                 * @instance
                 */
                GoSettings.prototype.common = null;
    
                /**
                 * Creates a new GoSettings instance using the specified properties.
                 * @function create
                 * @memberof google.api.GoSettings
                 * @static
                 * @param {google.api.IGoSettings=} [properties] Properties to set
                 * @returns {google.api.GoSettings} GoSettings instance
                 */
                GoSettings.create = function create(properties) {
                    return new GoSettings(properties);
                };
    
                /**
                 * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.GoSettings
                 * @static
                 * @param {google.api.IGoSettings} message GoSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                GoSettings.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.common != null && Object.hasOwnProperty.call(message, "common"))
                        $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.GoSettings
                 * @static
                 * @param {google.api.IGoSettings} message GoSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                GoSettings.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a GoSettings message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.GoSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.GoSettings} GoSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                GoSettings.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a GoSettings message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.GoSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.GoSettings} GoSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                GoSettings.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a GoSettings message.
                 * @function verify
                 * @memberof google.api.GoSettings
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                GoSettings.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.common != null && message.hasOwnProperty("common")) {
                        var error = $root.google.api.CommonLanguageSettings.verify(message.common);
                        if (error)
                            return "common." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a GoSettings message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.GoSettings
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.GoSettings} GoSettings
                 */
                GoSettings.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.GoSettings)
                        return object;
                    var message = new $root.google.api.GoSettings();
                    if (object.common != null) {
                        if (typeof object.common !== "object")
                            throw TypeError(".google.api.GoSettings.common: object expected");
                        message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a GoSettings message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.GoSettings
                 * @static
                 * @param {google.api.GoSettings} message GoSettings
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                GoSettings.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults)
                        object.common = null;
                    if (message.common != null && message.hasOwnProperty("common"))
                        object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options);
                    return object;
                };
    
                /**
                 * Converts this GoSettings to JSON.
                 * @function toJSON
                 * @memberof google.api.GoSettings
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                GoSettings.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for GoSettings
                 * @function getTypeUrl
                 * @memberof google.api.GoSettings
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.GoSettings";
                };
    
                return GoSettings;
            })();
    
            api.MethodSettings = (function() {
    
                /**
                 * Properties of a MethodSettings.
                 * @memberof google.api
                 * @interface IMethodSettings
                 * @property {string|null} [selector] MethodSettings selector
                 * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning
                 * @property {Array.<string>|null} [autoPopulatedFields] MethodSettings autoPopulatedFields
                 */
    
                /**
                 * Constructs a new MethodSettings.
                 * @memberof google.api
                 * @classdesc Represents a MethodSettings.
                 * @implements IMethodSettings
                 * @constructor
                 * @param {google.api.IMethodSettings=} [properties] Properties to set
                 */
                function MethodSettings(properties) {
                    this.autoPopulatedFields = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * MethodSettings selector.
                 * @member {string} selector
                 * @memberof google.api.MethodSettings
                 * @instance
                 */
                MethodSettings.prototype.selector = "";
    
                /**
                 * MethodSettings longRunning.
                 * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning
                 * @memberof google.api.MethodSettings
                 * @instance
                 */
                MethodSettings.prototype.longRunning = null;
    
                /**
                 * MethodSettings autoPopulatedFields.
                 * @member {Array.<string>} autoPopulatedFields
                 * @memberof google.api.MethodSettings
                 * @instance
                 */
                MethodSettings.prototype.autoPopulatedFields = $util.emptyArray;
    
                /**
                 * Creates a new MethodSettings instance using the specified properties.
                 * @function create
                 * @memberof google.api.MethodSettings
                 * @static
                 * @param {google.api.IMethodSettings=} [properties] Properties to set
                 * @returns {google.api.MethodSettings} MethodSettings instance
                 */
                MethodSettings.create = function create(properties) {
                    return new MethodSettings(properties);
                };
    
                /**
                 * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.MethodSettings
                 * @static
                 * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                MethodSettings.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.selector != null && Object.hasOwnProperty.call(message, "selector"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector);
                    if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning"))
                        $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                    if (message.autoPopulatedFields != null && message.autoPopulatedFields.length)
                        for (var i = 0; i < message.autoPopulatedFields.length; ++i)
                            writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]);
                    return writer;
                };
    
                /**
                 * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.MethodSettings
                 * @static
                 * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                MethodSettings.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a MethodSettings message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.MethodSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.MethodSettings} MethodSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                MethodSettings.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.selector = reader.string();
                                break;
                            }
                        case 2: {
                                message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32());
                                break;
                            }
                        case 3: {
                                if (!(message.autoPopulatedFields && message.autoPopulatedFields.length))
                                    message.autoPopulatedFields = [];
                                message.autoPopulatedFields.push(reader.string());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a MethodSettings message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.MethodSettings
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.MethodSettings} MethodSettings
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                MethodSettings.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a MethodSettings message.
                 * @function verify
                 * @memberof google.api.MethodSettings
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                MethodSettings.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.selector != null && message.hasOwnProperty("selector"))
                        if (!$util.isString(message.selector))
                            return "selector: string expected";
                    if (message.longRunning != null && message.hasOwnProperty("longRunning")) {
                        var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning);
                        if (error)
                            return "longRunning." + error;
                    }
                    if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) {
                        if (!Array.isArray(message.autoPopulatedFields))
                            return "autoPopulatedFields: array expected";
                        for (var i = 0; i < message.autoPopulatedFields.length; ++i)
                            if (!$util.isString(message.autoPopulatedFields[i]))
                                return "autoPopulatedFields: string[] expected";
                    }
                    return null;
                };
    
                /**
                 * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.MethodSettings
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.MethodSettings} MethodSettings
                 */
                MethodSettings.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.MethodSettings)
                        return object;
                    var message = new $root.google.api.MethodSettings();
                    if (object.selector != null)
                        message.selector = String(object.selector);
                    if (object.longRunning != null) {
                        if (typeof object.longRunning !== "object")
                            throw TypeError(".google.api.MethodSettings.longRunning: object expected");
                        message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning);
                    }
                    if (object.autoPopulatedFields) {
                        if (!Array.isArray(object.autoPopulatedFields))
                            throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected");
                        message.autoPopulatedFields = [];
                        for (var i = 0; i < object.autoPopulatedFields.length; ++i)
                            message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a MethodSettings message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.MethodSettings
                 * @static
                 * @param {google.api.MethodSettings} message MethodSettings
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                MethodSettings.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.autoPopulatedFields = [];
                    if (options.defaults) {
                        object.selector = "";
                        object.longRunning = null;
                    }
                    if (message.selector != null && message.hasOwnProperty("selector"))
                        object.selector = message.selector;
                    if (message.longRunning != null && message.hasOwnProperty("longRunning"))
                        object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options);
                    if (message.autoPopulatedFields && message.autoPopulatedFields.length) {
                        object.autoPopulatedFields = [];
                        for (var j = 0; j < message.autoPopulatedFields.length; ++j)
                            object.autoPopulatedFields[j] = message.autoPopulatedFields[j];
                    }
                    return object;
                };
    
                /**
                 * Converts this MethodSettings to JSON.
                 * @function toJSON
                 * @memberof google.api.MethodSettings
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                MethodSettings.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for MethodSettings
                 * @function getTypeUrl
                 * @memberof google.api.MethodSettings
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.MethodSettings";
                };
    
                MethodSettings.LongRunning = (function() {
    
                    /**
                     * Properties of a LongRunning.
                     * @memberof google.api.MethodSettings
                     * @interface ILongRunning
                     * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay
                     * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier
                     * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay
                     * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout
                     */
    
                    /**
                     * Constructs a new LongRunning.
                     * @memberof google.api.MethodSettings
                     * @classdesc Represents a LongRunning.
                     * @implements ILongRunning
                     * @constructor
                     * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set
                     */
                    function LongRunning(properties) {
                        if (properties)
                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                if (properties[keys[i]] != null)
                                    this[keys[i]] = properties[keys[i]];
                    }
    
                    /**
                     * LongRunning initialPollDelay.
                     * @member {google.protobuf.IDuration|null|undefined} initialPollDelay
                     * @memberof google.api.MethodSettings.LongRunning
                     * @instance
                     */
                    LongRunning.prototype.initialPollDelay = null;
    
                    /**
                     * LongRunning pollDelayMultiplier.
                     * @member {number} pollDelayMultiplier
                     * @memberof google.api.MethodSettings.LongRunning
                     * @instance
                     */
                    LongRunning.prototype.pollDelayMultiplier = 0;
    
                    /**
                     * LongRunning maxPollDelay.
                     * @member {google.protobuf.IDuration|null|undefined} maxPollDelay
                     * @memberof google.api.MethodSettings.LongRunning
                     * @instance
                     */
                    LongRunning.prototype.maxPollDelay = null;
    
                    /**
                     * LongRunning totalPollTimeout.
                     * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout
                     * @memberof google.api.MethodSettings.LongRunning
                     * @instance
                     */
                    LongRunning.prototype.totalPollTimeout = null;
    
                    /**
                     * Creates a new LongRunning instance using the specified properties.
                     * @function create
                     * @memberof google.api.MethodSettings.LongRunning
                     * @static
                     * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set
                     * @returns {google.api.MethodSettings.LongRunning} LongRunning instance
                     */
                    LongRunning.create = function create(properties) {
                        return new LongRunning(properties);
                    };
    
                    /**
                     * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages.
                     * @function encode
                     * @memberof google.api.MethodSettings.LongRunning
                     * @static
                     * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    LongRunning.encode = function encode(message, writer) {
                        if (!writer)
                            writer = $Writer.create();
                        if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay"))
                            $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                        if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier"))
                            writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier);
                        if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay"))
                            $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                        if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout"))
                            $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                        return writer;
                    };
    
                    /**
                     * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages.
                     * @function encodeDelimited
                     * @memberof google.api.MethodSettings.LongRunning
                     * @static
                     * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    LongRunning.encodeDelimited = function encodeDelimited(message, writer) {
                        return this.encode(message, writer).ldelim();
                    };
    
                    /**
                     * Decodes a LongRunning message from the specified reader or buffer.
                     * @function decode
                     * @memberof google.api.MethodSettings.LongRunning
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {google.api.MethodSettings.LongRunning} LongRunning
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    LongRunning.decode = function decode(reader, length) {
                        if (!(reader instanceof $Reader))
                            reader = $Reader.create(reader);
                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning();
                        while (reader.pos < end) {
                            var tag = reader.uint32();
                            switch (tag >>> 3) {
                            case 1: {
                                    message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32());
                                    break;
                                }
                            case 2: {
                                    message.pollDelayMultiplier = reader.float();
                                    break;
                                }
                            case 3: {
                                    message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32());
                                    break;
                                }
                            case 4: {
                                    message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32());
                                    break;
                                }
                            default:
                                reader.skipType(tag & 7);
                                break;
                            }
                        }
                        return message;
                    };
    
                    /**
                     * Decodes a LongRunning message from the specified reader or buffer, length delimited.
                     * @function decodeDelimited
                     * @memberof google.api.MethodSettings.LongRunning
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {google.api.MethodSettings.LongRunning} LongRunning
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    LongRunning.decodeDelimited = function decodeDelimited(reader) {
                        if (!(reader instanceof $Reader))
                            reader = new $Reader(reader);
                        return this.decode(reader, reader.uint32());
                    };
    
                    /**
                     * Verifies a LongRunning message.
                     * @function verify
                     * @memberof google.api.MethodSettings.LongRunning
                     * @static
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {string|null} `null` if valid, otherwise the reason why it is not
                     */
                    LongRunning.verify = function verify(message) {
                        if (typeof message !== "object" || message === null)
                            return "object expected";
                        if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) {
                            var error = $root.google.protobuf.Duration.verify(message.initialPollDelay);
                            if (error)
                                return "initialPollDelay." + error;
                        }
                        if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier"))
                            if (typeof message.pollDelayMultiplier !== "number")
                                return "pollDelayMultiplier: number expected";
                        if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) {
                            var error = $root.google.protobuf.Duration.verify(message.maxPollDelay);
                            if (error)
                                return "maxPollDelay." + error;
                        }
                        if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) {
                            var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout);
                            if (error)
                                return "totalPollTimeout." + error;
                        }
                        return null;
                    };
    
                    /**
                     * Creates a LongRunning message from a plain object. Also converts values to their respective internal types.
                     * @function fromObject
                     * @memberof google.api.MethodSettings.LongRunning
                     * @static
                     * @param {Object.<string,*>} object Plain object
                     * @returns {google.api.MethodSettings.LongRunning} LongRunning
                     */
                    LongRunning.fromObject = function fromObject(object) {
                        if (object instanceof $root.google.api.MethodSettings.LongRunning)
                            return object;
                        var message = new $root.google.api.MethodSettings.LongRunning();
                        if (object.initialPollDelay != null) {
                            if (typeof object.initialPollDelay !== "object")
                                throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected");
                            message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay);
                        }
                        if (object.pollDelayMultiplier != null)
                            message.pollDelayMultiplier = Number(object.pollDelayMultiplier);
                        if (object.maxPollDelay != null) {
                            if (typeof object.maxPollDelay !== "object")
                                throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected");
                            message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay);
                        }
                        if (object.totalPollTimeout != null) {
                            if (typeof object.totalPollTimeout !== "object")
                                throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected");
                            message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout);
                        }
                        return message;
                    };
    
                    /**
                     * Creates a plain object from a LongRunning message. Also converts values to other types if specified.
                     * @function toObject
                     * @memberof google.api.MethodSettings.LongRunning
                     * @static
                     * @param {google.api.MethodSettings.LongRunning} message LongRunning
                     * @param {$protobuf.IConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    LongRunning.toObject = function toObject(message, options) {
                        if (!options)
                            options = {};
                        var object = {};
                        if (options.defaults) {
                            object.initialPollDelay = null;
                            object.pollDelayMultiplier = 0;
                            object.maxPollDelay = null;
                            object.totalPollTimeout = null;
                        }
                        if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay"))
                            object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options);
                        if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier"))
                            object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier;
                        if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay"))
                            object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options);
                        if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout"))
                            object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options);
                        return object;
                    };
    
                    /**
                     * Converts this LongRunning to JSON.
                     * @function toJSON
                     * @memberof google.api.MethodSettings.LongRunning
                     * @instance
                     * @returns {Object.<string,*>} JSON object
                     */
                    LongRunning.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };
    
                    /**
                     * Gets the default type url for LongRunning
                     * @function getTypeUrl
                     * @memberof google.api.MethodSettings.LongRunning
                     * @static
                     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                     * @returns {string} The default type url
                     */
                    LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/google.api.MethodSettings.LongRunning";
                    };
    
                    return LongRunning;
                })();
    
                return MethodSettings;
            })();
    
            /**
             * ClientLibraryOrganization enum.
             * @name google.api.ClientLibraryOrganization
             * @enum {number}
             * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value
             * @property {number} CLOUD=1 CLOUD value
             * @property {number} ADS=2 ADS value
             * @property {number} PHOTOS=3 PHOTOS value
             * @property {number} STREET_VIEW=4 STREET_VIEW value
             * @property {number} SHOPPING=5 SHOPPING value
             * @property {number} GEO=6 GEO value
             * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value
             */
            api.ClientLibraryOrganization = (function() {
                var valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0;
                values[valuesById[1] = "CLOUD"] = 1;
                values[valuesById[2] = "ADS"] = 2;
                values[valuesById[3] = "PHOTOS"] = 3;
                values[valuesById[4] = "STREET_VIEW"] = 4;
                values[valuesById[5] = "SHOPPING"] = 5;
                values[valuesById[6] = "GEO"] = 6;
                values[valuesById[7] = "GENERATIVE_AI"] = 7;
                return values;
            })();
    
            /**
             * ClientLibraryDestination enum.
             * @name google.api.ClientLibraryDestination
             * @enum {number}
             * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value
             * @property {number} GITHUB=10 GITHUB value
             * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value
             */
            api.ClientLibraryDestination = (function() {
                var valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0;
                values[valuesById[10] = "GITHUB"] = 10;
                values[valuesById[20] = "PACKAGE_MANAGER"] = 20;
                return values;
            })();
    
            /**
             * LaunchStage enum.
             * @name google.api.LaunchStage
             * @enum {number}
             * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value
             * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value
             * @property {number} PRELAUNCH=7 PRELAUNCH value
             * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value
             * @property {number} ALPHA=2 ALPHA value
             * @property {number} BETA=3 BETA value
             * @property {number} GA=4 GA value
             * @property {number} DEPRECATED=5 DEPRECATED value
             */
            api.LaunchStage = (function() {
                var valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0;
                values[valuesById[6] = "UNIMPLEMENTED"] = 6;
                values[valuesById[7] = "PRELAUNCH"] = 7;
                values[valuesById[1] = "EARLY_ACCESS"] = 1;
                values[valuesById[2] = "ALPHA"] = 2;
                values[valuesById[3] = "BETA"] = 3;
                values[valuesById[4] = "GA"] = 4;
                values[valuesById[5] = "DEPRECATED"] = 5;
                return values;
            })();
    
            api.ResourceDescriptor = (function() {
    
                /**
                 * Properties of a ResourceDescriptor.
                 * @memberof google.api
                 * @interface IResourceDescriptor
                 * @property {string|null} [type] ResourceDescriptor type
                 * @property {Array.<string>|null} [pattern] ResourceDescriptor pattern
                 * @property {string|null} [nameField] ResourceDescriptor nameField
                 * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history
                 * @property {string|null} [plural] ResourceDescriptor plural
                 * @property {string|null} [singular] ResourceDescriptor singular
                 * @property {Array.<google.api.ResourceDescriptor.Style>|null} [style] ResourceDescriptor style
                 */
    
                /**
                 * Constructs a new ResourceDescriptor.
                 * @memberof google.api
                 * @classdesc Represents a ResourceDescriptor.
                 * @implements IResourceDescriptor
                 * @constructor
                 * @param {google.api.IResourceDescriptor=} [properties] Properties to set
                 */
                function ResourceDescriptor(properties) {
                    this.pattern = [];
                    this.style = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * ResourceDescriptor type.
                 * @member {string} type
                 * @memberof google.api.ResourceDescriptor
                 * @instance
                 */
                ResourceDescriptor.prototype.type = "";
    
                /**
                 * ResourceDescriptor pattern.
                 * @member {Array.<string>} pattern
                 * @memberof google.api.ResourceDescriptor
                 * @instance
                 */
                ResourceDescriptor.prototype.pattern = $util.emptyArray;
    
                /**
                 * ResourceDescriptor nameField.
                 * @member {string} nameField
                 * @memberof google.api.ResourceDescriptor
                 * @instance
                 */
                ResourceDescriptor.prototype.nameField = "";
    
                /**
                 * ResourceDescriptor history.
                 * @member {google.api.ResourceDescriptor.History} history
                 * @memberof google.api.ResourceDescriptor
                 * @instance
                 */
                ResourceDescriptor.prototype.history = 0;
    
                /**
                 * ResourceDescriptor plural.
                 * @member {string} plural
                 * @memberof google.api.ResourceDescriptor
                 * @instance
                 */
                ResourceDescriptor.prototype.plural = "";
    
                /**
                 * ResourceDescriptor singular.
                 * @member {string} singular
                 * @memberof google.api.ResourceDescriptor
                 * @instance
                 */
                ResourceDescriptor.prototype.singular = "";
    
                /**
                 * ResourceDescriptor style.
                 * @member {Array.<google.api.ResourceDescriptor.Style>} style
                 * @memberof google.api.ResourceDescriptor
                 * @instance
                 */
                ResourceDescriptor.prototype.style = $util.emptyArray;
    
                /**
                 * Creates a new ResourceDescriptor instance using the specified properties.
                 * @function create
                 * @memberof google.api.ResourceDescriptor
                 * @static
                 * @param {google.api.IResourceDescriptor=} [properties] Properties to set
                 * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance
                 */
                ResourceDescriptor.create = function create(properties) {
                    return new ResourceDescriptor(properties);
                };
    
                /**
                 * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.ResourceDescriptor
                 * @static
                 * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ResourceDescriptor.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);
                    if (message.pattern != null && message.pattern.length)
                        for (var i = 0; i < message.pattern.length; ++i)
                            writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]);
                    if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField"))
                        writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField);
                    if (message.history != null && Object.hasOwnProperty.call(message, "history"))
                        writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history);
                    if (message.plural != null && Object.hasOwnProperty.call(message, "plural"))
                        writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural);
                    if (message.singular != null && Object.hasOwnProperty.call(message, "singular"))
                        writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular);
                    if (message.style != null && message.style.length) {
                        writer.uint32(/* id 10, wireType 2 =*/82).fork();
                        for (var i = 0; i < message.style.length; ++i)
                            writer.int32(message.style[i]);
                        writer.ldelim();
                    }
                    return writer;
                };
    
                /**
                 * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.ResourceDescriptor
                 * @static
                 * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a ResourceDescriptor message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.ResourceDescriptor
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.ResourceDescriptor} ResourceDescriptor
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ResourceDescriptor.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.type = reader.string();
                                break;
                            }
                        case 2: {
                                if (!(message.pattern && message.pattern.length))
                                    message.pattern = [];
                                message.pattern.push(reader.string());
                                break;
                            }
                        case 3: {
                                message.nameField = reader.string();
                                break;
                            }
                        case 4: {
                                message.history = reader.int32();
                                break;
                            }
                        case 5: {
                                message.plural = reader.string();
                                break;
                            }
                        case 6: {
                                message.singular = reader.string();
                                break;
                            }
                        case 10: {
                                if (!(message.style && message.style.length))
                                    message.style = [];
                                if ((tag & 7) === 2) {
                                    var end2 = reader.uint32() + reader.pos;
                                    while (reader.pos < end2)
                                        message.style.push(reader.int32());
                                } else
                                    message.style.push(reader.int32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.ResourceDescriptor
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.ResourceDescriptor} ResourceDescriptor
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a ResourceDescriptor message.
                 * @function verify
                 * @memberof google.api.ResourceDescriptor
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                ResourceDescriptor.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.type != null && message.hasOwnProperty("type"))
                        if (!$util.isString(message.type))
                            return "type: string expected";
                    if (message.pattern != null && message.hasOwnProperty("pattern")) {
                        if (!Array.isArray(message.pattern))
                            return "pattern: array expected";
                        for (var i = 0; i < message.pattern.length; ++i)
                            if (!$util.isString(message.pattern[i]))
                                return "pattern: string[] expected";
                    }
                    if (message.nameField != null && message.hasOwnProperty("nameField"))
                        if (!$util.isString(message.nameField))
                            return "nameField: string expected";
                    if (message.history != null && message.hasOwnProperty("history"))
                        switch (message.history) {
                        default:
                            return "history: enum value expected";
                        case 0:
                        case 1:
                        case 2:
                            break;
                        }
                    if (message.plural != null && message.hasOwnProperty("plural"))
                        if (!$util.isString(message.plural))
                            return "plural: string expected";
                    if (message.singular != null && message.hasOwnProperty("singular"))
                        if (!$util.isString(message.singular))
                            return "singular: string expected";
                    if (message.style != null && message.hasOwnProperty("style")) {
                        if (!Array.isArray(message.style))
                            return "style: array expected";
                        for (var i = 0; i < message.style.length; ++i)
                            switch (message.style[i]) {
                            default:
                                return "style: enum value[] expected";
                            case 0:
                            case 1:
                                break;
                            }
                    }
                    return null;
                };
    
                /**
                 * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.ResourceDescriptor
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.ResourceDescriptor} ResourceDescriptor
                 */
                ResourceDescriptor.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.ResourceDescriptor)
                        return object;
                    var message = new $root.google.api.ResourceDescriptor();
                    if (object.type != null)
                        message.type = String(object.type);
                    if (object.pattern) {
                        if (!Array.isArray(object.pattern))
                            throw TypeError(".google.api.ResourceDescriptor.pattern: array expected");
                        message.pattern = [];
                        for (var i = 0; i < object.pattern.length; ++i)
                            message.pattern[i] = String(object.pattern[i]);
                    }
                    if (object.nameField != null)
                        message.nameField = String(object.nameField);
                    switch (object.history) {
                    default:
                        if (typeof object.history === "number") {
                            message.history = object.history;
                            break;
                        }
                        break;
                    case "HISTORY_UNSPECIFIED":
                    case 0:
                        message.history = 0;
                        break;
                    case "ORIGINALLY_SINGLE_PATTERN":
                    case 1:
                        message.history = 1;
                        break;
                    case "FUTURE_MULTI_PATTERN":
                    case 2:
                        message.history = 2;
                        break;
                    }
                    if (object.plural != null)
                        message.plural = String(object.plural);
                    if (object.singular != null)
                        message.singular = String(object.singular);
                    if (object.style) {
                        if (!Array.isArray(object.style))
                            throw TypeError(".google.api.ResourceDescriptor.style: array expected");
                        message.style = [];
                        for (var i = 0; i < object.style.length; ++i)
                            switch (object.style[i]) {
                            default:
                                if (typeof object.style[i] === "number") {
                                    message.style[i] = object.style[i];
                                    break;
                                }
                            case "STYLE_UNSPECIFIED":
                            case 0:
                                message.style[i] = 0;
                                break;
                            case "DECLARATIVE_FRIENDLY":
                            case 1:
                                message.style[i] = 1;
                                break;
                            }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.ResourceDescriptor
                 * @static
                 * @param {google.api.ResourceDescriptor} message ResourceDescriptor
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                ResourceDescriptor.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults) {
                        object.pattern = [];
                        object.style = [];
                    }
                    if (options.defaults) {
                        object.type = "";
                        object.nameField = "";
                        object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0;
                        object.plural = "";
                        object.singular = "";
                    }
                    if (message.type != null && message.hasOwnProperty("type"))
                        object.type = message.type;
                    if (message.pattern && message.pattern.length) {
                        object.pattern = [];
                        for (var j = 0; j < message.pattern.length; ++j)
                            object.pattern[j] = message.pattern[j];
                    }
                    if (message.nameField != null && message.hasOwnProperty("nameField"))
                        object.nameField = message.nameField;
                    if (message.history != null && message.hasOwnProperty("history"))
                        object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history;
                    if (message.plural != null && message.hasOwnProperty("plural"))
                        object.plural = message.plural;
                    if (message.singular != null && message.hasOwnProperty("singular"))
                        object.singular = message.singular;
                    if (message.style && message.style.length) {
                        object.style = [];
                        for (var j = 0; j < message.style.length; ++j)
                            object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j];
                    }
                    return object;
                };
    
                /**
                 * Converts this ResourceDescriptor to JSON.
                 * @function toJSON
                 * @memberof google.api.ResourceDescriptor
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                ResourceDescriptor.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for ResourceDescriptor
                 * @function getTypeUrl
                 * @memberof google.api.ResourceDescriptor
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.ResourceDescriptor";
                };
    
                /**
                 * History enum.
                 * @name google.api.ResourceDescriptor.History
                 * @enum {number}
                 * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value
                 * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value
                 * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value
                 */
                ResourceDescriptor.History = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0;
                    values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1;
                    values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2;
                    return values;
                })();
    
                /**
                 * Style enum.
                 * @name google.api.ResourceDescriptor.Style
                 * @enum {number}
                 * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value
                 * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value
                 */
                ResourceDescriptor.Style = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0;
                    values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1;
                    return values;
                })();
    
                return ResourceDescriptor;
            })();
    
            api.ResourceReference = (function() {
    
                /**
                 * Properties of a ResourceReference.
                 * @memberof google.api
                 * @interface IResourceReference
                 * @property {string|null} [type] ResourceReference type
                 * @property {string|null} [childType] ResourceReference childType
                 */
    
                /**
                 * Constructs a new ResourceReference.
                 * @memberof google.api
                 * @classdesc Represents a ResourceReference.
                 * @implements IResourceReference
                 * @constructor
                 * @param {google.api.IResourceReference=} [properties] Properties to set
                 */
                function ResourceReference(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * ResourceReference type.
                 * @member {string} type
                 * @memberof google.api.ResourceReference
                 * @instance
                 */
                ResourceReference.prototype.type = "";
    
                /**
                 * ResourceReference childType.
                 * @member {string} childType
                 * @memberof google.api.ResourceReference
                 * @instance
                 */
                ResourceReference.prototype.childType = "";
    
                /**
                 * Creates a new ResourceReference instance using the specified properties.
                 * @function create
                 * @memberof google.api.ResourceReference
                 * @static
                 * @param {google.api.IResourceReference=} [properties] Properties to set
                 * @returns {google.api.ResourceReference} ResourceReference instance
                 */
                ResourceReference.create = function create(properties) {
                    return new ResourceReference(properties);
                };
    
                /**
                 * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
                 * @function encode
                 * @memberof google.api.ResourceReference
                 * @static
                 * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ResourceReference.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);
                    if (message.childType != null && Object.hasOwnProperty.call(message, "childType"))
                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType);
                    return writer;
                };
    
                /**
                 * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.api.ResourceReference
                 * @static
                 * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ResourceReference.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a ResourceReference message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.api.ResourceReference
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.api.ResourceReference} ResourceReference
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ResourceReference.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.type = reader.string();
                                break;
                            }
                        case 2: {
                                message.childType = reader.string();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a ResourceReference message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.api.ResourceReference
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.api.ResourceReference} ResourceReference
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ResourceReference.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a ResourceReference message.
                 * @function verify
                 * @memberof google.api.ResourceReference
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                ResourceReference.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.type != null && message.hasOwnProperty("type"))
                        if (!$util.isString(message.type))
                            return "type: string expected";
                    if (message.childType != null && message.hasOwnProperty("childType"))
                        if (!$util.isString(message.childType))
                            return "childType: string expected";
                    return null;
                };
    
                /**
                 * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.api.ResourceReference
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.api.ResourceReference} ResourceReference
                 */
                ResourceReference.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.api.ResourceReference)
                        return object;
                    var message = new $root.google.api.ResourceReference();
                    if (object.type != null)
                        message.type = String(object.type);
                    if (object.childType != null)
                        message.childType = String(object.childType);
                    return message;
                };
    
                /**
                 * Creates a plain object from a ResourceReference message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.api.ResourceReference
                 * @static
                 * @param {google.api.ResourceReference} message ResourceReference
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                ResourceReference.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.type = "";
                        object.childType = "";
                    }
                    if (message.type != null && message.hasOwnProperty("type"))
                        object.type = message.type;
                    if (message.childType != null && message.hasOwnProperty("childType"))
                        object.childType = message.childType;
                    return object;
                };
    
                /**
                 * Converts this ResourceReference to JSON.
                 * @function toJSON
                 * @memberof google.api.ResourceReference
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                ResourceReference.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for ResourceReference
                 * @function getTypeUrl
                 * @memberof google.api.ResourceReference
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.api.ResourceReference";
                };
    
                return ResourceReference;
            })();
    
            return api;
        })();
    
        google.protobuf = (function() {
    
            /**
             * Namespace protobuf.
             * @memberof google
             * @namespace
             */
            var protobuf = {};
    
            protobuf.FileDescriptorSet = (function() {
    
                /**
                 * Properties of a FileDescriptorSet.
                 * @memberof google.protobuf
                 * @interface IFileDescriptorSet
                 * @property {Array.<google.protobuf.IFileDescriptorProto>|null} [file] FileDescriptorSet file
                 */
    
                /**
                 * Constructs a new FileDescriptorSet.
                 * @memberof google.protobuf
                 * @classdesc Represents a FileDescriptorSet.
                 * @implements IFileDescriptorSet
                 * @constructor
                 * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
                 */
                function FileDescriptorSet(properties) {
                    this.file = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * FileDescriptorSet file.
                 * @member {Array.<google.protobuf.IFileDescriptorProto>} file
                 * @memberof google.protobuf.FileDescriptorSet
                 * @instance
                 */
                FileDescriptorSet.prototype.file = $util.emptyArray;
    
                /**
                 * Creates a new FileDescriptorSet instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.FileDescriptorSet
                 * @static
                 * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
                 * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance
                 */
                FileDescriptorSet.create = function create(properties) {
                    return new FileDescriptorSet(properties);
                };
    
                /**
                 * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.FileDescriptorSet
                 * @static
                 * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FileDescriptorSet.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.file != null && message.file.length)
                        for (var i = 0; i < message.file.length; ++i)
                            $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.FileDescriptorSet
                 * @static
                 * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a FileDescriptorSet message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.FileDescriptorSet
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FileDescriptorSet.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                if (!(message.file && message.file.length))
                                    message.file = [];
                                message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.FileDescriptorSet
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a FileDescriptorSet message.
                 * @function verify
                 * @memberof google.protobuf.FileDescriptorSet
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                FileDescriptorSet.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.file != null && message.hasOwnProperty("file")) {
                        if (!Array.isArray(message.file))
                            return "file: array expected";
                        for (var i = 0; i < message.file.length; ++i) {
                            var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]);
                            if (error)
                                return "file." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.FileDescriptorSet
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
                 */
                FileDescriptorSet.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.FileDescriptorSet)
                        return object;
                    var message = new $root.google.protobuf.FileDescriptorSet();
                    if (object.file) {
                        if (!Array.isArray(object.file))
                            throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected");
                        message.file = [];
                        for (var i = 0; i < object.file.length; ++i) {
                            if (typeof object.file[i] !== "object")
                                throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected");
                            message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]);
                        }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.FileDescriptorSet
                 * @static
                 * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                FileDescriptorSet.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.file = [];
                    if (message.file && message.file.length) {
                        object.file = [];
                        for (var j = 0; j < message.file.length; ++j)
                            object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options);
                    }
                    return object;
                };
    
                /**
                 * Converts this FileDescriptorSet to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.FileDescriptorSet
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                FileDescriptorSet.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for FileDescriptorSet
                 * @function getTypeUrl
                 * @memberof google.protobuf.FileDescriptorSet
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.FileDescriptorSet";
                };
    
                return FileDescriptorSet;
            })();
    
            /**
             * Edition enum.
             * @name google.protobuf.Edition
             * @enum {number}
             * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value
             * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value
             * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value
             * @property {number} EDITION_2023=1000 EDITION_2023 value
             * @property {number} EDITION_2024=1001 EDITION_2024 value
             * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value
             * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value
             * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value
             * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value
             * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value
             * @property {number} EDITION_MAX=2147483647 EDITION_MAX value
             */
            protobuf.Edition = (function() {
                var valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "EDITION_UNKNOWN"] = 0;
                values[valuesById[998] = "EDITION_PROTO2"] = 998;
                values[valuesById[999] = "EDITION_PROTO3"] = 999;
                values[valuesById[1000] = "EDITION_2023"] = 1000;
                values[valuesById[1001] = "EDITION_2024"] = 1001;
                values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1;
                values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2;
                values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997;
                values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998;
                values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999;
                values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647;
                return values;
            })();
    
            protobuf.FileDescriptorProto = (function() {
    
                /**
                 * Properties of a FileDescriptorProto.
                 * @memberof google.protobuf
                 * @interface IFileDescriptorProto
                 * @property {string|null} [name] FileDescriptorProto name
                 * @property {string|null} ["package"] FileDescriptorProto package
                 * @property {Array.<string>|null} [dependency] FileDescriptorProto dependency
                 * @property {Array.<number>|null} [publicDependency] FileDescriptorProto publicDependency
                 * @property {Array.<number>|null} [weakDependency] FileDescriptorProto weakDependency
                 * @property {Array.<google.protobuf.IDescriptorProto>|null} [messageType] FileDescriptorProto messageType
                 * @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] FileDescriptorProto enumType
                 * @property {Array.<google.protobuf.IServiceDescriptorProto>|null} [service] FileDescriptorProto service
                 * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] FileDescriptorProto extension
                 * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options
                 * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo
                 * @property {string|null} [syntax] FileDescriptorProto syntax
                 * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition
                 */
    
                /**
                 * Constructs a new FileDescriptorProto.
                 * @memberof google.protobuf
                 * @classdesc Represents a FileDescriptorProto.
                 * @implements IFileDescriptorProto
                 * @constructor
                 * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
                 */
                function FileDescriptorProto(properties) {
                    this.dependency = [];
                    this.publicDependency = [];
                    this.weakDependency = [];
                    this.messageType = [];
                    this.enumType = [];
                    this.service = [];
                    this.extension = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * FileDescriptorProto name.
                 * @member {string} name
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.name = "";
    
                /**
                 * FileDescriptorProto package.
                 * @member {string} package
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype["package"] = "";
    
                /**
                 * FileDescriptorProto dependency.
                 * @member {Array.<string>} dependency
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.dependency = $util.emptyArray;
    
                /**
                 * FileDescriptorProto publicDependency.
                 * @member {Array.<number>} publicDependency
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.publicDependency = $util.emptyArray;
    
                /**
                 * FileDescriptorProto weakDependency.
                 * @member {Array.<number>} weakDependency
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.weakDependency = $util.emptyArray;
    
                /**
                 * FileDescriptorProto messageType.
                 * @member {Array.<google.protobuf.IDescriptorProto>} messageType
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.messageType = $util.emptyArray;
    
                /**
                 * FileDescriptorProto enumType.
                 * @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.enumType = $util.emptyArray;
    
                /**
                 * FileDescriptorProto service.
                 * @member {Array.<google.protobuf.IServiceDescriptorProto>} service
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.service = $util.emptyArray;
    
                /**
                 * FileDescriptorProto extension.
                 * @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.extension = $util.emptyArray;
    
                /**
                 * FileDescriptorProto options.
                 * @member {google.protobuf.IFileOptions|null|undefined} options
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.options = null;
    
                /**
                 * FileDescriptorProto sourceCodeInfo.
                 * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.sourceCodeInfo = null;
    
                /**
                 * FileDescriptorProto syntax.
                 * @member {string} syntax
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.syntax = "";
    
                /**
                 * FileDescriptorProto edition.
                 * @member {google.protobuf.Edition} edition
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 */
                FileDescriptorProto.prototype.edition = 0;
    
                /**
                 * Creates a new FileDescriptorProto instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.FileDescriptorProto
                 * @static
                 * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
                 * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance
                 */
                FileDescriptorProto.create = function create(properties) {
                    return new FileDescriptorProto(properties);
                };
    
                /**
                 * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.FileDescriptorProto
                 * @static
                 * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FileDescriptorProto.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    if (message["package"] != null && Object.hasOwnProperty.call(message, "package"))
                        writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]);
                    if (message.dependency != null && message.dependency.length)
                        for (var i = 0; i < message.dependency.length; ++i)
                            writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]);
                    if (message.messageType != null && message.messageType.length)
                        for (var i = 0; i < message.messageType.length; ++i)
                            $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                    if (message.enumType != null && message.enumType.length)
                        for (var i = 0; i < message.enumType.length; ++i)
                            $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                    if (message.service != null && message.service.length)
                        for (var i = 0; i < message.service.length; ++i)
                            $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                    if (message.extension != null && message.extension.length)
                        for (var i = 0; i < message.extension.length; ++i)
                            $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                    if (message.options != null && Object.hasOwnProperty.call(message, "options"))
                        $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                    if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo"))
                        $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                    if (message.publicDependency != null && message.publicDependency.length)
                        for (var i = 0; i < message.publicDependency.length; ++i)
                            writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]);
                    if (message.weakDependency != null && message.weakDependency.length)
                        for (var i = 0; i < message.weakDependency.length; ++i)
                            writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]);
                    if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax"))
                        writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax);
                    if (message.edition != null && Object.hasOwnProperty.call(message, "edition"))
                        writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition);
                    return writer;
                };
    
                /**
                 * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.FileDescriptorProto
                 * @static
                 * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a FileDescriptorProto message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.FileDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FileDescriptorProto.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        case 2: {
                                message["package"] = reader.string();
                                break;
                            }
                        case 3: {
                                if (!(message.dependency && message.dependency.length))
                                    message.dependency = [];
                                message.dependency.push(reader.string());
                                break;
                            }
                        case 10: {
                                if (!(message.publicDependency && message.publicDependency.length))
                                    message.publicDependency = [];
                                if ((tag & 7) === 2) {
                                    var end2 = reader.uint32() + reader.pos;
                                    while (reader.pos < end2)
                                        message.publicDependency.push(reader.int32());
                                } else
                                    message.publicDependency.push(reader.int32());
                                break;
                            }
                        case 11: {
                                if (!(message.weakDependency && message.weakDependency.length))
                                    message.weakDependency = [];
                                if ((tag & 7) === 2) {
                                    var end2 = reader.uint32() + reader.pos;
                                    while (reader.pos < end2)
                                        message.weakDependency.push(reader.int32());
                                } else
                                    message.weakDependency.push(reader.int32());
                                break;
                            }
                        case 4: {
                                if (!(message.messageType && message.messageType.length))
                                    message.messageType = [];
                                message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        case 5: {
                                if (!(message.enumType && message.enumType.length))
                                    message.enumType = [];
                                message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        case 6: {
                                if (!(message.service && message.service.length))
                                    message.service = [];
                                message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        case 7: {
                                if (!(message.extension && message.extension.length))
                                    message.extension = [];
                                message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        case 8: {
                                message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32());
                                break;
                            }
                        case 9: {
                                message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32());
                                break;
                            }
                        case 12: {
                                message.syntax = reader.string();
                                break;
                            }
                        case 14: {
                                message.edition = reader.int32();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.FileDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a FileDescriptorProto message.
                 * @function verify
                 * @memberof google.protobuf.FileDescriptorProto
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                FileDescriptorProto.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    if (message["package"] != null && message.hasOwnProperty("package"))
                        if (!$util.isString(message["package"]))
                            return "package: string expected";
                    if (message.dependency != null && message.hasOwnProperty("dependency")) {
                        if (!Array.isArray(message.dependency))
                            return "dependency: array expected";
                        for (var i = 0; i < message.dependency.length; ++i)
                            if (!$util.isString(message.dependency[i]))
                                return "dependency: string[] expected";
                    }
                    if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) {
                        if (!Array.isArray(message.publicDependency))
                            return "publicDependency: array expected";
                        for (var i = 0; i < message.publicDependency.length; ++i)
                            if (!$util.isInteger(message.publicDependency[i]))
                                return "publicDependency: integer[] expected";
                    }
                    if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) {
                        if (!Array.isArray(message.weakDependency))
                            return "weakDependency: array expected";
                        for (var i = 0; i < message.weakDependency.length; ++i)
                            if (!$util.isInteger(message.weakDependency[i]))
                                return "weakDependency: integer[] expected";
                    }
                    if (message.messageType != null && message.hasOwnProperty("messageType")) {
                        if (!Array.isArray(message.messageType))
                            return "messageType: array expected";
                        for (var i = 0; i < message.messageType.length; ++i) {
                            var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]);
                            if (error)
                                return "messageType." + error;
                        }
                    }
                    if (message.enumType != null && message.hasOwnProperty("enumType")) {
                        if (!Array.isArray(message.enumType))
                            return "enumType: array expected";
                        for (var i = 0; i < message.enumType.length; ++i) {
                            var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);
                            if (error)
                                return "enumType." + error;
                        }
                    }
                    if (message.service != null && message.hasOwnProperty("service")) {
                        if (!Array.isArray(message.service))
                            return "service: array expected";
                        for (var i = 0; i < message.service.length; ++i) {
                            var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]);
                            if (error)
                                return "service." + error;
                        }
                    }
                    if (message.extension != null && message.hasOwnProperty("extension")) {
                        if (!Array.isArray(message.extension))
                            return "extension: array expected";
                        for (var i = 0; i < message.extension.length; ++i) {
                            var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);
                            if (error)
                                return "extension." + error;
                        }
                    }
                    if (message.options != null && message.hasOwnProperty("options")) {
                        var error = $root.google.protobuf.FileOptions.verify(message.options);
                        if (error)
                            return "options." + error;
                    }
                    if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) {
                        var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo);
                        if (error)
                            return "sourceCodeInfo." + error;
                    }
                    if (message.syntax != null && message.hasOwnProperty("syntax"))
                        if (!$util.isString(message.syntax))
                            return "syntax: string expected";
                    if (message.edition != null && message.hasOwnProperty("edition"))
                        switch (message.edition) {
                        default:
                            return "edition: enum value expected";
                        case 0:
                        case 998:
                        case 999:
                        case 1000:
                        case 1001:
                        case 1:
                        case 2:
                        case 99997:
                        case 99998:
                        case 99999:
                        case 2147483647:
                            break;
                        }
                    return null;
                };
    
                /**
                 * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.FileDescriptorProto
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
                 */
                FileDescriptorProto.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.FileDescriptorProto)
                        return object;
                    var message = new $root.google.protobuf.FileDescriptorProto();
                    if (object.name != null)
                        message.name = String(object.name);
                    if (object["package"] != null)
                        message["package"] = String(object["package"]);
                    if (object.dependency) {
                        if (!Array.isArray(object.dependency))
                            throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected");
                        message.dependency = [];
                        for (var i = 0; i < object.dependency.length; ++i)
                            message.dependency[i] = String(object.dependency[i]);
                    }
                    if (object.publicDependency) {
                        if (!Array.isArray(object.publicDependency))
                            throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected");
                        message.publicDependency = [];
                        for (var i = 0; i < object.publicDependency.length; ++i)
                            message.publicDependency[i] = object.publicDependency[i] | 0;
                    }
                    if (object.weakDependency) {
                        if (!Array.isArray(object.weakDependency))
                            throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected");
                        message.weakDependency = [];
                        for (var i = 0; i < object.weakDependency.length; ++i)
                            message.weakDependency[i] = object.weakDependency[i] | 0;
                    }
                    if (object.messageType) {
                        if (!Array.isArray(object.messageType))
                            throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected");
                        message.messageType = [];
                        for (var i = 0; i < object.messageType.length; ++i) {
                            if (typeof object.messageType[i] !== "object")
                                throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected");
                            message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]);
                        }
                    }
                    if (object.enumType) {
                        if (!Array.isArray(object.enumType))
                            throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected");
                        message.enumType = [];
                        for (var i = 0; i < object.enumType.length; ++i) {
                            if (typeof object.enumType[i] !== "object")
                                throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected");
                            message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);
                        }
                    }
                    if (object.service) {
                        if (!Array.isArray(object.service))
                            throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected");
                        message.service = [];
                        for (var i = 0; i < object.service.length; ++i) {
                            if (typeof object.service[i] !== "object")
                                throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected");
                            message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]);
                        }
                    }
                    if (object.extension) {
                        if (!Array.isArray(object.extension))
                            throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected");
                        message.extension = [];
                        for (var i = 0; i < object.extension.length; ++i) {
                            if (typeof object.extension[i] !== "object")
                                throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected");
                            message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);
                        }
                    }
                    if (object.options != null) {
                        if (typeof object.options !== "object")
                            throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected");
                        message.options = $root.google.protobuf.FileOptions.fromObject(object.options);
                    }
                    if (object.sourceCodeInfo != null) {
                        if (typeof object.sourceCodeInfo !== "object")
                            throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected");
                        message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo);
                    }
                    if (object.syntax != null)
                        message.syntax = String(object.syntax);
                    switch (object.edition) {
                    default:
                        if (typeof object.edition === "number") {
                            message.edition = object.edition;
                            break;
                        }
                        break;
                    case "EDITION_UNKNOWN":
                    case 0:
                        message.edition = 0;
                        break;
                    case "EDITION_PROTO2":
                    case 998:
                        message.edition = 998;
                        break;
                    case "EDITION_PROTO3":
                    case 999:
                        message.edition = 999;
                        break;
                    case "EDITION_2023":
                    case 1000:
                        message.edition = 1000;
                        break;
                    case "EDITION_2024":
                    case 1001:
                        message.edition = 1001;
                        break;
                    case "EDITION_1_TEST_ONLY":
                    case 1:
                        message.edition = 1;
                        break;
                    case "EDITION_2_TEST_ONLY":
                    case 2:
                        message.edition = 2;
                        break;
                    case "EDITION_99997_TEST_ONLY":
                    case 99997:
                        message.edition = 99997;
                        break;
                    case "EDITION_99998_TEST_ONLY":
                    case 99998:
                        message.edition = 99998;
                        break;
                    case "EDITION_99999_TEST_ONLY":
                    case 99999:
                        message.edition = 99999;
                        break;
                    case "EDITION_MAX":
                    case 2147483647:
                        message.edition = 2147483647;
                        break;
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.FileDescriptorProto
                 * @static
                 * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                FileDescriptorProto.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults) {
                        object.dependency = [];
                        object.messageType = [];
                        object.enumType = [];
                        object.service = [];
                        object.extension = [];
                        object.publicDependency = [];
                        object.weakDependency = [];
                    }
                    if (options.defaults) {
                        object.name = "";
                        object["package"] = "";
                        object.options = null;
                        object.sourceCodeInfo = null;
                        object.syntax = "";
                        object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0;
                    }
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    if (message["package"] != null && message.hasOwnProperty("package"))
                        object["package"] = message["package"];
                    if (message.dependency && message.dependency.length) {
                        object.dependency = [];
                        for (var j = 0; j < message.dependency.length; ++j)
                            object.dependency[j] = message.dependency[j];
                    }
                    if (message.messageType && message.messageType.length) {
                        object.messageType = [];
                        for (var j = 0; j < message.messageType.length; ++j)
                            object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options);
                    }
                    if (message.enumType && message.enumType.length) {
                        object.enumType = [];
                        for (var j = 0; j < message.enumType.length; ++j)
                            object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);
                    }
                    if (message.service && message.service.length) {
                        object.service = [];
                        for (var j = 0; j < message.service.length; ++j)
                            object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options);
                    }
                    if (message.extension && message.extension.length) {
                        object.extension = [];
                        for (var j = 0; j < message.extension.length; ++j)
                            object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);
                    }
                    if (message.options != null && message.hasOwnProperty("options"))
                        object.options = $root.google.protobuf.FileOptions.toObject(message.options, options);
                    if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo"))
                        object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options);
                    if (message.publicDependency && message.publicDependency.length) {
                        object.publicDependency = [];
                        for (var j = 0; j < message.publicDependency.length; ++j)
                            object.publicDependency[j] = message.publicDependency[j];
                    }
                    if (message.weakDependency && message.weakDependency.length) {
                        object.weakDependency = [];
                        for (var j = 0; j < message.weakDependency.length; ++j)
                            object.weakDependency[j] = message.weakDependency[j];
                    }
                    if (message.syntax != null && message.hasOwnProperty("syntax"))
                        object.syntax = message.syntax;
                    if (message.edition != null && message.hasOwnProperty("edition"))
                        object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition;
                    return object;
                };
    
                /**
                 * Converts this FileDescriptorProto to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.FileDescriptorProto
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                FileDescriptorProto.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for FileDescriptorProto
                 * @function getTypeUrl
                 * @memberof google.protobuf.FileDescriptorProto
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.FileDescriptorProto";
                };
    
                return FileDescriptorProto;
            })();
    
            protobuf.DescriptorProto = (function() {
    
                /**
                 * Properties of a DescriptorProto.
                 * @memberof google.protobuf
                 * @interface IDescriptorProto
                 * @property {string|null} [name] DescriptorProto name
                 * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [field] DescriptorProto field
                 * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] DescriptorProto extension
                 * @property {Array.<google.protobuf.IDescriptorProto>|null} [nestedType] DescriptorProto nestedType
                 * @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] DescriptorProto enumType
                 * @property {Array.<google.protobuf.DescriptorProto.IExtensionRange>|null} [extensionRange] DescriptorProto extensionRange
                 * @property {Array.<google.protobuf.IOneofDescriptorProto>|null} [oneofDecl] DescriptorProto oneofDecl
                 * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options
                 * @property {Array.<google.protobuf.DescriptorProto.IReservedRange>|null} [reservedRange] DescriptorProto reservedRange
                 * @property {Array.<string>|null} [reservedName] DescriptorProto reservedName
                 */
    
                /**
                 * Constructs a new DescriptorProto.
                 * @memberof google.protobuf
                 * @classdesc Represents a DescriptorProto.
                 * @implements IDescriptorProto
                 * @constructor
                 * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
                 */
                function DescriptorProto(properties) {
                    this.field = [];
                    this.extension = [];
                    this.nestedType = [];
                    this.enumType = [];
                    this.extensionRange = [];
                    this.oneofDecl = [];
                    this.reservedRange = [];
                    this.reservedName = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * DescriptorProto name.
                 * @member {string} name
                 * @memberof google.protobuf.DescriptorProto
                 * @instance
                 */
                DescriptorProto.prototype.name = "";
    
                /**
                 * DescriptorProto field.
                 * @member {Array.<google.protobuf.IFieldDescriptorProto>} field
                 * @memberof google.protobuf.DescriptorProto
                 * @instance
                 */
                DescriptorProto.prototype.field = $util.emptyArray;
    
                /**
                 * DescriptorProto extension.
                 * @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
                 * @memberof google.protobuf.DescriptorProto
                 * @instance
                 */
                DescriptorProto.prototype.extension = $util.emptyArray;
    
                /**
                 * DescriptorProto nestedType.
                 * @member {Array.<google.protobuf.IDescriptorProto>} nestedType
                 * @memberof google.protobuf.DescriptorProto
                 * @instance
                 */
                DescriptorProto.prototype.nestedType = $util.emptyArray;
    
                /**
                 * DescriptorProto enumType.
                 * @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType
                 * @memberof google.protobuf.DescriptorProto
                 * @instance
                 */
                DescriptorProto.prototype.enumType = $util.emptyArray;
    
                /**
                 * DescriptorProto extensionRange.
                 * @member {Array.<google.protobuf.DescriptorProto.IExtensionRange>} extensionRange
                 * @memberof google.protobuf.DescriptorProto
                 * @instance
                 */
                DescriptorProto.prototype.extensionRange = $util.emptyArray;
    
                /**
                 * DescriptorProto oneofDecl.
                 * @member {Array.<google.protobuf.IOneofDescriptorProto>} oneofDecl
                 * @memberof google.protobuf.DescriptorProto
                 * @instance
                 */
                DescriptorProto.prototype.oneofDecl = $util.emptyArray;
    
                /**
                 * DescriptorProto options.
                 * @member {google.protobuf.IMessageOptions|null|undefined} options
                 * @memberof google.protobuf.DescriptorProto
                 * @instance
                 */
                DescriptorProto.prototype.options = null;
    
                /**
                 * DescriptorProto reservedRange.
                 * @member {Array.<google.protobuf.DescriptorProto.IReservedRange>} reservedRange
                 * @memberof google.protobuf.DescriptorProto
                 * @instance
                 */
                DescriptorProto.prototype.reservedRange = $util.emptyArray;
    
                /**
                 * DescriptorProto reservedName.
                 * @member {Array.<string>} reservedName
                 * @memberof google.protobuf.DescriptorProto
                 * @instance
                 */
                DescriptorProto.prototype.reservedName = $util.emptyArray;
    
                /**
                 * Creates a new DescriptorProto instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.DescriptorProto
                 * @static
                 * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
                 * @returns {google.protobuf.DescriptorProto} DescriptorProto instance
                 */
                DescriptorProto.create = function create(properties) {
                    return new DescriptorProto(properties);
                };
    
                /**
                 * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.DescriptorProto
                 * @static
                 * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                DescriptorProto.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    if (message.field != null && message.field.length)
                        for (var i = 0; i < message.field.length; ++i)
                            $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                    if (message.nestedType != null && message.nestedType.length)
                        for (var i = 0; i < message.nestedType.length; ++i)
                            $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                    if (message.enumType != null && message.enumType.length)
                        for (var i = 0; i < message.enumType.length; ++i)
                            $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                    if (message.extensionRange != null && message.extensionRange.length)
                        for (var i = 0; i < message.extensionRange.length; ++i)
                            $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                    if (message.extension != null && message.extension.length)
                        for (var i = 0; i < message.extension.length; ++i)
                            $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                    if (message.options != null && Object.hasOwnProperty.call(message, "options"))
                        $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                    if (message.oneofDecl != null && message.oneofDecl.length)
                        for (var i = 0; i < message.oneofDecl.length; ++i)
                            $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                    if (message.reservedRange != null && message.reservedRange.length)
                        for (var i = 0; i < message.reservedRange.length; ++i)
                            $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
                    if (message.reservedName != null && message.reservedName.length)
                        for (var i = 0; i < message.reservedName.length; ++i)
                            writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]);
                    return writer;
                };
    
                /**
                 * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.DescriptorProto
                 * @static
                 * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a DescriptorProto message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.DescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.DescriptorProto} DescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                DescriptorProto.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        case 2: {
                                if (!(message.field && message.field.length))
                                    message.field = [];
                                message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        case 6: {
                                if (!(message.extension && message.extension.length))
                                    message.extension = [];
                                message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        case 3: {
                                if (!(message.nestedType && message.nestedType.length))
                                    message.nestedType = [];
                                message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        case 4: {
                                if (!(message.enumType && message.enumType.length))
                                    message.enumType = [];
                                message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        case 5: {
                                if (!(message.extensionRange && message.extensionRange.length))
                                    message.extensionRange = [];
                                message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32()));
                                break;
                            }
                        case 8: {
                                if (!(message.oneofDecl && message.oneofDecl.length))
                                    message.oneofDecl = [];
                                message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        case 7: {
                                message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32());
                                break;
                            }
                        case 9: {
                                if (!(message.reservedRange && message.reservedRange.length))
                                    message.reservedRange = [];
                                message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32()));
                                break;
                            }
                        case 10: {
                                if (!(message.reservedName && message.reservedName.length))
                                    message.reservedName = [];
                                message.reservedName.push(reader.string());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a DescriptorProto message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.DescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.DescriptorProto} DescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                DescriptorProto.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a DescriptorProto message.
                 * @function verify
                 * @memberof google.protobuf.DescriptorProto
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                DescriptorProto.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    if (message.field != null && message.hasOwnProperty("field")) {
                        if (!Array.isArray(message.field))
                            return "field: array expected";
                        for (var i = 0; i < message.field.length; ++i) {
                            var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]);
                            if (error)
                                return "field." + error;
                        }
                    }
                    if (message.extension != null && message.hasOwnProperty("extension")) {
                        if (!Array.isArray(message.extension))
                            return "extension: array expected";
                        for (var i = 0; i < message.extension.length; ++i) {
                            var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);
                            if (error)
                                return "extension." + error;
                        }
                    }
                    if (message.nestedType != null && message.hasOwnProperty("nestedType")) {
                        if (!Array.isArray(message.nestedType))
                            return "nestedType: array expected";
                        for (var i = 0; i < message.nestedType.length; ++i) {
                            var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]);
                            if (error)
                                return "nestedType." + error;
                        }
                    }
                    if (message.enumType != null && message.hasOwnProperty("enumType")) {
                        if (!Array.isArray(message.enumType))
                            return "enumType: array expected";
                        for (var i = 0; i < message.enumType.length; ++i) {
                            var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);
                            if (error)
                                return "enumType." + error;
                        }
                    }
                    if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) {
                        if (!Array.isArray(message.extensionRange))
                            return "extensionRange: array expected";
                        for (var i = 0; i < message.extensionRange.length; ++i) {
                            var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]);
                            if (error)
                                return "extensionRange." + error;
                        }
                    }
                    if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) {
                        if (!Array.isArray(message.oneofDecl))
                            return "oneofDecl: array expected";
                        for (var i = 0; i < message.oneofDecl.length; ++i) {
                            var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]);
                            if (error)
                                return "oneofDecl." + error;
                        }
                    }
                    if (message.options != null && message.hasOwnProperty("options")) {
                        var error = $root.google.protobuf.MessageOptions.verify(message.options);
                        if (error)
                            return "options." + error;
                    }
                    if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) {
                        if (!Array.isArray(message.reservedRange))
                            return "reservedRange: array expected";
                        for (var i = 0; i < message.reservedRange.length; ++i) {
                            var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]);
                            if (error)
                                return "reservedRange." + error;
                        }
                    }
                    if (message.reservedName != null && message.hasOwnProperty("reservedName")) {
                        if (!Array.isArray(message.reservedName))
                            return "reservedName: array expected";
                        for (var i = 0; i < message.reservedName.length; ++i)
                            if (!$util.isString(message.reservedName[i]))
                                return "reservedName: string[] expected";
                    }
                    return null;
                };
    
                /**
                 * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.DescriptorProto
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.DescriptorProto} DescriptorProto
                 */
                DescriptorProto.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.DescriptorProto)
                        return object;
                    var message = new $root.google.protobuf.DescriptorProto();
                    if (object.name != null)
                        message.name = String(object.name);
                    if (object.field) {
                        if (!Array.isArray(object.field))
                            throw TypeError(".google.protobuf.DescriptorProto.field: array expected");
                        message.field = [];
                        for (var i = 0; i < object.field.length; ++i) {
                            if (typeof object.field[i] !== "object")
                                throw TypeError(".google.protobuf.DescriptorProto.field: object expected");
                            message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]);
                        }
                    }
                    if (object.extension) {
                        if (!Array.isArray(object.extension))
                            throw TypeError(".google.protobuf.DescriptorProto.extension: array expected");
                        message.extension = [];
                        for (var i = 0; i < object.extension.length; ++i) {
                            if (typeof object.extension[i] !== "object")
                                throw TypeError(".google.protobuf.DescriptorProto.extension: object expected");
                            message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);
                        }
                    }
                    if (object.nestedType) {
                        if (!Array.isArray(object.nestedType))
                            throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected");
                        message.nestedType = [];
                        for (var i = 0; i < object.nestedType.length; ++i) {
                            if (typeof object.nestedType[i] !== "object")
                                throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected");
                            message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]);
                        }
                    }
                    if (object.enumType) {
                        if (!Array.isArray(object.enumType))
                            throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected");
                        message.enumType = [];
                        for (var i = 0; i < object.enumType.length; ++i) {
                            if (typeof object.enumType[i] !== "object")
                                throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected");
                            message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);
                        }
                    }
                    if (object.extensionRange) {
                        if (!Array.isArray(object.extensionRange))
                            throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected");
                        message.extensionRange = [];
                        for (var i = 0; i < object.extensionRange.length; ++i) {
                            if (typeof object.extensionRange[i] !== "object")
                                throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected");
                            message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]);
                        }
                    }
                    if (object.oneofDecl) {
                        if (!Array.isArray(object.oneofDecl))
                            throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected");
                        message.oneofDecl = [];
                        for (var i = 0; i < object.oneofDecl.length; ++i) {
                            if (typeof object.oneofDecl[i] !== "object")
                                throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected");
                            message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]);
                        }
                    }
                    if (object.options != null) {
                        if (typeof object.options !== "object")
                            throw TypeError(".google.protobuf.DescriptorProto.options: object expected");
                        message.options = $root.google.protobuf.MessageOptions.fromObject(object.options);
                    }
                    if (object.reservedRange) {
                        if (!Array.isArray(object.reservedRange))
                            throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected");
                        message.reservedRange = [];
                        for (var i = 0; i < object.reservedRange.length; ++i) {
                            if (typeof object.reservedRange[i] !== "object")
                                throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected");
                            message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]);
                        }
                    }
                    if (object.reservedName) {
                        if (!Array.isArray(object.reservedName))
                            throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected");
                        message.reservedName = [];
                        for (var i = 0; i < object.reservedName.length; ++i)
                            message.reservedName[i] = String(object.reservedName[i]);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.DescriptorProto
                 * @static
                 * @param {google.protobuf.DescriptorProto} message DescriptorProto
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                DescriptorProto.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults) {
                        object.field = [];
                        object.nestedType = [];
                        object.enumType = [];
                        object.extensionRange = [];
                        object.extension = [];
                        object.oneofDecl = [];
                        object.reservedRange = [];
                        object.reservedName = [];
                    }
                    if (options.defaults) {
                        object.name = "";
                        object.options = null;
                    }
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    if (message.field && message.field.length) {
                        object.field = [];
                        for (var j = 0; j < message.field.length; ++j)
                            object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options);
                    }
                    if (message.nestedType && message.nestedType.length) {
                        object.nestedType = [];
                        for (var j = 0; j < message.nestedType.length; ++j)
                            object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options);
                    }
                    if (message.enumType && message.enumType.length) {
                        object.enumType = [];
                        for (var j = 0; j < message.enumType.length; ++j)
                            object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);
                    }
                    if (message.extensionRange && message.extensionRange.length) {
                        object.extensionRange = [];
                        for (var j = 0; j < message.extensionRange.length; ++j)
                            object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options);
                    }
                    if (message.extension && message.extension.length) {
                        object.extension = [];
                        for (var j = 0; j < message.extension.length; ++j)
                            object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);
                    }
                    if (message.options != null && message.hasOwnProperty("options"))
                        object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options);
                    if (message.oneofDecl && message.oneofDecl.length) {
                        object.oneofDecl = [];
                        for (var j = 0; j < message.oneofDecl.length; ++j)
                            object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options);
                    }
                    if (message.reservedRange && message.reservedRange.length) {
                        object.reservedRange = [];
                        for (var j = 0; j < message.reservedRange.length; ++j)
                            object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options);
                    }
                    if (message.reservedName && message.reservedName.length) {
                        object.reservedName = [];
                        for (var j = 0; j < message.reservedName.length; ++j)
                            object.reservedName[j] = message.reservedName[j];
                    }
                    return object;
                };
    
                /**
                 * Converts this DescriptorProto to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.DescriptorProto
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                DescriptorProto.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for DescriptorProto
                 * @function getTypeUrl
                 * @memberof google.protobuf.DescriptorProto
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.DescriptorProto";
                };
    
                DescriptorProto.ExtensionRange = (function() {
    
                    /**
                     * Properties of an ExtensionRange.
                     * @memberof google.protobuf.DescriptorProto
                     * @interface IExtensionRange
                     * @property {number|null} [start] ExtensionRange start
                     * @property {number|null} [end] ExtensionRange end
                     * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options
                     */
    
                    /**
                     * Constructs a new ExtensionRange.
                     * @memberof google.protobuf.DescriptorProto
                     * @classdesc Represents an ExtensionRange.
                     * @implements IExtensionRange
                     * @constructor
                     * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
                     */
                    function ExtensionRange(properties) {
                        if (properties)
                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                if (properties[keys[i]] != null)
                                    this[keys[i]] = properties[keys[i]];
                    }
    
                    /**
                     * ExtensionRange start.
                     * @member {number} start
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @instance
                     */
                    ExtensionRange.prototype.start = 0;
    
                    /**
                     * ExtensionRange end.
                     * @member {number} end
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @instance
                     */
                    ExtensionRange.prototype.end = 0;
    
                    /**
                     * ExtensionRange options.
                     * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @instance
                     */
                    ExtensionRange.prototype.options = null;
    
                    /**
                     * Creates a new ExtensionRange instance using the specified properties.
                     * @function create
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @static
                     * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
                     * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance
                     */
                    ExtensionRange.create = function create(properties) {
                        return new ExtensionRange(properties);
                    };
    
                    /**
                     * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
                     * @function encode
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @static
                     * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    ExtensionRange.encode = function encode(message, writer) {
                        if (!writer)
                            writer = $Writer.create();
                        if (message.start != null && Object.hasOwnProperty.call(message, "start"))
                            writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
                        if (message.end != null && Object.hasOwnProperty.call(message, "end"))
                            writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
                        if (message.options != null && Object.hasOwnProperty.call(message, "options"))
                            $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                        return writer;
                    };
    
                    /**
                     * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
                     * @function encodeDelimited
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @static
                     * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) {
                        return this.encode(message, writer).ldelim();
                    };
    
                    /**
                     * Decodes an ExtensionRange message from the specified reader or buffer.
                     * @function decode
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    ExtensionRange.decode = function decode(reader, length) {
                        if (!(reader instanceof $Reader))
                            reader = $Reader.create(reader);
                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange();
                        while (reader.pos < end) {
                            var tag = reader.uint32();
                            switch (tag >>> 3) {
                            case 1: {
                                    message.start = reader.int32();
                                    break;
                                }
                            case 2: {
                                    message.end = reader.int32();
                                    break;
                                }
                            case 3: {
                                    message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32());
                                    break;
                                }
                            default:
                                reader.skipType(tag & 7);
                                break;
                            }
                        }
                        return message;
                    };
    
                    /**
                     * Decodes an ExtensionRange message from the specified reader or buffer, length delimited.
                     * @function decodeDelimited
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    ExtensionRange.decodeDelimited = function decodeDelimited(reader) {
                        if (!(reader instanceof $Reader))
                            reader = new $Reader(reader);
                        return this.decode(reader, reader.uint32());
                    };
    
                    /**
                     * Verifies an ExtensionRange message.
                     * @function verify
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @static
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {string|null} `null` if valid, otherwise the reason why it is not
                     */
                    ExtensionRange.verify = function verify(message) {
                        if (typeof message !== "object" || message === null)
                            return "object expected";
                        if (message.start != null && message.hasOwnProperty("start"))
                            if (!$util.isInteger(message.start))
                                return "start: integer expected";
                        if (message.end != null && message.hasOwnProperty("end"))
                            if (!$util.isInteger(message.end))
                                return "end: integer expected";
                        if (message.options != null && message.hasOwnProperty("options")) {
                            var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options);
                            if (error)
                                return "options." + error;
                        }
                        return null;
                    };
    
                    /**
                     * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types.
                     * @function fromObject
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @static
                     * @param {Object.<string,*>} object Plain object
                     * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
                     */
                    ExtensionRange.fromObject = function fromObject(object) {
                        if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange)
                            return object;
                        var message = new $root.google.protobuf.DescriptorProto.ExtensionRange();
                        if (object.start != null)
                            message.start = object.start | 0;
                        if (object.end != null)
                            message.end = object.end | 0;
                        if (object.options != null) {
                            if (typeof object.options !== "object")
                                throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected");
                            message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options);
                        }
                        return message;
                    };
    
                    /**
                     * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified.
                     * @function toObject
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @static
                     * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange
                     * @param {$protobuf.IConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    ExtensionRange.toObject = function toObject(message, options) {
                        if (!options)
                            options = {};
                        var object = {};
                        if (options.defaults) {
                            object.start = 0;
                            object.end = 0;
                            object.options = null;
                        }
                        if (message.start != null && message.hasOwnProperty("start"))
                            object.start = message.start;
                        if (message.end != null && message.hasOwnProperty("end"))
                            object.end = message.end;
                        if (message.options != null && message.hasOwnProperty("options"))
                            object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options);
                        return object;
                    };
    
                    /**
                     * Converts this ExtensionRange to JSON.
                     * @function toJSON
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @instance
                     * @returns {Object.<string,*>} JSON object
                     */
                    ExtensionRange.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };
    
                    /**
                     * Gets the default type url for ExtensionRange
                     * @function getTypeUrl
                     * @memberof google.protobuf.DescriptorProto.ExtensionRange
                     * @static
                     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                     * @returns {string} The default type url
                     */
                    ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange";
                    };
    
                    return ExtensionRange;
                })();
    
                DescriptorProto.ReservedRange = (function() {
    
                    /**
                     * Properties of a ReservedRange.
                     * @memberof google.protobuf.DescriptorProto
                     * @interface IReservedRange
                     * @property {number|null} [start] ReservedRange start
                     * @property {number|null} [end] ReservedRange end
                     */
    
                    /**
                     * Constructs a new ReservedRange.
                     * @memberof google.protobuf.DescriptorProto
                     * @classdesc Represents a ReservedRange.
                     * @implements IReservedRange
                     * @constructor
                     * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set
                     */
                    function ReservedRange(properties) {
                        if (properties)
                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                if (properties[keys[i]] != null)
                                    this[keys[i]] = properties[keys[i]];
                    }
    
                    /**
                     * ReservedRange start.
                     * @member {number} start
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @instance
                     */
                    ReservedRange.prototype.start = 0;
    
                    /**
                     * ReservedRange end.
                     * @member {number} end
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @instance
                     */
                    ReservedRange.prototype.end = 0;
    
                    /**
                     * Creates a new ReservedRange instance using the specified properties.
                     * @function create
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @static
                     * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set
                     * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance
                     */
                    ReservedRange.create = function create(properties) {
                        return new ReservedRange(properties);
                    };
    
                    /**
                     * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.
                     * @function encode
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @static
                     * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    ReservedRange.encode = function encode(message, writer) {
                        if (!writer)
                            writer = $Writer.create();
                        if (message.start != null && Object.hasOwnProperty.call(message, "start"))
                            writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
                        if (message.end != null && Object.hasOwnProperty.call(message, "end"))
                            writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
                        return writer;
                    };
    
                    /**
                     * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.
                     * @function encodeDelimited
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @static
                     * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    ReservedRange.encodeDelimited = function encodeDelimited(message, writer) {
                        return this.encode(message, writer).ldelim();
                    };
    
                    /**
                     * Decodes a ReservedRange message from the specified reader or buffer.
                     * @function decode
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    ReservedRange.decode = function decode(reader, length) {
                        if (!(reader instanceof $Reader))
                            reader = $Reader.create(reader);
                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange();
                        while (reader.pos < end) {
                            var tag = reader.uint32();
                            switch (tag >>> 3) {
                            case 1: {
                                    message.start = reader.int32();
                                    break;
                                }
                            case 2: {
                                    message.end = reader.int32();
                                    break;
                                }
                            default:
                                reader.skipType(tag & 7);
                                break;
                            }
                        }
                        return message;
                    };
    
                    /**
                     * Decodes a ReservedRange message from the specified reader or buffer, length delimited.
                     * @function decodeDelimited
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    ReservedRange.decodeDelimited = function decodeDelimited(reader) {
                        if (!(reader instanceof $Reader))
                            reader = new $Reader(reader);
                        return this.decode(reader, reader.uint32());
                    };
    
                    /**
                     * Verifies a ReservedRange message.
                     * @function verify
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @static
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {string|null} `null` if valid, otherwise the reason why it is not
                     */
                    ReservedRange.verify = function verify(message) {
                        if (typeof message !== "object" || message === null)
                            return "object expected";
                        if (message.start != null && message.hasOwnProperty("start"))
                            if (!$util.isInteger(message.start))
                                return "start: integer expected";
                        if (message.end != null && message.hasOwnProperty("end"))
                            if (!$util.isInteger(message.end))
                                return "end: integer expected";
                        return null;
                    };
    
                    /**
                     * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types.
                     * @function fromObject
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @static
                     * @param {Object.<string,*>} object Plain object
                     * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
                     */
                    ReservedRange.fromObject = function fromObject(object) {
                        if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange)
                            return object;
                        var message = new $root.google.protobuf.DescriptorProto.ReservedRange();
                        if (object.start != null)
                            message.start = object.start | 0;
                        if (object.end != null)
                            message.end = object.end | 0;
                        return message;
                    };
    
                    /**
                     * Creates a plain object from a ReservedRange message. Also converts values to other types if specified.
                     * @function toObject
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @static
                     * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange
                     * @param {$protobuf.IConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    ReservedRange.toObject = function toObject(message, options) {
                        if (!options)
                            options = {};
                        var object = {};
                        if (options.defaults) {
                            object.start = 0;
                            object.end = 0;
                        }
                        if (message.start != null && message.hasOwnProperty("start"))
                            object.start = message.start;
                        if (message.end != null && message.hasOwnProperty("end"))
                            object.end = message.end;
                        return object;
                    };
    
                    /**
                     * Converts this ReservedRange to JSON.
                     * @function toJSON
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @instance
                     * @returns {Object.<string,*>} JSON object
                     */
                    ReservedRange.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };
    
                    /**
                     * Gets the default type url for ReservedRange
                     * @function getTypeUrl
                     * @memberof google.protobuf.DescriptorProto.ReservedRange
                     * @static
                     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                     * @returns {string} The default type url
                     */
                    ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange";
                    };
    
                    return ReservedRange;
                })();
    
                return DescriptorProto;
            })();
    
            protobuf.ExtensionRangeOptions = (function() {
    
                /**
                 * Properties of an ExtensionRangeOptions.
                 * @memberof google.protobuf
                 * @interface IExtensionRangeOptions
                 * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption
                 * @property {Array.<google.protobuf.ExtensionRangeOptions.IDeclaration>|null} [declaration] ExtensionRangeOptions declaration
                 * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features
                 * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification
                 */
    
                /**
                 * Constructs a new ExtensionRangeOptions.
                 * @memberof google.protobuf
                 * @classdesc Represents an ExtensionRangeOptions.
                 * @implements IExtensionRangeOptions
                 * @constructor
                 * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set
                 */
                function ExtensionRangeOptions(properties) {
                    this.uninterpretedOption = [];
                    this.declaration = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * ExtensionRangeOptions uninterpretedOption.
                 * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @instance
                 */
                ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray;
    
                /**
                 * ExtensionRangeOptions declaration.
                 * @member {Array.<google.protobuf.ExtensionRangeOptions.IDeclaration>} declaration
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @instance
                 */
                ExtensionRangeOptions.prototype.declaration = $util.emptyArray;
    
                /**
                 * ExtensionRangeOptions features.
                 * @member {google.protobuf.IFeatureSet|null|undefined} features
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @instance
                 */
                ExtensionRangeOptions.prototype.features = null;
    
                /**
                 * ExtensionRangeOptions verification.
                 * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @instance
                 */
                ExtensionRangeOptions.prototype.verification = 1;
    
                /**
                 * Creates a new ExtensionRangeOptions instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @static
                 * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set
                 * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance
                 */
                ExtensionRangeOptions.create = function create(properties) {
                    return new ExtensionRangeOptions(properties);
                };
    
                /**
                 * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @static
                 * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ExtensionRangeOptions.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.declaration != null && message.declaration.length)
                        for (var i = 0; i < message.declaration.length; ++i)
                            $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                    if (message.verification != null && Object.hasOwnProperty.call(message, "verification"))
                        writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification);
                    if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                        $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim();
                    if (message.uninterpretedOption != null && message.uninterpretedOption.length)
                        for (var i = 0; i < message.uninterpretedOption.length; ++i)
                            $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @static
                 * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an ExtensionRangeOptions message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ExtensionRangeOptions.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 999: {
                                if (!(message.uninterpretedOption && message.uninterpretedOption.length))
                                    message.uninterpretedOption = [];
                                message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
                                break;
                            }
                        case 2: {
                                if (!(message.declaration && message.declaration.length))
                                    message.declaration = [];
                                message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32()));
                                break;
                            }
                        case 50: {
                                message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());
                                break;
                            }
                        case 3: {
                                message.verification = reader.int32();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an ExtensionRangeOptions message.
                 * @function verify
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                ExtensionRangeOptions.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
                        if (!Array.isArray(message.uninterpretedOption))
                            return "uninterpretedOption: array expected";
                        for (var i = 0; i < message.uninterpretedOption.length; ++i) {
                            var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
                            if (error)
                                return "uninterpretedOption." + error;
                        }
                    }
                    if (message.declaration != null && message.hasOwnProperty("declaration")) {
                        if (!Array.isArray(message.declaration))
                            return "declaration: array expected";
                        for (var i = 0; i < message.declaration.length; ++i) {
                            var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]);
                            if (error)
                                return "declaration." + error;
                        }
                    }
                    if (message.features != null && message.hasOwnProperty("features")) {
                        var error = $root.google.protobuf.FeatureSet.verify(message.features);
                        if (error)
                            return "features." + error;
                    }
                    if (message.verification != null && message.hasOwnProperty("verification"))
                        switch (message.verification) {
                        default:
                            return "verification: enum value expected";
                        case 0:
                        case 1:
                            break;
                        }
                    return null;
                };
    
                /**
                 * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
                 */
                ExtensionRangeOptions.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.ExtensionRangeOptions)
                        return object;
                    var message = new $root.google.protobuf.ExtensionRangeOptions();
                    if (object.uninterpretedOption) {
                        if (!Array.isArray(object.uninterpretedOption))
                            throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected");
                        message.uninterpretedOption = [];
                        for (var i = 0; i < object.uninterpretedOption.length; ++i) {
                            if (typeof object.uninterpretedOption[i] !== "object")
                                throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected");
                            message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
                        }
                    }
                    if (object.declaration) {
                        if (!Array.isArray(object.declaration))
                            throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected");
                        message.declaration = [];
                        for (var i = 0; i < object.declaration.length; ++i) {
                            if (typeof object.declaration[i] !== "object")
                                throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected");
                            message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]);
                        }
                    }
                    if (object.features != null) {
                        if (typeof object.features !== "object")
                            throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected");
                        message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);
                    }
                    switch (object.verification) {
                    case "DECLARATION":
                    case 0:
                        message.verification = 0;
                        break;
                    default:
                        if (typeof object.verification === "number") {
                            message.verification = object.verification;
                            break;
                        }
                        break;
                    case "UNVERIFIED":
                    case 1:
                        message.verification = 1;
                        break;
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @static
                 * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                ExtensionRangeOptions.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults) {
                        object.declaration = [];
                        object.uninterpretedOption = [];
                    }
                    if (options.defaults) {
                        object.verification = options.enums === String ? "UNVERIFIED" : 1;
                        object.features = null;
                    }
                    if (message.declaration && message.declaration.length) {
                        object.declaration = [];
                        for (var j = 0; j < message.declaration.length; ++j)
                            object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options);
                    }
                    if (message.verification != null && message.hasOwnProperty("verification"))
                        object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification;
                    if (message.features != null && message.hasOwnProperty("features"))
                        object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);
                    if (message.uninterpretedOption && message.uninterpretedOption.length) {
                        object.uninterpretedOption = [];
                        for (var j = 0; j < message.uninterpretedOption.length; ++j)
                            object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
                    }
                    return object;
                };
    
                /**
                 * Converts this ExtensionRangeOptions to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                ExtensionRangeOptions.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for ExtensionRangeOptions
                 * @function getTypeUrl
                 * @memberof google.protobuf.ExtensionRangeOptions
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions";
                };
    
                ExtensionRangeOptions.Declaration = (function() {
    
                    /**
                     * Properties of a Declaration.
                     * @memberof google.protobuf.ExtensionRangeOptions
                     * @interface IDeclaration
                     * @property {number|null} [number] Declaration number
                     * @property {string|null} [fullName] Declaration fullName
                     * @property {string|null} [type] Declaration type
                     * @property {boolean|null} [reserved] Declaration reserved
                     * @property {boolean|null} [repeated] Declaration repeated
                     */
    
                    /**
                     * Constructs a new Declaration.
                     * @memberof google.protobuf.ExtensionRangeOptions
                     * @classdesc Represents a Declaration.
                     * @implements IDeclaration
                     * @constructor
                     * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set
                     */
                    function Declaration(properties) {
                        if (properties)
                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                if (properties[keys[i]] != null)
                                    this[keys[i]] = properties[keys[i]];
                    }
    
                    /**
                     * Declaration number.
                     * @member {number} number
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @instance
                     */
                    Declaration.prototype.number = 0;
    
                    /**
                     * Declaration fullName.
                     * @member {string} fullName
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @instance
                     */
                    Declaration.prototype.fullName = "";
    
                    /**
                     * Declaration type.
                     * @member {string} type
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @instance
                     */
                    Declaration.prototype.type = "";
    
                    /**
                     * Declaration reserved.
                     * @member {boolean} reserved
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @instance
                     */
                    Declaration.prototype.reserved = false;
    
                    /**
                     * Declaration repeated.
                     * @member {boolean} repeated
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @instance
                     */
                    Declaration.prototype.repeated = false;
    
                    /**
                     * Creates a new Declaration instance using the specified properties.
                     * @function create
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @static
                     * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set
                     * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance
                     */
                    Declaration.create = function create(properties) {
                        return new Declaration(properties);
                    };
    
                    /**
                     * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages.
                     * @function encode
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @static
                     * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    Declaration.encode = function encode(message, writer) {
                        if (!writer)
                            writer = $Writer.create();
                        if (message.number != null && Object.hasOwnProperty.call(message, "number"))
                            writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number);
                        if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName"))
                            writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName);
                        if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                            writer.uint32(/* id 3, wireType 2 =*/26).string(message.type);
                        if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved"))
                            writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved);
                        if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated"))
                            writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated);
                        return writer;
                    };
    
                    /**
                     * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages.
                     * @function encodeDelimited
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @static
                     * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    Declaration.encodeDelimited = function encodeDelimited(message, writer) {
                        return this.encode(message, writer).ldelim();
                    };
    
                    /**
                     * Decodes a Declaration message from the specified reader or buffer.
                     * @function decode
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    Declaration.decode = function decode(reader, length) {
                        if (!(reader instanceof $Reader))
                            reader = $Reader.create(reader);
                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration();
                        while (reader.pos < end) {
                            var tag = reader.uint32();
                            switch (tag >>> 3) {
                            case 1: {
                                    message.number = reader.int32();
                                    break;
                                }
                            case 2: {
                                    message.fullName = reader.string();
                                    break;
                                }
                            case 3: {
                                    message.type = reader.string();
                                    break;
                                }
                            case 5: {
                                    message.reserved = reader.bool();
                                    break;
                                }
                            case 6: {
                                    message.repeated = reader.bool();
                                    break;
                                }
                            default:
                                reader.skipType(tag & 7);
                                break;
                            }
                        }
                        return message;
                    };
    
                    /**
                     * Decodes a Declaration message from the specified reader or buffer, length delimited.
                     * @function decodeDelimited
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    Declaration.decodeDelimited = function decodeDelimited(reader) {
                        if (!(reader instanceof $Reader))
                            reader = new $Reader(reader);
                        return this.decode(reader, reader.uint32());
                    };
    
                    /**
                     * Verifies a Declaration message.
                     * @function verify
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @static
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {string|null} `null` if valid, otherwise the reason why it is not
                     */
                    Declaration.verify = function verify(message) {
                        if (typeof message !== "object" || message === null)
                            return "object expected";
                        if (message.number != null && message.hasOwnProperty("number"))
                            if (!$util.isInteger(message.number))
                                return "number: integer expected";
                        if (message.fullName != null && message.hasOwnProperty("fullName"))
                            if (!$util.isString(message.fullName))
                                return "fullName: string expected";
                        if (message.type != null && message.hasOwnProperty("type"))
                            if (!$util.isString(message.type))
                                return "type: string expected";
                        if (message.reserved != null && message.hasOwnProperty("reserved"))
                            if (typeof message.reserved !== "boolean")
                                return "reserved: boolean expected";
                        if (message.repeated != null && message.hasOwnProperty("repeated"))
                            if (typeof message.repeated !== "boolean")
                                return "repeated: boolean expected";
                        return null;
                    };
    
                    /**
                     * Creates a Declaration message from a plain object. Also converts values to their respective internal types.
                     * @function fromObject
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @static
                     * @param {Object.<string,*>} object Plain object
                     * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration
                     */
                    Declaration.fromObject = function fromObject(object) {
                        if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration)
                            return object;
                        var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration();
                        if (object.number != null)
                            message.number = object.number | 0;
                        if (object.fullName != null)
                            message.fullName = String(object.fullName);
                        if (object.type != null)
                            message.type = String(object.type);
                        if (object.reserved != null)
                            message.reserved = Boolean(object.reserved);
                        if (object.repeated != null)
                            message.repeated = Boolean(object.repeated);
                        return message;
                    };
    
                    /**
                     * Creates a plain object from a Declaration message. Also converts values to other types if specified.
                     * @function toObject
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @static
                     * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration
                     * @param {$protobuf.IConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    Declaration.toObject = function toObject(message, options) {
                        if (!options)
                            options = {};
                        var object = {};
                        if (options.defaults) {
                            object.number = 0;
                            object.fullName = "";
                            object.type = "";
                            object.reserved = false;
                            object.repeated = false;
                        }
                        if (message.number != null && message.hasOwnProperty("number"))
                            object.number = message.number;
                        if (message.fullName != null && message.hasOwnProperty("fullName"))
                            object.fullName = message.fullName;
                        if (message.type != null && message.hasOwnProperty("type"))
                            object.type = message.type;
                        if (message.reserved != null && message.hasOwnProperty("reserved"))
                            object.reserved = message.reserved;
                        if (message.repeated != null && message.hasOwnProperty("repeated"))
                            object.repeated = message.repeated;
                        return object;
                    };
    
                    /**
                     * Converts this Declaration to JSON.
                     * @function toJSON
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @instance
                     * @returns {Object.<string,*>} JSON object
                     */
                    Declaration.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };
    
                    /**
                     * Gets the default type url for Declaration
                     * @function getTypeUrl
                     * @memberof google.protobuf.ExtensionRangeOptions.Declaration
                     * @static
                     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                     * @returns {string} The default type url
                     */
                    Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration";
                    };
    
                    return Declaration;
                })();
    
                /**
                 * VerificationState enum.
                 * @name google.protobuf.ExtensionRangeOptions.VerificationState
                 * @enum {number}
                 * @property {number} DECLARATION=0 DECLARATION value
                 * @property {number} UNVERIFIED=1 UNVERIFIED value
                 */
                ExtensionRangeOptions.VerificationState = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "DECLARATION"] = 0;
                    values[valuesById[1] = "UNVERIFIED"] = 1;
                    return values;
                })();
    
                return ExtensionRangeOptions;
            })();
    
            protobuf.FieldDescriptorProto = (function() {
    
                /**
                 * Properties of a FieldDescriptorProto.
                 * @memberof google.protobuf
                 * @interface IFieldDescriptorProto
                 * @property {string|null} [name] FieldDescriptorProto name
                 * @property {number|null} [number] FieldDescriptorProto number
                 * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label
                 * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type
                 * @property {string|null} [typeName] FieldDescriptorProto typeName
                 * @property {string|null} [extendee] FieldDescriptorProto extendee
                 * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue
                 * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex
                 * @property {string|null} [jsonName] FieldDescriptorProto jsonName
                 * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options
                 * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional
                 */
    
                /**
                 * Constructs a new FieldDescriptorProto.
                 * @memberof google.protobuf
                 * @classdesc Represents a FieldDescriptorProto.
                 * @implements IFieldDescriptorProto
                 * @constructor
                 * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
                 */
                function FieldDescriptorProto(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * FieldDescriptorProto name.
                 * @member {string} name
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 */
                FieldDescriptorProto.prototype.name = "";
    
                /**
                 * FieldDescriptorProto number.
                 * @member {number} number
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 */
                FieldDescriptorProto.prototype.number = 0;
    
                /**
                 * FieldDescriptorProto label.
                 * @member {google.protobuf.FieldDescriptorProto.Label} label
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 */
                FieldDescriptorProto.prototype.label = 1;
    
                /**
                 * FieldDescriptorProto type.
                 * @member {google.protobuf.FieldDescriptorProto.Type} type
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 */
                FieldDescriptorProto.prototype.type = 1;
    
                /**
                 * FieldDescriptorProto typeName.
                 * @member {string} typeName
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 */
                FieldDescriptorProto.prototype.typeName = "";
    
                /**
                 * FieldDescriptorProto extendee.
                 * @member {string} extendee
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 */
                FieldDescriptorProto.prototype.extendee = "";
    
                /**
                 * FieldDescriptorProto defaultValue.
                 * @member {string} defaultValue
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 */
                FieldDescriptorProto.prototype.defaultValue = "";
    
                /**
                 * FieldDescriptorProto oneofIndex.
                 * @member {number} oneofIndex
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 */
                FieldDescriptorProto.prototype.oneofIndex = 0;
    
                /**
                 * FieldDescriptorProto jsonName.
                 * @member {string} jsonName
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 */
                FieldDescriptorProto.prototype.jsonName = "";
    
                /**
                 * FieldDescriptorProto options.
                 * @member {google.protobuf.IFieldOptions|null|undefined} options
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 */
                FieldDescriptorProto.prototype.options = null;
    
                /**
                 * FieldDescriptorProto proto3Optional.
                 * @member {boolean} proto3Optional
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 */
                FieldDescriptorProto.prototype.proto3Optional = false;
    
                /**
                 * Creates a new FieldDescriptorProto instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @static
                 * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
                 * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance
                 */
                FieldDescriptorProto.create = function create(properties) {
                    return new FieldDescriptorProto(properties);
                };
    
                /**
                 * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @static
                 * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FieldDescriptorProto.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee"))
                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee);
                    if (message.number != null && Object.hasOwnProperty.call(message, "number"))
                        writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number);
                    if (message.label != null && Object.hasOwnProperty.call(message, "label"))
                        writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label);
                    if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                        writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type);
                    if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName"))
                        writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName);
                    if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue"))
                        writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue);
                    if (message.options != null && Object.hasOwnProperty.call(message, "options"))
                        $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                    if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex"))
                        writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex);
                    if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName"))
                        writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName);
                    if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional"))
                        writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional);
                    return writer;
                };
    
                /**
                 * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @static
                 * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a FieldDescriptorProto message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FieldDescriptorProto.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        case 3: {
                                message.number = reader.int32();
                                break;
                            }
                        case 4: {
                                message.label = reader.int32();
                                break;
                            }
                        case 5: {
                                message.type = reader.int32();
                                break;
                            }
                        case 6: {
                                message.typeName = reader.string();
                                break;
                            }
                        case 2: {
                                message.extendee = reader.string();
                                break;
                            }
                        case 7: {
                                message.defaultValue = reader.string();
                                break;
                            }
                        case 9: {
                                message.oneofIndex = reader.int32();
                                break;
                            }
                        case 10: {
                                message.jsonName = reader.string();
                                break;
                            }
                        case 8: {
                                message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32());
                                break;
                            }
                        case 17: {
                                message.proto3Optional = reader.bool();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a FieldDescriptorProto message.
                 * @function verify
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                FieldDescriptorProto.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    if (message.number != null && message.hasOwnProperty("number"))
                        if (!$util.isInteger(message.number))
                            return "number: integer expected";
                    if (message.label != null && message.hasOwnProperty("label"))
                        switch (message.label) {
                        default:
                            return "label: enum value expected";
                        case 1:
                        case 3:
                        case 2:
                            break;
                        }
                    if (message.type != null && message.hasOwnProperty("type"))
                        switch (message.type) {
                        default:
                            return "type: enum value expected";
                        case 1:
                        case 2:
                        case 3:
                        case 4:
                        case 5:
                        case 6:
                        case 7:
                        case 8:
                        case 9:
                        case 10:
                        case 11:
                        case 12:
                        case 13:
                        case 14:
                        case 15:
                        case 16:
                        case 17:
                        case 18:
                            break;
                        }
                    if (message.typeName != null && message.hasOwnProperty("typeName"))
                        if (!$util.isString(message.typeName))
                            return "typeName: string expected";
                    if (message.extendee != null && message.hasOwnProperty("extendee"))
                        if (!$util.isString(message.extendee))
                            return "extendee: string expected";
                    if (message.defaultValue != null && message.hasOwnProperty("defaultValue"))
                        if (!$util.isString(message.defaultValue))
                            return "defaultValue: string expected";
                    if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex"))
                        if (!$util.isInteger(message.oneofIndex))
                            return "oneofIndex: integer expected";
                    if (message.jsonName != null && message.hasOwnProperty("jsonName"))
                        if (!$util.isString(message.jsonName))
                            return "jsonName: string expected";
                    if (message.options != null && message.hasOwnProperty("options")) {
                        var error = $root.google.protobuf.FieldOptions.verify(message.options);
                        if (error)
                            return "options." + error;
                    }
                    if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional"))
                        if (typeof message.proto3Optional !== "boolean")
                            return "proto3Optional: boolean expected";
                    return null;
                };
    
                /**
                 * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
                 */
                FieldDescriptorProto.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.FieldDescriptorProto)
                        return object;
                    var message = new $root.google.protobuf.FieldDescriptorProto();
                    if (object.name != null)
                        message.name = String(object.name);
                    if (object.number != null)
                        message.number = object.number | 0;
                    switch (object.label) {
                    default:
                        if (typeof object.label === "number") {
                            message.label = object.label;
                            break;
                        }
                        break;
                    case "LABEL_OPTIONAL":
                    case 1:
                        message.label = 1;
                        break;
                    case "LABEL_REPEATED":
                    case 3:
                        message.label = 3;
                        break;
                    case "LABEL_REQUIRED":
                    case 2:
                        message.label = 2;
                        break;
                    }
                    switch (object.type) {
                    default:
                        if (typeof object.type === "number") {
                            message.type = object.type;
                            break;
                        }
                        break;
                    case "TYPE_DOUBLE":
                    case 1:
                        message.type = 1;
                        break;
                    case "TYPE_FLOAT":
                    case 2:
                        message.type = 2;
                        break;
                    case "TYPE_INT64":
                    case 3:
                        message.type = 3;
                        break;
                    case "TYPE_UINT64":
                    case 4:
                        message.type = 4;
                        break;
                    case "TYPE_INT32":
                    case 5:
                        message.type = 5;
                        break;
                    case "TYPE_FIXED64":
                    case 6:
                        message.type = 6;
                        break;
                    case "TYPE_FIXED32":
                    case 7:
                        message.type = 7;
                        break;
                    case "TYPE_BOOL":
                    case 8:
                        message.type = 8;
                        break;
                    case "TYPE_STRING":
                    case 9:
                        message.type = 9;
                        break;
                    case "TYPE_GROUP":
                    case 10:
                        message.type = 10;
                        break;
                    case "TYPE_MESSAGE":
                    case 11:
                        message.type = 11;
                        break;
                    case "TYPE_BYTES":
                    case 12:
                        message.type = 12;
                        break;
                    case "TYPE_UINT32":
                    case 13:
                        message.type = 13;
                        break;
                    case "TYPE_ENUM":
                    case 14:
                        message.type = 14;
                        break;
                    case "TYPE_SFIXED32":
                    case 15:
                        message.type = 15;
                        break;
                    case "TYPE_SFIXED64":
                    case 16:
                        message.type = 16;
                        break;
                    case "TYPE_SINT32":
                    case 17:
                        message.type = 17;
                        break;
                    case "TYPE_SINT64":
                    case 18:
                        message.type = 18;
                        break;
                    }
                    if (object.typeName != null)
                        message.typeName = String(object.typeName);
                    if (object.extendee != null)
                        message.extendee = String(object.extendee);
                    if (object.defaultValue != null)
                        message.defaultValue = String(object.defaultValue);
                    if (object.oneofIndex != null)
                        message.oneofIndex = object.oneofIndex | 0;
                    if (object.jsonName != null)
                        message.jsonName = String(object.jsonName);
                    if (object.options != null) {
                        if (typeof object.options !== "object")
                            throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected");
                        message.options = $root.google.protobuf.FieldOptions.fromObject(object.options);
                    }
                    if (object.proto3Optional != null)
                        message.proto3Optional = Boolean(object.proto3Optional);
                    return message;
                };
    
                /**
                 * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @static
                 * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                FieldDescriptorProto.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.name = "";
                        object.extendee = "";
                        object.number = 0;
                        object.label = options.enums === String ? "LABEL_OPTIONAL" : 1;
                        object.type = options.enums === String ? "TYPE_DOUBLE" : 1;
                        object.typeName = "";
                        object.defaultValue = "";
                        object.options = null;
                        object.oneofIndex = 0;
                        object.jsonName = "";
                        object.proto3Optional = false;
                    }
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    if (message.extendee != null && message.hasOwnProperty("extendee"))
                        object.extendee = message.extendee;
                    if (message.number != null && message.hasOwnProperty("number"))
                        object.number = message.number;
                    if (message.label != null && message.hasOwnProperty("label"))
                        object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label;
                    if (message.type != null && message.hasOwnProperty("type"))
                        object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type;
                    if (message.typeName != null && message.hasOwnProperty("typeName"))
                        object.typeName = message.typeName;
                    if (message.defaultValue != null && message.hasOwnProperty("defaultValue"))
                        object.defaultValue = message.defaultValue;
                    if (message.options != null && message.hasOwnProperty("options"))
                        object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options);
                    if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex"))
                        object.oneofIndex = message.oneofIndex;
                    if (message.jsonName != null && message.hasOwnProperty("jsonName"))
                        object.jsonName = message.jsonName;
                    if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional"))
                        object.proto3Optional = message.proto3Optional;
                    return object;
                };
    
                /**
                 * Converts this FieldDescriptorProto to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                FieldDescriptorProto.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for FieldDescriptorProto
                 * @function getTypeUrl
                 * @memberof google.protobuf.FieldDescriptorProto
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto";
                };
    
                /**
                 * Type enum.
                 * @name google.protobuf.FieldDescriptorProto.Type
                 * @enum {number}
                 * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value
                 * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value
                 * @property {number} TYPE_INT64=3 TYPE_INT64 value
                 * @property {number} TYPE_UINT64=4 TYPE_UINT64 value
                 * @property {number} TYPE_INT32=5 TYPE_INT32 value
                 * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value
                 * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value
                 * @property {number} TYPE_BOOL=8 TYPE_BOOL value
                 * @property {number} TYPE_STRING=9 TYPE_STRING value
                 * @property {number} TYPE_GROUP=10 TYPE_GROUP value
                 * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value
                 * @property {number} TYPE_BYTES=12 TYPE_BYTES value
                 * @property {number} TYPE_UINT32=13 TYPE_UINT32 value
                 * @property {number} TYPE_ENUM=14 TYPE_ENUM value
                 * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value
                 * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value
                 * @property {number} TYPE_SINT32=17 TYPE_SINT32 value
                 * @property {number} TYPE_SINT64=18 TYPE_SINT64 value
                 */
                FieldDescriptorProto.Type = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[1] = "TYPE_DOUBLE"] = 1;
                    values[valuesById[2] = "TYPE_FLOAT"] = 2;
                    values[valuesById[3] = "TYPE_INT64"] = 3;
                    values[valuesById[4] = "TYPE_UINT64"] = 4;
                    values[valuesById[5] = "TYPE_INT32"] = 5;
                    values[valuesById[6] = "TYPE_FIXED64"] = 6;
                    values[valuesById[7] = "TYPE_FIXED32"] = 7;
                    values[valuesById[8] = "TYPE_BOOL"] = 8;
                    values[valuesById[9] = "TYPE_STRING"] = 9;
                    values[valuesById[10] = "TYPE_GROUP"] = 10;
                    values[valuesById[11] = "TYPE_MESSAGE"] = 11;
                    values[valuesById[12] = "TYPE_BYTES"] = 12;
                    values[valuesById[13] = "TYPE_UINT32"] = 13;
                    values[valuesById[14] = "TYPE_ENUM"] = 14;
                    values[valuesById[15] = "TYPE_SFIXED32"] = 15;
                    values[valuesById[16] = "TYPE_SFIXED64"] = 16;
                    values[valuesById[17] = "TYPE_SINT32"] = 17;
                    values[valuesById[18] = "TYPE_SINT64"] = 18;
                    return values;
                })();
    
                /**
                 * Label enum.
                 * @name google.protobuf.FieldDescriptorProto.Label
                 * @enum {number}
                 * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value
                 * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value
                 * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value
                 */
                FieldDescriptorProto.Label = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[1] = "LABEL_OPTIONAL"] = 1;
                    values[valuesById[3] = "LABEL_REPEATED"] = 3;
                    values[valuesById[2] = "LABEL_REQUIRED"] = 2;
                    return values;
                })();
    
                return FieldDescriptorProto;
            })();
    
            protobuf.OneofDescriptorProto = (function() {
    
                /**
                 * Properties of an OneofDescriptorProto.
                 * @memberof google.protobuf
                 * @interface IOneofDescriptorProto
                 * @property {string|null} [name] OneofDescriptorProto name
                 * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options
                 */
    
                /**
                 * Constructs a new OneofDescriptorProto.
                 * @memberof google.protobuf
                 * @classdesc Represents an OneofDescriptorProto.
                 * @implements IOneofDescriptorProto
                 * @constructor
                 * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set
                 */
                function OneofDescriptorProto(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * OneofDescriptorProto name.
                 * @member {string} name
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @instance
                 */
                OneofDescriptorProto.prototype.name = "";
    
                /**
                 * OneofDescriptorProto options.
                 * @member {google.protobuf.IOneofOptions|null|undefined} options
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @instance
                 */
                OneofDescriptorProto.prototype.options = null;
    
                /**
                 * Creates a new OneofDescriptorProto instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @static
                 * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set
                 * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance
                 */
                OneofDescriptorProto.create = function create(properties) {
                    return new OneofDescriptorProto(properties);
                };
    
                /**
                 * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @static
                 * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                OneofDescriptorProto.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    if (message.options != null && Object.hasOwnProperty.call(message, "options"))
                        $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @static
                 * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an OneofDescriptorProto message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                OneofDescriptorProto.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        case 2: {
                                message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an OneofDescriptorProto message.
                 * @function verify
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                OneofDescriptorProto.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    if (message.options != null && message.hasOwnProperty("options")) {
                        var error = $root.google.protobuf.OneofOptions.verify(message.options);
                        if (error)
                            return "options." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
                 */
                OneofDescriptorProto.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.OneofDescriptorProto)
                        return object;
                    var message = new $root.google.protobuf.OneofDescriptorProto();
                    if (object.name != null)
                        message.name = String(object.name);
                    if (object.options != null) {
                        if (typeof object.options !== "object")
                            throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected");
                        message.options = $root.google.protobuf.OneofOptions.fromObject(object.options);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @static
                 * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                OneofDescriptorProto.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.name = "";
                        object.options = null;
                    }
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    if (message.options != null && message.hasOwnProperty("options"))
                        object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options);
                    return object;
                };
    
                /**
                 * Converts this OneofDescriptorProto to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                OneofDescriptorProto.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for OneofDescriptorProto
                 * @function getTypeUrl
                 * @memberof google.protobuf.OneofDescriptorProto
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto";
                };
    
                return OneofDescriptorProto;
            })();
    
            protobuf.EnumDescriptorProto = (function() {
    
                /**
                 * Properties of an EnumDescriptorProto.
                 * @memberof google.protobuf
                 * @interface IEnumDescriptorProto
                 * @property {string|null} [name] EnumDescriptorProto name
                 * @property {Array.<google.protobuf.IEnumValueDescriptorProto>|null} [value] EnumDescriptorProto value
                 * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options
                 * @property {Array.<google.protobuf.EnumDescriptorProto.IEnumReservedRange>|null} [reservedRange] EnumDescriptorProto reservedRange
                 * @property {Array.<string>|null} [reservedName] EnumDescriptorProto reservedName
                 */
    
                /**
                 * Constructs a new EnumDescriptorProto.
                 * @memberof google.protobuf
                 * @classdesc Represents an EnumDescriptorProto.
                 * @implements IEnumDescriptorProto
                 * @constructor
                 * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
                 */
                function EnumDescriptorProto(properties) {
                    this.value = [];
                    this.reservedRange = [];
                    this.reservedName = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * EnumDescriptorProto name.
                 * @member {string} name
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @instance
                 */
                EnumDescriptorProto.prototype.name = "";
    
                /**
                 * EnumDescriptorProto value.
                 * @member {Array.<google.protobuf.IEnumValueDescriptorProto>} value
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @instance
                 */
                EnumDescriptorProto.prototype.value = $util.emptyArray;
    
                /**
                 * EnumDescriptorProto options.
                 * @member {google.protobuf.IEnumOptions|null|undefined} options
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @instance
                 */
                EnumDescriptorProto.prototype.options = null;
    
                /**
                 * EnumDescriptorProto reservedRange.
                 * @member {Array.<google.protobuf.EnumDescriptorProto.IEnumReservedRange>} reservedRange
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @instance
                 */
                EnumDescriptorProto.prototype.reservedRange = $util.emptyArray;
    
                /**
                 * EnumDescriptorProto reservedName.
                 * @member {Array.<string>} reservedName
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @instance
                 */
                EnumDescriptorProto.prototype.reservedName = $util.emptyArray;
    
                /**
                 * Creates a new EnumDescriptorProto instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @static
                 * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
                 * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance
                 */
                EnumDescriptorProto.create = function create(properties) {
                    return new EnumDescriptorProto(properties);
                };
    
                /**
                 * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @static
                 * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                EnumDescriptorProto.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    if (message.value != null && message.value.length)
                        for (var i = 0; i < message.value.length; ++i)
                            $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                    if (message.options != null && Object.hasOwnProperty.call(message, "options"))
                        $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                    if (message.reservedRange != null && message.reservedRange.length)
                        for (var i = 0; i < message.reservedRange.length; ++i)
                            $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                    if (message.reservedName != null && message.reservedName.length)
                        for (var i = 0; i < message.reservedName.length; ++i)
                            writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]);
                    return writer;
                };
    
                /**
                 * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @static
                 * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an EnumDescriptorProto message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                EnumDescriptorProto.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        case 2: {
                                if (!(message.value && message.value.length))
                                    message.value = [];
                                message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        case 3: {
                                message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32());
                                break;
                            }
                        case 4: {
                                if (!(message.reservedRange && message.reservedRange.length))
                                    message.reservedRange = [];
                                message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32()));
                                break;
                            }
                        case 5: {
                                if (!(message.reservedName && message.reservedName.length))
                                    message.reservedName = [];
                                message.reservedName.push(reader.string());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an EnumDescriptorProto message.
                 * @function verify
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                EnumDescriptorProto.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    if (message.value != null && message.hasOwnProperty("value")) {
                        if (!Array.isArray(message.value))
                            return "value: array expected";
                        for (var i = 0; i < message.value.length; ++i) {
                            var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]);
                            if (error)
                                return "value." + error;
                        }
                    }
                    if (message.options != null && message.hasOwnProperty("options")) {
                        var error = $root.google.protobuf.EnumOptions.verify(message.options);
                        if (error)
                            return "options." + error;
                    }
                    if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) {
                        if (!Array.isArray(message.reservedRange))
                            return "reservedRange: array expected";
                        for (var i = 0; i < message.reservedRange.length; ++i) {
                            var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]);
                            if (error)
                                return "reservedRange." + error;
                        }
                    }
                    if (message.reservedName != null && message.hasOwnProperty("reservedName")) {
                        if (!Array.isArray(message.reservedName))
                            return "reservedName: array expected";
                        for (var i = 0; i < message.reservedName.length; ++i)
                            if (!$util.isString(message.reservedName[i]))
                                return "reservedName: string[] expected";
                    }
                    return null;
                };
    
                /**
                 * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
                 */
                EnumDescriptorProto.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.EnumDescriptorProto)
                        return object;
                    var message = new $root.google.protobuf.EnumDescriptorProto();
                    if (object.name != null)
                        message.name = String(object.name);
                    if (object.value) {
                        if (!Array.isArray(object.value))
                            throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected");
                        message.value = [];
                        for (var i = 0; i < object.value.length; ++i) {
                            if (typeof object.value[i] !== "object")
                                throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected");
                            message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]);
                        }
                    }
                    if (object.options != null) {
                        if (typeof object.options !== "object")
                            throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected");
                        message.options = $root.google.protobuf.EnumOptions.fromObject(object.options);
                    }
                    if (object.reservedRange) {
                        if (!Array.isArray(object.reservedRange))
                            throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected");
                        message.reservedRange = [];
                        for (var i = 0; i < object.reservedRange.length; ++i) {
                            if (typeof object.reservedRange[i] !== "object")
                                throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected");
                            message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]);
                        }
                    }
                    if (object.reservedName) {
                        if (!Array.isArray(object.reservedName))
                            throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected");
                        message.reservedName = [];
                        for (var i = 0; i < object.reservedName.length; ++i)
                            message.reservedName[i] = String(object.reservedName[i]);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @static
                 * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                EnumDescriptorProto.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults) {
                        object.value = [];
                        object.reservedRange = [];
                        object.reservedName = [];
                    }
                    if (options.defaults) {
                        object.name = "";
                        object.options = null;
                    }
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    if (message.value && message.value.length) {
                        object.value = [];
                        for (var j = 0; j < message.value.length; ++j)
                            object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options);
                    }
                    if (message.options != null && message.hasOwnProperty("options"))
                        object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options);
                    if (message.reservedRange && message.reservedRange.length) {
                        object.reservedRange = [];
                        for (var j = 0; j < message.reservedRange.length; ++j)
                            object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options);
                    }
                    if (message.reservedName && message.reservedName.length) {
                        object.reservedName = [];
                        for (var j = 0; j < message.reservedName.length; ++j)
                            object.reservedName[j] = message.reservedName[j];
                    }
                    return object;
                };
    
                /**
                 * Converts this EnumDescriptorProto to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                EnumDescriptorProto.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for EnumDescriptorProto
                 * @function getTypeUrl
                 * @memberof google.protobuf.EnumDescriptorProto
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto";
                };
    
                EnumDescriptorProto.EnumReservedRange = (function() {
    
                    /**
                     * Properties of an EnumReservedRange.
                     * @memberof google.protobuf.EnumDescriptorProto
                     * @interface IEnumReservedRange
                     * @property {number|null} [start] EnumReservedRange start
                     * @property {number|null} [end] EnumReservedRange end
                     */
    
                    /**
                     * Constructs a new EnumReservedRange.
                     * @memberof google.protobuf.EnumDescriptorProto
                     * @classdesc Represents an EnumReservedRange.
                     * @implements IEnumReservedRange
                     * @constructor
                     * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set
                     */
                    function EnumReservedRange(properties) {
                        if (properties)
                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                if (properties[keys[i]] != null)
                                    this[keys[i]] = properties[keys[i]];
                    }
    
                    /**
                     * EnumReservedRange start.
                     * @member {number} start
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @instance
                     */
                    EnumReservedRange.prototype.start = 0;
    
                    /**
                     * EnumReservedRange end.
                     * @member {number} end
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @instance
                     */
                    EnumReservedRange.prototype.end = 0;
    
                    /**
                     * Creates a new EnumReservedRange instance using the specified properties.
                     * @function create
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @static
                     * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set
                     * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance
                     */
                    EnumReservedRange.create = function create(properties) {
                        return new EnumReservedRange(properties);
                    };
    
                    /**
                     * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.
                     * @function encode
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @static
                     * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    EnumReservedRange.encode = function encode(message, writer) {
                        if (!writer)
                            writer = $Writer.create();
                        if (message.start != null && Object.hasOwnProperty.call(message, "start"))
                            writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
                        if (message.end != null && Object.hasOwnProperty.call(message, "end"))
                            writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
                        return writer;
                    };
    
                    /**
                     * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.
                     * @function encodeDelimited
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @static
                     * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) {
                        return this.encode(message, writer).ldelim();
                    };
    
                    /**
                     * Decodes an EnumReservedRange message from the specified reader or buffer.
                     * @function decode
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    EnumReservedRange.decode = function decode(reader, length) {
                        if (!(reader instanceof $Reader))
                            reader = $Reader.create(reader);
                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange();
                        while (reader.pos < end) {
                            var tag = reader.uint32();
                            switch (tag >>> 3) {
                            case 1: {
                                    message.start = reader.int32();
                                    break;
                                }
                            case 2: {
                                    message.end = reader.int32();
                                    break;
                                }
                            default:
                                reader.skipType(tag & 7);
                                break;
                            }
                        }
                        return message;
                    };
    
                    /**
                     * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited.
                     * @function decodeDelimited
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    EnumReservedRange.decodeDelimited = function decodeDelimited(reader) {
                        if (!(reader instanceof $Reader))
                            reader = new $Reader(reader);
                        return this.decode(reader, reader.uint32());
                    };
    
                    /**
                     * Verifies an EnumReservedRange message.
                     * @function verify
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @static
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {string|null} `null` if valid, otherwise the reason why it is not
                     */
                    EnumReservedRange.verify = function verify(message) {
                        if (typeof message !== "object" || message === null)
                            return "object expected";
                        if (message.start != null && message.hasOwnProperty("start"))
                            if (!$util.isInteger(message.start))
                                return "start: integer expected";
                        if (message.end != null && message.hasOwnProperty("end"))
                            if (!$util.isInteger(message.end))
                                return "end: integer expected";
                        return null;
                    };
    
                    /**
                     * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types.
                     * @function fromObject
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @static
                     * @param {Object.<string,*>} object Plain object
                     * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
                     */
                    EnumReservedRange.fromObject = function fromObject(object) {
                        if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange)
                            return object;
                        var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange();
                        if (object.start != null)
                            message.start = object.start | 0;
                        if (object.end != null)
                            message.end = object.end | 0;
                        return message;
                    };
    
                    /**
                     * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified.
                     * @function toObject
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @static
                     * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange
                     * @param {$protobuf.IConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    EnumReservedRange.toObject = function toObject(message, options) {
                        if (!options)
                            options = {};
                        var object = {};
                        if (options.defaults) {
                            object.start = 0;
                            object.end = 0;
                        }
                        if (message.start != null && message.hasOwnProperty("start"))
                            object.start = message.start;
                        if (message.end != null && message.hasOwnProperty("end"))
                            object.end = message.end;
                        return object;
                    };
    
                    /**
                     * Converts this EnumReservedRange to JSON.
                     * @function toJSON
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @instance
                     * @returns {Object.<string,*>} JSON object
                     */
                    EnumReservedRange.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };
    
                    /**
                     * Gets the default type url for EnumReservedRange
                     * @function getTypeUrl
                     * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
                     * @static
                     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                     * @returns {string} The default type url
                     */
                    EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange";
                    };
    
                    return EnumReservedRange;
                })();
    
                return EnumDescriptorProto;
            })();
    
            protobuf.EnumValueDescriptorProto = (function() {
    
                /**
                 * Properties of an EnumValueDescriptorProto.
                 * @memberof google.protobuf
                 * @interface IEnumValueDescriptorProto
                 * @property {string|null} [name] EnumValueDescriptorProto name
                 * @property {number|null} [number] EnumValueDescriptorProto number
                 * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options
                 */
    
                /**
                 * Constructs a new EnumValueDescriptorProto.
                 * @memberof google.protobuf
                 * @classdesc Represents an EnumValueDescriptorProto.
                 * @implements IEnumValueDescriptorProto
                 * @constructor
                 * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
                 */
                function EnumValueDescriptorProto(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * EnumValueDescriptorProto name.
                 * @member {string} name
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @instance
                 */
                EnumValueDescriptorProto.prototype.name = "";
    
                /**
                 * EnumValueDescriptorProto number.
                 * @member {number} number
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @instance
                 */
                EnumValueDescriptorProto.prototype.number = 0;
    
                /**
                 * EnumValueDescriptorProto options.
                 * @member {google.protobuf.IEnumValueOptions|null|undefined} options
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @instance
                 */
                EnumValueDescriptorProto.prototype.options = null;
    
                /**
                 * Creates a new EnumValueDescriptorProto instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @static
                 * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
                 * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance
                 */
                EnumValueDescriptorProto.create = function create(properties) {
                    return new EnumValueDescriptorProto(properties);
                };
    
                /**
                 * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @static
                 * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                EnumValueDescriptorProto.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    if (message.number != null && Object.hasOwnProperty.call(message, "number"))
                        writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number);
                    if (message.options != null && Object.hasOwnProperty.call(message, "options"))
                        $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @static
                 * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an EnumValueDescriptorProto message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                EnumValueDescriptorProto.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        case 2: {
                                message.number = reader.int32();
                                break;
                            }
                        case 3: {
                                message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an EnumValueDescriptorProto message.
                 * @function verify
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                EnumValueDescriptorProto.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    if (message.number != null && message.hasOwnProperty("number"))
                        if (!$util.isInteger(message.number))
                            return "number: integer expected";
                    if (message.options != null && message.hasOwnProperty("options")) {
                        var error = $root.google.protobuf.EnumValueOptions.verify(message.options);
                        if (error)
                            return "options." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
                 */
                EnumValueDescriptorProto.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.EnumValueDescriptorProto)
                        return object;
                    var message = new $root.google.protobuf.EnumValueDescriptorProto();
                    if (object.name != null)
                        message.name = String(object.name);
                    if (object.number != null)
                        message.number = object.number | 0;
                    if (object.options != null) {
                        if (typeof object.options !== "object")
                            throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected");
                        message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @static
                 * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                EnumValueDescriptorProto.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.name = "";
                        object.number = 0;
                        object.options = null;
                    }
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    if (message.number != null && message.hasOwnProperty("number"))
                        object.number = message.number;
                    if (message.options != null && message.hasOwnProperty("options"))
                        object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options);
                    return object;
                };
    
                /**
                 * Converts this EnumValueDescriptorProto to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                EnumValueDescriptorProto.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for EnumValueDescriptorProto
                 * @function getTypeUrl
                 * @memberof google.protobuf.EnumValueDescriptorProto
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto";
                };
    
                return EnumValueDescriptorProto;
            })();
    
            protobuf.ServiceDescriptorProto = (function() {
    
                /**
                 * Properties of a ServiceDescriptorProto.
                 * @memberof google.protobuf
                 * @interface IServiceDescriptorProto
                 * @property {string|null} [name] ServiceDescriptorProto name
                 * @property {Array.<google.protobuf.IMethodDescriptorProto>|null} [method] ServiceDescriptorProto method
                 * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options
                 */
    
                /**
                 * Constructs a new ServiceDescriptorProto.
                 * @memberof google.protobuf
                 * @classdesc Represents a ServiceDescriptorProto.
                 * @implements IServiceDescriptorProto
                 * @constructor
                 * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
                 */
                function ServiceDescriptorProto(properties) {
                    this.method = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * ServiceDescriptorProto name.
                 * @member {string} name
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @instance
                 */
                ServiceDescriptorProto.prototype.name = "";
    
                /**
                 * ServiceDescriptorProto method.
                 * @member {Array.<google.protobuf.IMethodDescriptorProto>} method
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @instance
                 */
                ServiceDescriptorProto.prototype.method = $util.emptyArray;
    
                /**
                 * ServiceDescriptorProto options.
                 * @member {google.protobuf.IServiceOptions|null|undefined} options
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @instance
                 */
                ServiceDescriptorProto.prototype.options = null;
    
                /**
                 * Creates a new ServiceDescriptorProto instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @static
                 * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
                 * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance
                 */
                ServiceDescriptorProto.create = function create(properties) {
                    return new ServiceDescriptorProto(properties);
                };
    
                /**
                 * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @static
                 * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ServiceDescriptorProto.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    if (message.method != null && message.method.length)
                        for (var i = 0; i < message.method.length; ++i)
                            $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                    if (message.options != null && Object.hasOwnProperty.call(message, "options"))
                        $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @static
                 * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a ServiceDescriptorProto message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ServiceDescriptorProto.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        case 2: {
                                if (!(message.method && message.method.length))
                                    message.method = [];
                                message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32()));
                                break;
                            }
                        case 3: {
                                message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a ServiceDescriptorProto message.
                 * @function verify
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                ServiceDescriptorProto.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    if (message.method != null && message.hasOwnProperty("method")) {
                        if (!Array.isArray(message.method))
                            return "method: array expected";
                        for (var i = 0; i < message.method.length; ++i) {
                            var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]);
                            if (error)
                                return "method." + error;
                        }
                    }
                    if (message.options != null && message.hasOwnProperty("options")) {
                        var error = $root.google.protobuf.ServiceOptions.verify(message.options);
                        if (error)
                            return "options." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
                 */
                ServiceDescriptorProto.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.ServiceDescriptorProto)
                        return object;
                    var message = new $root.google.protobuf.ServiceDescriptorProto();
                    if (object.name != null)
                        message.name = String(object.name);
                    if (object.method) {
                        if (!Array.isArray(object.method))
                            throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected");
                        message.method = [];
                        for (var i = 0; i < object.method.length; ++i) {
                            if (typeof object.method[i] !== "object")
                                throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected");
                            message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]);
                        }
                    }
                    if (object.options != null) {
                        if (typeof object.options !== "object")
                            throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected");
                        message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @static
                 * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                ServiceDescriptorProto.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.method = [];
                    if (options.defaults) {
                        object.name = "";
                        object.options = null;
                    }
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    if (message.method && message.method.length) {
                        object.method = [];
                        for (var j = 0; j < message.method.length; ++j)
                            object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options);
                    }
                    if (message.options != null && message.hasOwnProperty("options"))
                        object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options);
                    return object;
                };
    
                /**
                 * Converts this ServiceDescriptorProto to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                ServiceDescriptorProto.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for ServiceDescriptorProto
                 * @function getTypeUrl
                 * @memberof google.protobuf.ServiceDescriptorProto
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto";
                };
    
                return ServiceDescriptorProto;
            })();
    
            protobuf.MethodDescriptorProto = (function() {
    
                /**
                 * Properties of a MethodDescriptorProto.
                 * @memberof google.protobuf
                 * @interface IMethodDescriptorProto
                 * @property {string|null} [name] MethodDescriptorProto name
                 * @property {string|null} [inputType] MethodDescriptorProto inputType
                 * @property {string|null} [outputType] MethodDescriptorProto outputType
                 * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options
                 * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming
                 * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming
                 */
    
                /**
                 * Constructs a new MethodDescriptorProto.
                 * @memberof google.protobuf
                 * @classdesc Represents a MethodDescriptorProto.
                 * @implements IMethodDescriptorProto
                 * @constructor
                 * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
                 */
                function MethodDescriptorProto(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * MethodDescriptorProto name.
                 * @member {string} name
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @instance
                 */
                MethodDescriptorProto.prototype.name = "";
    
                /**
                 * MethodDescriptorProto inputType.
                 * @member {string} inputType
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @instance
                 */
                MethodDescriptorProto.prototype.inputType = "";
    
                /**
                 * MethodDescriptorProto outputType.
                 * @member {string} outputType
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @instance
                 */
                MethodDescriptorProto.prototype.outputType = "";
    
                /**
                 * MethodDescriptorProto options.
                 * @member {google.protobuf.IMethodOptions|null|undefined} options
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @instance
                 */
                MethodDescriptorProto.prototype.options = null;
    
                /**
                 * MethodDescriptorProto clientStreaming.
                 * @member {boolean} clientStreaming
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @instance
                 */
                MethodDescriptorProto.prototype.clientStreaming = false;
    
                /**
                 * MethodDescriptorProto serverStreaming.
                 * @member {boolean} serverStreaming
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @instance
                 */
                MethodDescriptorProto.prototype.serverStreaming = false;
    
                /**
                 * Creates a new MethodDescriptorProto instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @static
                 * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
                 * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance
                 */
                MethodDescriptorProto.create = function create(properties) {
                    return new MethodDescriptorProto(properties);
                };
    
                /**
                 * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @static
                 * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                MethodDescriptorProto.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType"))
                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType);
                    if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType"))
                        writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType);
                    if (message.options != null && Object.hasOwnProperty.call(message, "options"))
                        $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                    if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming"))
                        writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming);
                    if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming"))
                        writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming);
                    return writer;
                };
    
                /**
                 * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @static
                 * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a MethodDescriptorProto message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                MethodDescriptorProto.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        case 2: {
                                message.inputType = reader.string();
                                break;
                            }
                        case 3: {
                                message.outputType = reader.string();
                                break;
                            }
                        case 4: {
                                message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32());
                                break;
                            }
                        case 5: {
                                message.clientStreaming = reader.bool();
                                break;
                            }
                        case 6: {
                                message.serverStreaming = reader.bool();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a MethodDescriptorProto message.
                 * @function verify
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                MethodDescriptorProto.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    if (message.inputType != null && message.hasOwnProperty("inputType"))
                        if (!$util.isString(message.inputType))
                            return "inputType: string expected";
                    if (message.outputType != null && message.hasOwnProperty("outputType"))
                        if (!$util.isString(message.outputType))
                            return "outputType: string expected";
                    if (message.options != null && message.hasOwnProperty("options")) {
                        var error = $root.google.protobuf.MethodOptions.verify(message.options);
                        if (error)
                            return "options." + error;
                    }
                    if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming"))
                        if (typeof message.clientStreaming !== "boolean")
                            return "clientStreaming: boolean expected";
                    if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming"))
                        if (typeof message.serverStreaming !== "boolean")
                            return "serverStreaming: boolean expected";
                    return null;
                };
    
                /**
                 * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
                 */
                MethodDescriptorProto.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.MethodDescriptorProto)
                        return object;
                    var message = new $root.google.protobuf.MethodDescriptorProto();
                    if (object.name != null)
                        message.name = String(object.name);
                    if (object.inputType != null)
                        message.inputType = String(object.inputType);
                    if (object.outputType != null)
                        message.outputType = String(object.outputType);
                    if (object.options != null) {
                        if (typeof object.options !== "object")
                            throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected");
                        message.options = $root.google.protobuf.MethodOptions.fromObject(object.options);
                    }
                    if (object.clientStreaming != null)
                        message.clientStreaming = Boolean(object.clientStreaming);
                    if (object.serverStreaming != null)
                        message.serverStreaming = Boolean(object.serverStreaming);
                    return message;
                };
    
                /**
                 * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @static
                 * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                MethodDescriptorProto.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.name = "";
                        object.inputType = "";
                        object.outputType = "";
                        object.options = null;
                        object.clientStreaming = false;
                        object.serverStreaming = false;
                    }
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    if (message.inputType != null && message.hasOwnProperty("inputType"))
                        object.inputType = message.inputType;
                    if (message.outputType != null && message.hasOwnProperty("outputType"))
                        object.outputType = message.outputType;
                    if (message.options != null && message.hasOwnProperty("options"))
                        object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options);
                    if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming"))
                        object.clientStreaming = message.clientStreaming;
                    if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming"))
                        object.serverStreaming = message.serverStreaming;
                    return object;
                };
    
                /**
                 * Converts this MethodDescriptorProto to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                MethodDescriptorProto.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for MethodDescriptorProto
                 * @function getTypeUrl
                 * @memberof google.protobuf.MethodDescriptorProto
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto";
                };
    
                return MethodDescriptorProto;
            })();
    
            protobuf.FileOptions = (function() {
    
                /**
                 * Properties of a FileOptions.
                 * @memberof google.protobuf
                 * @interface IFileOptions
                 * @property {string|null} [javaPackage] FileOptions javaPackage
                 * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname
                 * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles
                 * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash
                 * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8
                 * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor
                 * @property {string|null} [goPackage] FileOptions goPackage
                 * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices
                 * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices
                 * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices
                 * @property {boolean|null} [deprecated] FileOptions deprecated
                 * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas
                 * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix
                 * @property {string|null} [csharpNamespace] FileOptions csharpNamespace
                 * @property {string|null} [swiftPrefix] FileOptions swiftPrefix
                 * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix
                 * @property {string|null} [phpNamespace] FileOptions phpNamespace
                 * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace
                 * @property {string|null} [rubyPackage] FileOptions rubyPackage
                 * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features
                 * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FileOptions uninterpretedOption
                 * @property {Array.<google.api.IResourceDescriptor>|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition
                 */
    
                /**
                 * Constructs a new FileOptions.
                 * @memberof google.protobuf
                 * @classdesc Represents a FileOptions.
                 * @implements IFileOptions
                 * @constructor
                 * @param {google.protobuf.IFileOptions=} [properties] Properties to set
                 */
                function FileOptions(properties) {
                    this.uninterpretedOption = [];
                    this[".google.api.resourceDefinition"] = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * FileOptions javaPackage.
                 * @member {string} javaPackage
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.javaPackage = "";
    
                /**
                 * FileOptions javaOuterClassname.
                 * @member {string} javaOuterClassname
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.javaOuterClassname = "";
    
                /**
                 * FileOptions javaMultipleFiles.
                 * @member {boolean} javaMultipleFiles
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.javaMultipleFiles = false;
    
                /**
                 * FileOptions javaGenerateEqualsAndHash.
                 * @member {boolean} javaGenerateEqualsAndHash
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.javaGenerateEqualsAndHash = false;
    
                /**
                 * FileOptions javaStringCheckUtf8.
                 * @member {boolean} javaStringCheckUtf8
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.javaStringCheckUtf8 = false;
    
                /**
                 * FileOptions optimizeFor.
                 * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.optimizeFor = 1;
    
                /**
                 * FileOptions goPackage.
                 * @member {string} goPackage
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.goPackage = "";
    
                /**
                 * FileOptions ccGenericServices.
                 * @member {boolean} ccGenericServices
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.ccGenericServices = false;
    
                /**
                 * FileOptions javaGenericServices.
                 * @member {boolean} javaGenericServices
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.javaGenericServices = false;
    
                /**
                 * FileOptions pyGenericServices.
                 * @member {boolean} pyGenericServices
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.pyGenericServices = false;
    
                /**
                 * FileOptions deprecated.
                 * @member {boolean} deprecated
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.deprecated = false;
    
                /**
                 * FileOptions ccEnableArenas.
                 * @member {boolean} ccEnableArenas
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.ccEnableArenas = true;
    
                /**
                 * FileOptions objcClassPrefix.
                 * @member {string} objcClassPrefix
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.objcClassPrefix = "";
    
                /**
                 * FileOptions csharpNamespace.
                 * @member {string} csharpNamespace
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.csharpNamespace = "";
    
                /**
                 * FileOptions swiftPrefix.
                 * @member {string} swiftPrefix
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.swiftPrefix = "";
    
                /**
                 * FileOptions phpClassPrefix.
                 * @member {string} phpClassPrefix
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.phpClassPrefix = "";
    
                /**
                 * FileOptions phpNamespace.
                 * @member {string} phpNamespace
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.phpNamespace = "";
    
                /**
                 * FileOptions phpMetadataNamespace.
                 * @member {string} phpMetadataNamespace
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.phpMetadataNamespace = "";
    
                /**
                 * FileOptions rubyPackage.
                 * @member {string} rubyPackage
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.rubyPackage = "";
    
                /**
                 * FileOptions features.
                 * @member {google.protobuf.IFeatureSet|null|undefined} features
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.features = null;
    
                /**
                 * FileOptions uninterpretedOption.
                 * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype.uninterpretedOption = $util.emptyArray;
    
                /**
                 * FileOptions .google.api.resourceDefinition.
                 * @member {Array.<google.api.IResourceDescriptor>} .google.api.resourceDefinition
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 */
                FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray;
    
                /**
                 * Creates a new FileOptions instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.FileOptions
                 * @static
                 * @param {google.protobuf.IFileOptions=} [properties] Properties to set
                 * @returns {google.protobuf.FileOptions} FileOptions instance
                 */
                FileOptions.create = function create(properties) {
                    return new FileOptions(properties);
                };
    
                /**
                 * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.FileOptions
                 * @static
                 * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FileOptions.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage);
                    if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname"))
                        writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname);
                    if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor"))
                        writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor);
                    if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles"))
                        writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles);
                    if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage"))
                        writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage);
                    if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices"))
                        writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices);
                    if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices"))
                        writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices);
                    if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices"))
                        writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices);
                    if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash"))
                        writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash);
                    if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
                        writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated);
                    if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8"))
                        writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8);
                    if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas"))
                        writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas);
                    if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix"))
                        writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix);
                    if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace"))
                        writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace);
                    if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix"))
                        writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix);
                    if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix"))
                        writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix);
                    if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace"))
                        writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace);
                    if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace"))
                        writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace);
                    if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage"))
                        writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage);
                    if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                        $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim();
                    if (message.uninterpretedOption != null && message.uninterpretedOption.length)
                        for (var i = 0; i < message.uninterpretedOption.length; ++i)
                            $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
                    if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length)
                        for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i)
                            $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.FileOptions
                 * @static
                 * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FileOptions.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a FileOptions message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.FileOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.FileOptions} FileOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FileOptions.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.javaPackage = reader.string();
                                break;
                            }
                        case 8: {
                                message.javaOuterClassname = reader.string();
                                break;
                            }
                        case 10: {
                                message.javaMultipleFiles = reader.bool();
                                break;
                            }
                        case 20: {
                                message.javaGenerateEqualsAndHash = reader.bool();
                                break;
                            }
                        case 27: {
                                message.javaStringCheckUtf8 = reader.bool();
                                break;
                            }
                        case 9: {
                                message.optimizeFor = reader.int32();
                                break;
                            }
                        case 11: {
                                message.goPackage = reader.string();
                                break;
                            }
                        case 16: {
                                message.ccGenericServices = reader.bool();
                                break;
                            }
                        case 17: {
                                message.javaGenericServices = reader.bool();
                                break;
                            }
                        case 18: {
                                message.pyGenericServices = reader.bool();
                                break;
                            }
                        case 23: {
                                message.deprecated = reader.bool();
                                break;
                            }
                        case 31: {
                                message.ccEnableArenas = reader.bool();
                                break;
                            }
                        case 36: {
                                message.objcClassPrefix = reader.string();
                                break;
                            }
                        case 37: {
                                message.csharpNamespace = reader.string();
                                break;
                            }
                        case 39: {
                                message.swiftPrefix = reader.string();
                                break;
                            }
                        case 40: {
                                message.phpClassPrefix = reader.string();
                                break;
                            }
                        case 41: {
                                message.phpNamespace = reader.string();
                                break;
                            }
                        case 44: {
                                message.phpMetadataNamespace = reader.string();
                                break;
                            }
                        case 45: {
                                message.rubyPackage = reader.string();
                                break;
                            }
                        case 50: {
                                message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());
                                break;
                            }
                        case 999: {
                                if (!(message.uninterpretedOption && message.uninterpretedOption.length))
                                    message.uninterpretedOption = [];
                                message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
                                break;
                            }
                        case 1053: {
                                if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length))
                                    message[".google.api.resourceDefinition"] = [];
                                message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32()));
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a FileOptions message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.FileOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.FileOptions} FileOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FileOptions.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a FileOptions message.
                 * @function verify
                 * @memberof google.protobuf.FileOptions
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                FileOptions.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.javaPackage != null && message.hasOwnProperty("javaPackage"))
                        if (!$util.isString(message.javaPackage))
                            return "javaPackage: string expected";
                    if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname"))
                        if (!$util.isString(message.javaOuterClassname))
                            return "javaOuterClassname: string expected";
                    if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles"))
                        if (typeof message.javaMultipleFiles !== "boolean")
                            return "javaMultipleFiles: boolean expected";
                    if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash"))
                        if (typeof message.javaGenerateEqualsAndHash !== "boolean")
                            return "javaGenerateEqualsAndHash: boolean expected";
                    if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8"))
                        if (typeof message.javaStringCheckUtf8 !== "boolean")
                            return "javaStringCheckUtf8: boolean expected";
                    if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor"))
                        switch (message.optimizeFor) {
                        default:
                            return "optimizeFor: enum value expected";
                        case 1:
                        case 2:
                        case 3:
                            break;
                        }
                    if (message.goPackage != null && message.hasOwnProperty("goPackage"))
                        if (!$util.isString(message.goPackage))
                            return "goPackage: string expected";
                    if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices"))
                        if (typeof message.ccGenericServices !== "boolean")
                            return "ccGenericServices: boolean expected";
                    if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices"))
                        if (typeof message.javaGenericServices !== "boolean")
                            return "javaGenericServices: boolean expected";
                    if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices"))
                        if (typeof message.pyGenericServices !== "boolean")
                            return "pyGenericServices: boolean expected";
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        if (typeof message.deprecated !== "boolean")
                            return "deprecated: boolean expected";
                    if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas"))
                        if (typeof message.ccEnableArenas !== "boolean")
                            return "ccEnableArenas: boolean expected";
                    if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix"))
                        if (!$util.isString(message.objcClassPrefix))
                            return "objcClassPrefix: string expected";
                    if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace"))
                        if (!$util.isString(message.csharpNamespace))
                            return "csharpNamespace: string expected";
                    if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix"))
                        if (!$util.isString(message.swiftPrefix))
                            return "swiftPrefix: string expected";
                    if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix"))
                        if (!$util.isString(message.phpClassPrefix))
                            return "phpClassPrefix: string expected";
                    if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace"))
                        if (!$util.isString(message.phpNamespace))
                            return "phpNamespace: string expected";
                    if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace"))
                        if (!$util.isString(message.phpMetadataNamespace))
                            return "phpMetadataNamespace: string expected";
                    if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage"))
                        if (!$util.isString(message.rubyPackage))
                            return "rubyPackage: string expected";
                    if (message.features != null && message.hasOwnProperty("features")) {
                        var error = $root.google.protobuf.FeatureSet.verify(message.features);
                        if (error)
                            return "features." + error;
                    }
                    if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
                        if (!Array.isArray(message.uninterpretedOption))
                            return "uninterpretedOption: array expected";
                        for (var i = 0; i < message.uninterpretedOption.length; ++i) {
                            var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
                            if (error)
                                return "uninterpretedOption." + error;
                        }
                    }
                    if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) {
                        if (!Array.isArray(message[".google.api.resourceDefinition"]))
                            return ".google.api.resourceDefinition: array expected";
                        for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) {
                            var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]);
                            if (error)
                                return ".google.api.resourceDefinition." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates a FileOptions message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.FileOptions
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.FileOptions} FileOptions
                 */
                FileOptions.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.FileOptions)
                        return object;
                    var message = new $root.google.protobuf.FileOptions();
                    if (object.javaPackage != null)
                        message.javaPackage = String(object.javaPackage);
                    if (object.javaOuterClassname != null)
                        message.javaOuterClassname = String(object.javaOuterClassname);
                    if (object.javaMultipleFiles != null)
                        message.javaMultipleFiles = Boolean(object.javaMultipleFiles);
                    if (object.javaGenerateEqualsAndHash != null)
                        message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash);
                    if (object.javaStringCheckUtf8 != null)
                        message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8);
                    switch (object.optimizeFor) {
                    default:
                        if (typeof object.optimizeFor === "number") {
                            message.optimizeFor = object.optimizeFor;
                            break;
                        }
                        break;
                    case "SPEED":
                    case 1:
                        message.optimizeFor = 1;
                        break;
                    case "CODE_SIZE":
                    case 2:
                        message.optimizeFor = 2;
                        break;
                    case "LITE_RUNTIME":
                    case 3:
                        message.optimizeFor = 3;
                        break;
                    }
                    if (object.goPackage != null)
                        message.goPackage = String(object.goPackage);
                    if (object.ccGenericServices != null)
                        message.ccGenericServices = Boolean(object.ccGenericServices);
                    if (object.javaGenericServices != null)
                        message.javaGenericServices = Boolean(object.javaGenericServices);
                    if (object.pyGenericServices != null)
                        message.pyGenericServices = Boolean(object.pyGenericServices);
                    if (object.deprecated != null)
                        message.deprecated = Boolean(object.deprecated);
                    if (object.ccEnableArenas != null)
                        message.ccEnableArenas = Boolean(object.ccEnableArenas);
                    if (object.objcClassPrefix != null)
                        message.objcClassPrefix = String(object.objcClassPrefix);
                    if (object.csharpNamespace != null)
                        message.csharpNamespace = String(object.csharpNamespace);
                    if (object.swiftPrefix != null)
                        message.swiftPrefix = String(object.swiftPrefix);
                    if (object.phpClassPrefix != null)
                        message.phpClassPrefix = String(object.phpClassPrefix);
                    if (object.phpNamespace != null)
                        message.phpNamespace = String(object.phpNamespace);
                    if (object.phpMetadataNamespace != null)
                        message.phpMetadataNamespace = String(object.phpMetadataNamespace);
                    if (object.rubyPackage != null)
                        message.rubyPackage = String(object.rubyPackage);
                    if (object.features != null) {
                        if (typeof object.features !== "object")
                            throw TypeError(".google.protobuf.FileOptions.features: object expected");
                        message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);
                    }
                    if (object.uninterpretedOption) {
                        if (!Array.isArray(object.uninterpretedOption))
                            throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected");
                        message.uninterpretedOption = [];
                        for (var i = 0; i < object.uninterpretedOption.length; ++i) {
                            if (typeof object.uninterpretedOption[i] !== "object")
                                throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected");
                            message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
                        }
                    }
                    if (object[".google.api.resourceDefinition"]) {
                        if (!Array.isArray(object[".google.api.resourceDefinition"]))
                            throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected");
                        message[".google.api.resourceDefinition"] = [];
                        for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) {
                            if (typeof object[".google.api.resourceDefinition"][i] !== "object")
                                throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected");
                            message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]);
                        }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a FileOptions message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.FileOptions
                 * @static
                 * @param {google.protobuf.FileOptions} message FileOptions
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                FileOptions.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults) {
                        object.uninterpretedOption = [];
                        object[".google.api.resourceDefinition"] = [];
                    }
                    if (options.defaults) {
                        object.javaPackage = "";
                        object.javaOuterClassname = "";
                        object.optimizeFor = options.enums === String ? "SPEED" : 1;
                        object.javaMultipleFiles = false;
                        object.goPackage = "";
                        object.ccGenericServices = false;
                        object.javaGenericServices = false;
                        object.pyGenericServices = false;
                        object.javaGenerateEqualsAndHash = false;
                        object.deprecated = false;
                        object.javaStringCheckUtf8 = false;
                        object.ccEnableArenas = true;
                        object.objcClassPrefix = "";
                        object.csharpNamespace = "";
                        object.swiftPrefix = "";
                        object.phpClassPrefix = "";
                        object.phpNamespace = "";
                        object.phpMetadataNamespace = "";
                        object.rubyPackage = "";
                        object.features = null;
                    }
                    if (message.javaPackage != null && message.hasOwnProperty("javaPackage"))
                        object.javaPackage = message.javaPackage;
                    if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname"))
                        object.javaOuterClassname = message.javaOuterClassname;
                    if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor"))
                        object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor;
                    if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles"))
                        object.javaMultipleFiles = message.javaMultipleFiles;
                    if (message.goPackage != null && message.hasOwnProperty("goPackage"))
                        object.goPackage = message.goPackage;
                    if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices"))
                        object.ccGenericServices = message.ccGenericServices;
                    if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices"))
                        object.javaGenericServices = message.javaGenericServices;
                    if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices"))
                        object.pyGenericServices = message.pyGenericServices;
                    if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash"))
                        object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash;
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        object.deprecated = message.deprecated;
                    if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8"))
                        object.javaStringCheckUtf8 = message.javaStringCheckUtf8;
                    if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas"))
                        object.ccEnableArenas = message.ccEnableArenas;
                    if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix"))
                        object.objcClassPrefix = message.objcClassPrefix;
                    if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace"))
                        object.csharpNamespace = message.csharpNamespace;
                    if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix"))
                        object.swiftPrefix = message.swiftPrefix;
                    if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix"))
                        object.phpClassPrefix = message.phpClassPrefix;
                    if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace"))
                        object.phpNamespace = message.phpNamespace;
                    if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace"))
                        object.phpMetadataNamespace = message.phpMetadataNamespace;
                    if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage"))
                        object.rubyPackage = message.rubyPackage;
                    if (message.features != null && message.hasOwnProperty("features"))
                        object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);
                    if (message.uninterpretedOption && message.uninterpretedOption.length) {
                        object.uninterpretedOption = [];
                        for (var j = 0; j < message.uninterpretedOption.length; ++j)
                            object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
                    }
                    if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) {
                        object[".google.api.resourceDefinition"] = [];
                        for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j)
                            object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options);
                    }
                    return object;
                };
    
                /**
                 * Converts this FileOptions to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.FileOptions
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                FileOptions.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for FileOptions
                 * @function getTypeUrl
                 * @memberof google.protobuf.FileOptions
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.FileOptions";
                };
    
                /**
                 * OptimizeMode enum.
                 * @name google.protobuf.FileOptions.OptimizeMode
                 * @enum {number}
                 * @property {number} SPEED=1 SPEED value
                 * @property {number} CODE_SIZE=2 CODE_SIZE value
                 * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value
                 */
                FileOptions.OptimizeMode = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[1] = "SPEED"] = 1;
                    values[valuesById[2] = "CODE_SIZE"] = 2;
                    values[valuesById[3] = "LITE_RUNTIME"] = 3;
                    return values;
                })();
    
                return FileOptions;
            })();
    
            protobuf.MessageOptions = (function() {
    
                /**
                 * Properties of a MessageOptions.
                 * @memberof google.protobuf
                 * @interface IMessageOptions
                 * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat
                 * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor
                 * @property {boolean|null} [deprecated] MessageOptions deprecated
                 * @property {boolean|null} [mapEntry] MessageOptions mapEntry
                 * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts
                 * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features
                 * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MessageOptions uninterpretedOption
                 * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource
                 */
    
                /**
                 * Constructs a new MessageOptions.
                 * @memberof google.protobuf
                 * @classdesc Represents a MessageOptions.
                 * @implements IMessageOptions
                 * @constructor
                 * @param {google.protobuf.IMessageOptions=} [properties] Properties to set
                 */
                function MessageOptions(properties) {
                    this.uninterpretedOption = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * MessageOptions messageSetWireFormat.
                 * @member {boolean} messageSetWireFormat
                 * @memberof google.protobuf.MessageOptions
                 * @instance
                 */
                MessageOptions.prototype.messageSetWireFormat = false;
    
                /**
                 * MessageOptions noStandardDescriptorAccessor.
                 * @member {boolean} noStandardDescriptorAccessor
                 * @memberof google.protobuf.MessageOptions
                 * @instance
                 */
                MessageOptions.prototype.noStandardDescriptorAccessor = false;
    
                /**
                 * MessageOptions deprecated.
                 * @member {boolean} deprecated
                 * @memberof google.protobuf.MessageOptions
                 * @instance
                 */
                MessageOptions.prototype.deprecated = false;
    
                /**
                 * MessageOptions mapEntry.
                 * @member {boolean} mapEntry
                 * @memberof google.protobuf.MessageOptions
                 * @instance
                 */
                MessageOptions.prototype.mapEntry = false;
    
                /**
                 * MessageOptions deprecatedLegacyJsonFieldConflicts.
                 * @member {boolean} deprecatedLegacyJsonFieldConflicts
                 * @memberof google.protobuf.MessageOptions
                 * @instance
                 */
                MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false;
    
                /**
                 * MessageOptions features.
                 * @member {google.protobuf.IFeatureSet|null|undefined} features
                 * @memberof google.protobuf.MessageOptions
                 * @instance
                 */
                MessageOptions.prototype.features = null;
    
                /**
                 * MessageOptions uninterpretedOption.
                 * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
                 * @memberof google.protobuf.MessageOptions
                 * @instance
                 */
                MessageOptions.prototype.uninterpretedOption = $util.emptyArray;
    
                /**
                 * MessageOptions .google.api.resource.
                 * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource
                 * @memberof google.protobuf.MessageOptions
                 * @instance
                 */
                MessageOptions.prototype[".google.api.resource"] = null;
    
                /**
                 * Creates a new MessageOptions instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.MessageOptions
                 * @static
                 * @param {google.protobuf.IMessageOptions=} [properties] Properties to set
                 * @returns {google.protobuf.MessageOptions} MessageOptions instance
                 */
                MessageOptions.create = function create(properties) {
                    return new MessageOptions(properties);
                };
    
                /**
                 * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.MessageOptions
                 * @static
                 * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                MessageOptions.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat"))
                        writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat);
                    if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor"))
                        writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor);
                    if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
                        writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
                    if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry"))
                        writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry);
                    if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts"))
                        writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts);
                    if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                        $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
                    if (message.uninterpretedOption != null && message.uninterpretedOption.length)
                        for (var i = 0; i < message.uninterpretedOption.length; ++i)
                            $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
                    if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource"))
                        $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.MessageOptions
                 * @static
                 * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                MessageOptions.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a MessageOptions message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.MessageOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.MessageOptions} MessageOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                MessageOptions.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.messageSetWireFormat = reader.bool();
                                break;
                            }
                        case 2: {
                                message.noStandardDescriptorAccessor = reader.bool();
                                break;
                            }
                        case 3: {
                                message.deprecated = reader.bool();
                                break;
                            }
                        case 7: {
                                message.mapEntry = reader.bool();
                                break;
                            }
                        case 11: {
                                message.deprecatedLegacyJsonFieldConflicts = reader.bool();
                                break;
                            }
                        case 12: {
                                message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());
                                break;
                            }
                        case 999: {
                                if (!(message.uninterpretedOption && message.uninterpretedOption.length))
                                    message.uninterpretedOption = [];
                                message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
                                break;
                            }
                        case 1053: {
                                message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a MessageOptions message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.MessageOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.MessageOptions} MessageOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                MessageOptions.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a MessageOptions message.
                 * @function verify
                 * @memberof google.protobuf.MessageOptions
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                MessageOptions.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat"))
                        if (typeof message.messageSetWireFormat !== "boolean")
                            return "messageSetWireFormat: boolean expected";
                    if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor"))
                        if (typeof message.noStandardDescriptorAccessor !== "boolean")
                            return "noStandardDescriptorAccessor: boolean expected";
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        if (typeof message.deprecated !== "boolean")
                            return "deprecated: boolean expected";
                    if (message.mapEntry != null && message.hasOwnProperty("mapEntry"))
                        if (typeof message.mapEntry !== "boolean")
                            return "mapEntry: boolean expected";
                    if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts"))
                        if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean")
                            return "deprecatedLegacyJsonFieldConflicts: boolean expected";
                    if (message.features != null && message.hasOwnProperty("features")) {
                        var error = $root.google.protobuf.FeatureSet.verify(message.features);
                        if (error)
                            return "features." + error;
                    }
                    if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
                        if (!Array.isArray(message.uninterpretedOption))
                            return "uninterpretedOption: array expected";
                        for (var i = 0; i < message.uninterpretedOption.length; ++i) {
                            var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
                            if (error)
                                return "uninterpretedOption." + error;
                        }
                    }
                    if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) {
                        var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]);
                        if (error)
                            return ".google.api.resource." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.MessageOptions
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.MessageOptions} MessageOptions
                 */
                MessageOptions.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.MessageOptions)
                        return object;
                    var message = new $root.google.protobuf.MessageOptions();
                    if (object.messageSetWireFormat != null)
                        message.messageSetWireFormat = Boolean(object.messageSetWireFormat);
                    if (object.noStandardDescriptorAccessor != null)
                        message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor);
                    if (object.deprecated != null)
                        message.deprecated = Boolean(object.deprecated);
                    if (object.mapEntry != null)
                        message.mapEntry = Boolean(object.mapEntry);
                    if (object.deprecatedLegacyJsonFieldConflicts != null)
                        message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts);
                    if (object.features != null) {
                        if (typeof object.features !== "object")
                            throw TypeError(".google.protobuf.MessageOptions.features: object expected");
                        message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);
                    }
                    if (object.uninterpretedOption) {
                        if (!Array.isArray(object.uninterpretedOption))
                            throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected");
                        message.uninterpretedOption = [];
                        for (var i = 0; i < object.uninterpretedOption.length; ++i) {
                            if (typeof object.uninterpretedOption[i] !== "object")
                                throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected");
                            message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
                        }
                    }
                    if (object[".google.api.resource"] != null) {
                        if (typeof object[".google.api.resource"] !== "object")
                            throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected");
                        message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a MessageOptions message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.MessageOptions
                 * @static
                 * @param {google.protobuf.MessageOptions} message MessageOptions
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                MessageOptions.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.uninterpretedOption = [];
                    if (options.defaults) {
                        object.messageSetWireFormat = false;
                        object.noStandardDescriptorAccessor = false;
                        object.deprecated = false;
                        object.mapEntry = false;
                        object.deprecatedLegacyJsonFieldConflicts = false;
                        object.features = null;
                        object[".google.api.resource"] = null;
                    }
                    if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat"))
                        object.messageSetWireFormat = message.messageSetWireFormat;
                    if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor"))
                        object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor;
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        object.deprecated = message.deprecated;
                    if (message.mapEntry != null && message.hasOwnProperty("mapEntry"))
                        object.mapEntry = message.mapEntry;
                    if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts"))
                        object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts;
                    if (message.features != null && message.hasOwnProperty("features"))
                        object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);
                    if (message.uninterpretedOption && message.uninterpretedOption.length) {
                        object.uninterpretedOption = [];
                        for (var j = 0; j < message.uninterpretedOption.length; ++j)
                            object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
                    }
                    if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource"))
                        object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options);
                    return object;
                };
    
                /**
                 * Converts this MessageOptions to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.MessageOptions
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                MessageOptions.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for MessageOptions
                 * @function getTypeUrl
                 * @memberof google.protobuf.MessageOptions
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.MessageOptions";
                };
    
                return MessageOptions;
            })();
    
            protobuf.FieldOptions = (function() {
    
                /**
                 * Properties of a FieldOptions.
                 * @memberof google.protobuf
                 * @interface IFieldOptions
                 * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype
                 * @property {boolean|null} [packed] FieldOptions packed
                 * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype
                 * @property {boolean|null} [lazy] FieldOptions lazy
                 * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy
                 * @property {boolean|null} [deprecated] FieldOptions deprecated
                 * @property {boolean|null} [weak] FieldOptions weak
                 * @property {boolean|null} [debugRedact] FieldOptions debugRedact
                 * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention
                 * @property {Array.<google.protobuf.FieldOptions.OptionTargetType>|null} [targets] FieldOptions targets
                 * @property {Array.<google.protobuf.FieldOptions.IEditionDefault>|null} [editionDefaults] FieldOptions editionDefaults
                 * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features
                 * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FieldOptions uninterpretedOption
                 * @property {Array.<google.api.FieldBehavior>|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior
                 * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference
                 */
    
                /**
                 * Constructs a new FieldOptions.
                 * @memberof google.protobuf
                 * @classdesc Represents a FieldOptions.
                 * @implements IFieldOptions
                 * @constructor
                 * @param {google.protobuf.IFieldOptions=} [properties] Properties to set
                 */
                function FieldOptions(properties) {
                    this.targets = [];
                    this.editionDefaults = [];
                    this.uninterpretedOption = [];
                    this[".google.api.fieldBehavior"] = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * FieldOptions ctype.
                 * @member {google.protobuf.FieldOptions.CType} ctype
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.ctype = 0;
    
                /**
                 * FieldOptions packed.
                 * @member {boolean} packed
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.packed = false;
    
                /**
                 * FieldOptions jstype.
                 * @member {google.protobuf.FieldOptions.JSType} jstype
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.jstype = 0;
    
                /**
                 * FieldOptions lazy.
                 * @member {boolean} lazy
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.lazy = false;
    
                /**
                 * FieldOptions unverifiedLazy.
                 * @member {boolean} unverifiedLazy
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.unverifiedLazy = false;
    
                /**
                 * FieldOptions deprecated.
                 * @member {boolean} deprecated
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.deprecated = false;
    
                /**
                 * FieldOptions weak.
                 * @member {boolean} weak
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.weak = false;
    
                /**
                 * FieldOptions debugRedact.
                 * @member {boolean} debugRedact
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.debugRedact = false;
    
                /**
                 * FieldOptions retention.
                 * @member {google.protobuf.FieldOptions.OptionRetention} retention
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.retention = 0;
    
                /**
                 * FieldOptions targets.
                 * @member {Array.<google.protobuf.FieldOptions.OptionTargetType>} targets
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.targets = $util.emptyArray;
    
                /**
                 * FieldOptions editionDefaults.
                 * @member {Array.<google.protobuf.FieldOptions.IEditionDefault>} editionDefaults
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.editionDefaults = $util.emptyArray;
    
                /**
                 * FieldOptions features.
                 * @member {google.protobuf.IFeatureSet|null|undefined} features
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.features = null;
    
                /**
                 * FieldOptions uninterpretedOption.
                 * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype.uninterpretedOption = $util.emptyArray;
    
                /**
                 * FieldOptions .google.api.fieldBehavior.
                 * @member {Array.<google.api.FieldBehavior>} .google.api.fieldBehavior
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray;
    
                /**
                 * FieldOptions .google.api.resourceReference.
                 * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 */
                FieldOptions.prototype[".google.api.resourceReference"] = null;
    
                /**
                 * Creates a new FieldOptions instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.FieldOptions
                 * @static
                 * @param {google.protobuf.IFieldOptions=} [properties] Properties to set
                 * @returns {google.protobuf.FieldOptions} FieldOptions instance
                 */
                FieldOptions.create = function create(properties) {
                    return new FieldOptions(properties);
                };
    
                /**
                 * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.FieldOptions
                 * @static
                 * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FieldOptions.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype"))
                        writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype);
                    if (message.packed != null && Object.hasOwnProperty.call(message, "packed"))
                        writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed);
                    if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
                        writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
                    if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy"))
                        writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy);
                    if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype"))
                        writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype);
                    if (message.weak != null && Object.hasOwnProperty.call(message, "weak"))
                        writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak);
                    if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy"))
                        writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy);
                    if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact"))
                        writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact);
                    if (message.retention != null && Object.hasOwnProperty.call(message, "retention"))
                        writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention);
                    if (message.targets != null && message.targets.length)
                        for (var i = 0; i < message.targets.length; ++i)
                            writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]);
                    if (message.editionDefaults != null && message.editionDefaults.length)
                        for (var i = 0; i < message.editionDefaults.length; ++i)
                            $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim();
                    if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                        $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim();
                    if (message.uninterpretedOption != null && message.uninterpretedOption.length)
                        for (var i = 0; i < message.uninterpretedOption.length; ++i)
                            $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
                    if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) {
                        writer.uint32(/* id 1052, wireType 2 =*/8418).fork();
                        for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i)
                            writer.int32(message[".google.api.fieldBehavior"][i]);
                        writer.ldelim();
                    }
                    if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference"))
                        $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.FieldOptions
                 * @static
                 * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FieldOptions.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a FieldOptions message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.FieldOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.FieldOptions} FieldOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FieldOptions.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.ctype = reader.int32();
                                break;
                            }
                        case 2: {
                                message.packed = reader.bool();
                                break;
                            }
                        case 6: {
                                message.jstype = reader.int32();
                                break;
                            }
                        case 5: {
                                message.lazy = reader.bool();
                                break;
                            }
                        case 15: {
                                message.unverifiedLazy = reader.bool();
                                break;
                            }
                        case 3: {
                                message.deprecated = reader.bool();
                                break;
                            }
                        case 10: {
                                message.weak = reader.bool();
                                break;
                            }
                        case 16: {
                                message.debugRedact = reader.bool();
                                break;
                            }
                        case 17: {
                                message.retention = reader.int32();
                                break;
                            }
                        case 19: {
                                if (!(message.targets && message.targets.length))
                                    message.targets = [];
                                if ((tag & 7) === 2) {
                                    var end2 = reader.uint32() + reader.pos;
                                    while (reader.pos < end2)
                                        message.targets.push(reader.int32());
                                } else
                                    message.targets.push(reader.int32());
                                break;
                            }
                        case 20: {
                                if (!(message.editionDefaults && message.editionDefaults.length))
                                    message.editionDefaults = [];
                                message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32()));
                                break;
                            }
                        case 21: {
                                message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());
                                break;
                            }
                        case 999: {
                                if (!(message.uninterpretedOption && message.uninterpretedOption.length))
                                    message.uninterpretedOption = [];
                                message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
                                break;
                            }
                        case 1052: {
                                if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length))
                                    message[".google.api.fieldBehavior"] = [];
                                if ((tag & 7) === 2) {
                                    var end2 = reader.uint32() + reader.pos;
                                    while (reader.pos < end2)
                                        message[".google.api.fieldBehavior"].push(reader.int32());
                                } else
                                    message[".google.api.fieldBehavior"].push(reader.int32());
                                break;
                            }
                        case 1055: {
                                message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a FieldOptions message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.FieldOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.FieldOptions} FieldOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FieldOptions.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a FieldOptions message.
                 * @function verify
                 * @memberof google.protobuf.FieldOptions
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                FieldOptions.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.ctype != null && message.hasOwnProperty("ctype"))
                        switch (message.ctype) {
                        default:
                            return "ctype: enum value expected";
                        case 0:
                        case 1:
                        case 2:
                            break;
                        }
                    if (message.packed != null && message.hasOwnProperty("packed"))
                        if (typeof message.packed !== "boolean")
                            return "packed: boolean expected";
                    if (message.jstype != null && message.hasOwnProperty("jstype"))
                        switch (message.jstype) {
                        default:
                            return "jstype: enum value expected";
                        case 0:
                        case 1:
                        case 2:
                            break;
                        }
                    if (message.lazy != null && message.hasOwnProperty("lazy"))
                        if (typeof message.lazy !== "boolean")
                            return "lazy: boolean expected";
                    if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy"))
                        if (typeof message.unverifiedLazy !== "boolean")
                            return "unverifiedLazy: boolean expected";
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        if (typeof message.deprecated !== "boolean")
                            return "deprecated: boolean expected";
                    if (message.weak != null && message.hasOwnProperty("weak"))
                        if (typeof message.weak !== "boolean")
                            return "weak: boolean expected";
                    if (message.debugRedact != null && message.hasOwnProperty("debugRedact"))
                        if (typeof message.debugRedact !== "boolean")
                            return "debugRedact: boolean expected";
                    if (message.retention != null && message.hasOwnProperty("retention"))
                        switch (message.retention) {
                        default:
                            return "retention: enum value expected";
                        case 0:
                        case 1:
                        case 2:
                            break;
                        }
                    if (message.targets != null && message.hasOwnProperty("targets")) {
                        if (!Array.isArray(message.targets))
                            return "targets: array expected";
                        for (var i = 0; i < message.targets.length; ++i)
                            switch (message.targets[i]) {
                            default:
                                return "targets: enum value[] expected";
                            case 0:
                            case 1:
                            case 2:
                            case 3:
                            case 4:
                            case 5:
                            case 6:
                            case 7:
                            case 8:
                            case 9:
                                break;
                            }
                    }
                    if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) {
                        if (!Array.isArray(message.editionDefaults))
                            return "editionDefaults: array expected";
                        for (var i = 0; i < message.editionDefaults.length; ++i) {
                            var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]);
                            if (error)
                                return "editionDefaults." + error;
                        }
                    }
                    if (message.features != null && message.hasOwnProperty("features")) {
                        var error = $root.google.protobuf.FeatureSet.verify(message.features);
                        if (error)
                            return "features." + error;
                    }
                    if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
                        if (!Array.isArray(message.uninterpretedOption))
                            return "uninterpretedOption: array expected";
                        for (var i = 0; i < message.uninterpretedOption.length; ++i) {
                            var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
                            if (error)
                                return "uninterpretedOption." + error;
                        }
                    }
                    if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) {
                        if (!Array.isArray(message[".google.api.fieldBehavior"]))
                            return ".google.api.fieldBehavior: array expected";
                        for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i)
                            switch (message[".google.api.fieldBehavior"][i]) {
                            default:
                                return ".google.api.fieldBehavior: enum value[] expected";
                            case 0:
                            case 1:
                            case 2:
                            case 3:
                            case 4:
                            case 5:
                            case 6:
                            case 7:
                            case 8:
                                break;
                            }
                    }
                    if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) {
                        var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]);
                        if (error)
                            return ".google.api.resourceReference." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.FieldOptions
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.FieldOptions} FieldOptions
                 */
                FieldOptions.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.FieldOptions)
                        return object;
                    var message = new $root.google.protobuf.FieldOptions();
                    switch (object.ctype) {
                    default:
                        if (typeof object.ctype === "number") {
                            message.ctype = object.ctype;
                            break;
                        }
                        break;
                    case "STRING":
                    case 0:
                        message.ctype = 0;
                        break;
                    case "CORD":
                    case 1:
                        message.ctype = 1;
                        break;
                    case "STRING_PIECE":
                    case 2:
                        message.ctype = 2;
                        break;
                    }
                    if (object.packed != null)
                        message.packed = Boolean(object.packed);
                    switch (object.jstype) {
                    default:
                        if (typeof object.jstype === "number") {
                            message.jstype = object.jstype;
                            break;
                        }
                        break;
                    case "JS_NORMAL":
                    case 0:
                        message.jstype = 0;
                        break;
                    case "JS_STRING":
                    case 1:
                        message.jstype = 1;
                        break;
                    case "JS_NUMBER":
                    case 2:
                        message.jstype = 2;
                        break;
                    }
                    if (object.lazy != null)
                        message.lazy = Boolean(object.lazy);
                    if (object.unverifiedLazy != null)
                        message.unverifiedLazy = Boolean(object.unverifiedLazy);
                    if (object.deprecated != null)
                        message.deprecated = Boolean(object.deprecated);
                    if (object.weak != null)
                        message.weak = Boolean(object.weak);
                    if (object.debugRedact != null)
                        message.debugRedact = Boolean(object.debugRedact);
                    switch (object.retention) {
                    default:
                        if (typeof object.retention === "number") {
                            message.retention = object.retention;
                            break;
                        }
                        break;
                    case "RETENTION_UNKNOWN":
                    case 0:
                        message.retention = 0;
                        break;
                    case "RETENTION_RUNTIME":
                    case 1:
                        message.retention = 1;
                        break;
                    case "RETENTION_SOURCE":
                    case 2:
                        message.retention = 2;
                        break;
                    }
                    if (object.targets) {
                        if (!Array.isArray(object.targets))
                            throw TypeError(".google.protobuf.FieldOptions.targets: array expected");
                        message.targets = [];
                        for (var i = 0; i < object.targets.length; ++i)
                            switch (object.targets[i]) {
                            default:
                                if (typeof object.targets[i] === "number") {
                                    message.targets[i] = object.targets[i];
                                    break;
                                }
                            case "TARGET_TYPE_UNKNOWN":
                            case 0:
                                message.targets[i] = 0;
                                break;
                            case "TARGET_TYPE_FILE":
                            case 1:
                                message.targets[i] = 1;
                                break;
                            case "TARGET_TYPE_EXTENSION_RANGE":
                            case 2:
                                message.targets[i] = 2;
                                break;
                            case "TARGET_TYPE_MESSAGE":
                            case 3:
                                message.targets[i] = 3;
                                break;
                            case "TARGET_TYPE_FIELD":
                            case 4:
                                message.targets[i] = 4;
                                break;
                            case "TARGET_TYPE_ONEOF":
                            case 5:
                                message.targets[i] = 5;
                                break;
                            case "TARGET_TYPE_ENUM":
                            case 6:
                                message.targets[i] = 6;
                                break;
                            case "TARGET_TYPE_ENUM_ENTRY":
                            case 7:
                                message.targets[i] = 7;
                                break;
                            case "TARGET_TYPE_SERVICE":
                            case 8:
                                message.targets[i] = 8;
                                break;
                            case "TARGET_TYPE_METHOD":
                            case 9:
                                message.targets[i] = 9;
                                break;
                            }
                    }
                    if (object.editionDefaults) {
                        if (!Array.isArray(object.editionDefaults))
                            throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected");
                        message.editionDefaults = [];
                        for (var i = 0; i < object.editionDefaults.length; ++i) {
                            if (typeof object.editionDefaults[i] !== "object")
                                throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected");
                            message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]);
                        }
                    }
                    if (object.features != null) {
                        if (typeof object.features !== "object")
                            throw TypeError(".google.protobuf.FieldOptions.features: object expected");
                        message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);
                    }
                    if (object.uninterpretedOption) {
                        if (!Array.isArray(object.uninterpretedOption))
                            throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected");
                        message.uninterpretedOption = [];
                        for (var i = 0; i < object.uninterpretedOption.length; ++i) {
                            if (typeof object.uninterpretedOption[i] !== "object")
                                throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected");
                            message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
                        }
                    }
                    if (object[".google.api.fieldBehavior"]) {
                        if (!Array.isArray(object[".google.api.fieldBehavior"]))
                            throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected");
                        message[".google.api.fieldBehavior"] = [];
                        for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i)
                            switch (object[".google.api.fieldBehavior"][i]) {
                            default:
                                if (typeof object[".google.api.fieldBehavior"][i] === "number") {
                                    message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i];
                                    break;
                                }
                            case "FIELD_BEHAVIOR_UNSPECIFIED":
                            case 0:
                                message[".google.api.fieldBehavior"][i] = 0;
                                break;
                            case "OPTIONAL":
                            case 1:
                                message[".google.api.fieldBehavior"][i] = 1;
                                break;
                            case "REQUIRED":
                            case 2:
                                message[".google.api.fieldBehavior"][i] = 2;
                                break;
                            case "OUTPUT_ONLY":
                            case 3:
                                message[".google.api.fieldBehavior"][i] = 3;
                                break;
                            case "INPUT_ONLY":
                            case 4:
                                message[".google.api.fieldBehavior"][i] = 4;
                                break;
                            case "IMMUTABLE":
                            case 5:
                                message[".google.api.fieldBehavior"][i] = 5;
                                break;
                            case "UNORDERED_LIST":
                            case 6:
                                message[".google.api.fieldBehavior"][i] = 6;
                                break;
                            case "NON_EMPTY_DEFAULT":
                            case 7:
                                message[".google.api.fieldBehavior"][i] = 7;
                                break;
                            case "IDENTIFIER":
                            case 8:
                                message[".google.api.fieldBehavior"][i] = 8;
                                break;
                            }
                    }
                    if (object[".google.api.resourceReference"] != null) {
                        if (typeof object[".google.api.resourceReference"] !== "object")
                            throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected");
                        message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a FieldOptions message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.FieldOptions
                 * @static
                 * @param {google.protobuf.FieldOptions} message FieldOptions
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                FieldOptions.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults) {
                        object.targets = [];
                        object.editionDefaults = [];
                        object.uninterpretedOption = [];
                        object[".google.api.fieldBehavior"] = [];
                    }
                    if (options.defaults) {
                        object.ctype = options.enums === String ? "STRING" : 0;
                        object.packed = false;
                        object.deprecated = false;
                        object.lazy = false;
                        object.jstype = options.enums === String ? "JS_NORMAL" : 0;
                        object.weak = false;
                        object.unverifiedLazy = false;
                        object.debugRedact = false;
                        object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0;
                        object.features = null;
                        object[".google.api.resourceReference"] = null;
                    }
                    if (message.ctype != null && message.hasOwnProperty("ctype"))
                        object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype;
                    if (message.packed != null && message.hasOwnProperty("packed"))
                        object.packed = message.packed;
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        object.deprecated = message.deprecated;
                    if (message.lazy != null && message.hasOwnProperty("lazy"))
                        object.lazy = message.lazy;
                    if (message.jstype != null && message.hasOwnProperty("jstype"))
                        object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype;
                    if (message.weak != null && message.hasOwnProperty("weak"))
                        object.weak = message.weak;
                    if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy"))
                        object.unverifiedLazy = message.unverifiedLazy;
                    if (message.debugRedact != null && message.hasOwnProperty("debugRedact"))
                        object.debugRedact = message.debugRedact;
                    if (message.retention != null && message.hasOwnProperty("retention"))
                        object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention;
                    if (message.targets && message.targets.length) {
                        object.targets = [];
                        for (var j = 0; j < message.targets.length; ++j)
                            object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j];
                    }
                    if (message.editionDefaults && message.editionDefaults.length) {
                        object.editionDefaults = [];
                        for (var j = 0; j < message.editionDefaults.length; ++j)
                            object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options);
                    }
                    if (message.features != null && message.hasOwnProperty("features"))
                        object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);
                    if (message.uninterpretedOption && message.uninterpretedOption.length) {
                        object.uninterpretedOption = [];
                        for (var j = 0; j < message.uninterpretedOption.length; ++j)
                            object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
                    }
                    if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) {
                        object[".google.api.fieldBehavior"] = [];
                        for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j)
                            object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j];
                    }
                    if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference"))
                        object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options);
                    return object;
                };
    
                /**
                 * Converts this FieldOptions to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.FieldOptions
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                FieldOptions.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for FieldOptions
                 * @function getTypeUrl
                 * @memberof google.protobuf.FieldOptions
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.FieldOptions";
                };
    
                /**
                 * CType enum.
                 * @name google.protobuf.FieldOptions.CType
                 * @enum {number}
                 * @property {number} STRING=0 STRING value
                 * @property {number} CORD=1 CORD value
                 * @property {number} STRING_PIECE=2 STRING_PIECE value
                 */
                FieldOptions.CType = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "STRING"] = 0;
                    values[valuesById[1] = "CORD"] = 1;
                    values[valuesById[2] = "STRING_PIECE"] = 2;
                    return values;
                })();
    
                /**
                 * JSType enum.
                 * @name google.protobuf.FieldOptions.JSType
                 * @enum {number}
                 * @property {number} JS_NORMAL=0 JS_NORMAL value
                 * @property {number} JS_STRING=1 JS_STRING value
                 * @property {number} JS_NUMBER=2 JS_NUMBER value
                 */
                FieldOptions.JSType = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "JS_NORMAL"] = 0;
                    values[valuesById[1] = "JS_STRING"] = 1;
                    values[valuesById[2] = "JS_NUMBER"] = 2;
                    return values;
                })();
    
                /**
                 * OptionRetention enum.
                 * @name google.protobuf.FieldOptions.OptionRetention
                 * @enum {number}
                 * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value
                 * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value
                 * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value
                 */
                FieldOptions.OptionRetention = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "RETENTION_UNKNOWN"] = 0;
                    values[valuesById[1] = "RETENTION_RUNTIME"] = 1;
                    values[valuesById[2] = "RETENTION_SOURCE"] = 2;
                    return values;
                })();
    
                /**
                 * OptionTargetType enum.
                 * @name google.protobuf.FieldOptions.OptionTargetType
                 * @enum {number}
                 * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value
                 * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value
                 * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value
                 * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value
                 * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value
                 * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value
                 * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value
                 * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value
                 * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value
                 * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value
                 */
                FieldOptions.OptionTargetType = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0;
                    values[valuesById[1] = "TARGET_TYPE_FILE"] = 1;
                    values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2;
                    values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3;
                    values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4;
                    values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5;
                    values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6;
                    values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7;
                    values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8;
                    values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9;
                    return values;
                })();
    
                FieldOptions.EditionDefault = (function() {
    
                    /**
                     * Properties of an EditionDefault.
                     * @memberof google.protobuf.FieldOptions
                     * @interface IEditionDefault
                     * @property {google.protobuf.Edition|null} [edition] EditionDefault edition
                     * @property {string|null} [value] EditionDefault value
                     */
    
                    /**
                     * Constructs a new EditionDefault.
                     * @memberof google.protobuf.FieldOptions
                     * @classdesc Represents an EditionDefault.
                     * @implements IEditionDefault
                     * @constructor
                     * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set
                     */
                    function EditionDefault(properties) {
                        if (properties)
                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                if (properties[keys[i]] != null)
                                    this[keys[i]] = properties[keys[i]];
                    }
    
                    /**
                     * EditionDefault edition.
                     * @member {google.protobuf.Edition} edition
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @instance
                     */
                    EditionDefault.prototype.edition = 0;
    
                    /**
                     * EditionDefault value.
                     * @member {string} value
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @instance
                     */
                    EditionDefault.prototype.value = "";
    
                    /**
                     * Creates a new EditionDefault instance using the specified properties.
                     * @function create
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @static
                     * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set
                     * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance
                     */
                    EditionDefault.create = function create(properties) {
                        return new EditionDefault(properties);
                    };
    
                    /**
                     * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages.
                     * @function encode
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @static
                     * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    EditionDefault.encode = function encode(message, writer) {
                        if (!writer)
                            writer = $Writer.create();
                        if (message.value != null && Object.hasOwnProperty.call(message, "value"))
                            writer.uint32(/* id 2, wireType 2 =*/18).string(message.value);
                        if (message.edition != null && Object.hasOwnProperty.call(message, "edition"))
                            writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition);
                        return writer;
                    };
    
                    /**
                     * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages.
                     * @function encodeDelimited
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @static
                     * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    EditionDefault.encodeDelimited = function encodeDelimited(message, writer) {
                        return this.encode(message, writer).ldelim();
                    };
    
                    /**
                     * Decodes an EditionDefault message from the specified reader or buffer.
                     * @function decode
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    EditionDefault.decode = function decode(reader, length) {
                        if (!(reader instanceof $Reader))
                            reader = $Reader.create(reader);
                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault();
                        while (reader.pos < end) {
                            var tag = reader.uint32();
                            switch (tag >>> 3) {
                            case 3: {
                                    message.edition = reader.int32();
                                    break;
                                }
                            case 2: {
                                    message.value = reader.string();
                                    break;
                                }
                            default:
                                reader.skipType(tag & 7);
                                break;
                            }
                        }
                        return message;
                    };
    
                    /**
                     * Decodes an EditionDefault message from the specified reader or buffer, length delimited.
                     * @function decodeDelimited
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    EditionDefault.decodeDelimited = function decodeDelimited(reader) {
                        if (!(reader instanceof $Reader))
                            reader = new $Reader(reader);
                        return this.decode(reader, reader.uint32());
                    };
    
                    /**
                     * Verifies an EditionDefault message.
                     * @function verify
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @static
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {string|null} `null` if valid, otherwise the reason why it is not
                     */
                    EditionDefault.verify = function verify(message) {
                        if (typeof message !== "object" || message === null)
                            return "object expected";
                        if (message.edition != null && message.hasOwnProperty("edition"))
                            switch (message.edition) {
                            default:
                                return "edition: enum value expected";
                            case 0:
                            case 998:
                            case 999:
                            case 1000:
                            case 1001:
                            case 1:
                            case 2:
                            case 99997:
                            case 99998:
                            case 99999:
                            case 2147483647:
                                break;
                            }
                        if (message.value != null && message.hasOwnProperty("value"))
                            if (!$util.isString(message.value))
                                return "value: string expected";
                        return null;
                    };
    
                    /**
                     * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types.
                     * @function fromObject
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @static
                     * @param {Object.<string,*>} object Plain object
                     * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault
                     */
                    EditionDefault.fromObject = function fromObject(object) {
                        if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault)
                            return object;
                        var message = new $root.google.protobuf.FieldOptions.EditionDefault();
                        switch (object.edition) {
                        default:
                            if (typeof object.edition === "number") {
                                message.edition = object.edition;
                                break;
                            }
                            break;
                        case "EDITION_UNKNOWN":
                        case 0:
                            message.edition = 0;
                            break;
                        case "EDITION_PROTO2":
                        case 998:
                            message.edition = 998;
                            break;
                        case "EDITION_PROTO3":
                        case 999:
                            message.edition = 999;
                            break;
                        case "EDITION_2023":
                        case 1000:
                            message.edition = 1000;
                            break;
                        case "EDITION_2024":
                        case 1001:
                            message.edition = 1001;
                            break;
                        case "EDITION_1_TEST_ONLY":
                        case 1:
                            message.edition = 1;
                            break;
                        case "EDITION_2_TEST_ONLY":
                        case 2:
                            message.edition = 2;
                            break;
                        case "EDITION_99997_TEST_ONLY":
                        case 99997:
                            message.edition = 99997;
                            break;
                        case "EDITION_99998_TEST_ONLY":
                        case 99998:
                            message.edition = 99998;
                            break;
                        case "EDITION_99999_TEST_ONLY":
                        case 99999:
                            message.edition = 99999;
                            break;
                        case "EDITION_MAX":
                        case 2147483647:
                            message.edition = 2147483647;
                            break;
                        }
                        if (object.value != null)
                            message.value = String(object.value);
                        return message;
                    };
    
                    /**
                     * Creates a plain object from an EditionDefault message. Also converts values to other types if specified.
                     * @function toObject
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @static
                     * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault
                     * @param {$protobuf.IConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    EditionDefault.toObject = function toObject(message, options) {
                        if (!options)
                            options = {};
                        var object = {};
                        if (options.defaults) {
                            object.value = "";
                            object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0;
                        }
                        if (message.value != null && message.hasOwnProperty("value"))
                            object.value = message.value;
                        if (message.edition != null && message.hasOwnProperty("edition"))
                            object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition;
                        return object;
                    };
    
                    /**
                     * Converts this EditionDefault to JSON.
                     * @function toJSON
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @instance
                     * @returns {Object.<string,*>} JSON object
                     */
                    EditionDefault.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };
    
                    /**
                     * Gets the default type url for EditionDefault
                     * @function getTypeUrl
                     * @memberof google.protobuf.FieldOptions.EditionDefault
                     * @static
                     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                     * @returns {string} The default type url
                     */
                    EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault";
                    };
    
                    return EditionDefault;
                })();
    
                return FieldOptions;
            })();
    
            protobuf.OneofOptions = (function() {
    
                /**
                 * Properties of an OneofOptions.
                 * @memberof google.protobuf
                 * @interface IOneofOptions
                 * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features
                 * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] OneofOptions uninterpretedOption
                 */
    
                /**
                 * Constructs a new OneofOptions.
                 * @memberof google.protobuf
                 * @classdesc Represents an OneofOptions.
                 * @implements IOneofOptions
                 * @constructor
                 * @param {google.protobuf.IOneofOptions=} [properties] Properties to set
                 */
                function OneofOptions(properties) {
                    this.uninterpretedOption = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * OneofOptions features.
                 * @member {google.protobuf.IFeatureSet|null|undefined} features
                 * @memberof google.protobuf.OneofOptions
                 * @instance
                 */
                OneofOptions.prototype.features = null;
    
                /**
                 * OneofOptions uninterpretedOption.
                 * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
                 * @memberof google.protobuf.OneofOptions
                 * @instance
                 */
                OneofOptions.prototype.uninterpretedOption = $util.emptyArray;
    
                /**
                 * Creates a new OneofOptions instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.OneofOptions
                 * @static
                 * @param {google.protobuf.IOneofOptions=} [properties] Properties to set
                 * @returns {google.protobuf.OneofOptions} OneofOptions instance
                 */
                OneofOptions.create = function create(properties) {
                    return new OneofOptions(properties);
                };
    
                /**
                 * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.OneofOptions
                 * @static
                 * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                OneofOptions.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                        $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    if (message.uninterpretedOption != null && message.uninterpretedOption.length)
                        for (var i = 0; i < message.uninterpretedOption.length; ++i)
                            $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.OneofOptions
                 * @static
                 * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                OneofOptions.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an OneofOptions message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.OneofOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.OneofOptions} OneofOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                OneofOptions.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());
                                break;
                            }
                        case 999: {
                                if (!(message.uninterpretedOption && message.uninterpretedOption.length))
                                    message.uninterpretedOption = [];
                                message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an OneofOptions message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.OneofOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.OneofOptions} OneofOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                OneofOptions.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an OneofOptions message.
                 * @function verify
                 * @memberof google.protobuf.OneofOptions
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                OneofOptions.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.features != null && message.hasOwnProperty("features")) {
                        var error = $root.google.protobuf.FeatureSet.verify(message.features);
                        if (error)
                            return "features." + error;
                    }
                    if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
                        if (!Array.isArray(message.uninterpretedOption))
                            return "uninterpretedOption: array expected";
                        for (var i = 0; i < message.uninterpretedOption.length; ++i) {
                            var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
                            if (error)
                                return "uninterpretedOption." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.OneofOptions
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.OneofOptions} OneofOptions
                 */
                OneofOptions.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.OneofOptions)
                        return object;
                    var message = new $root.google.protobuf.OneofOptions();
                    if (object.features != null) {
                        if (typeof object.features !== "object")
                            throw TypeError(".google.protobuf.OneofOptions.features: object expected");
                        message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);
                    }
                    if (object.uninterpretedOption) {
                        if (!Array.isArray(object.uninterpretedOption))
                            throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected");
                        message.uninterpretedOption = [];
                        for (var i = 0; i < object.uninterpretedOption.length; ++i) {
                            if (typeof object.uninterpretedOption[i] !== "object")
                                throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected");
                            message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
                        }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from an OneofOptions message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.OneofOptions
                 * @static
                 * @param {google.protobuf.OneofOptions} message OneofOptions
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                OneofOptions.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.uninterpretedOption = [];
                    if (options.defaults)
                        object.features = null;
                    if (message.features != null && message.hasOwnProperty("features"))
                        object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);
                    if (message.uninterpretedOption && message.uninterpretedOption.length) {
                        object.uninterpretedOption = [];
                        for (var j = 0; j < message.uninterpretedOption.length; ++j)
                            object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
                    }
                    return object;
                };
    
                /**
                 * Converts this OneofOptions to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.OneofOptions
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                OneofOptions.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for OneofOptions
                 * @function getTypeUrl
                 * @memberof google.protobuf.OneofOptions
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.OneofOptions";
                };
    
                return OneofOptions;
            })();
    
            protobuf.EnumOptions = (function() {
    
                /**
                 * Properties of an EnumOptions.
                 * @memberof google.protobuf
                 * @interface IEnumOptions
                 * @property {boolean|null} [allowAlias] EnumOptions allowAlias
                 * @property {boolean|null} [deprecated] EnumOptions deprecated
                 * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts
                 * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features
                 * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumOptions uninterpretedOption
                 */
    
                /**
                 * Constructs a new EnumOptions.
                 * @memberof google.protobuf
                 * @classdesc Represents an EnumOptions.
                 * @implements IEnumOptions
                 * @constructor
                 * @param {google.protobuf.IEnumOptions=} [properties] Properties to set
                 */
                function EnumOptions(properties) {
                    this.uninterpretedOption = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * EnumOptions allowAlias.
                 * @member {boolean} allowAlias
                 * @memberof google.protobuf.EnumOptions
                 * @instance
                 */
                EnumOptions.prototype.allowAlias = false;
    
                /**
                 * EnumOptions deprecated.
                 * @member {boolean} deprecated
                 * @memberof google.protobuf.EnumOptions
                 * @instance
                 */
                EnumOptions.prototype.deprecated = false;
    
                /**
                 * EnumOptions deprecatedLegacyJsonFieldConflicts.
                 * @member {boolean} deprecatedLegacyJsonFieldConflicts
                 * @memberof google.protobuf.EnumOptions
                 * @instance
                 */
                EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false;
    
                /**
                 * EnumOptions features.
                 * @member {google.protobuf.IFeatureSet|null|undefined} features
                 * @memberof google.protobuf.EnumOptions
                 * @instance
                 */
                EnumOptions.prototype.features = null;
    
                /**
                 * EnumOptions uninterpretedOption.
                 * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
                 * @memberof google.protobuf.EnumOptions
                 * @instance
                 */
                EnumOptions.prototype.uninterpretedOption = $util.emptyArray;
    
                /**
                 * Creates a new EnumOptions instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.EnumOptions
                 * @static
                 * @param {google.protobuf.IEnumOptions=} [properties] Properties to set
                 * @returns {google.protobuf.EnumOptions} EnumOptions instance
                 */
                EnumOptions.create = function create(properties) {
                    return new EnumOptions(properties);
                };
    
                /**
                 * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.EnumOptions
                 * @static
                 * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                EnumOptions.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias"))
                        writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias);
                    if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
                        writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
                    if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts"))
                        writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts);
                    if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                        $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                    if (message.uninterpretedOption != null && message.uninterpretedOption.length)
                        for (var i = 0; i < message.uninterpretedOption.length; ++i)
                            $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.EnumOptions
                 * @static
                 * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                EnumOptions.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an EnumOptions message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.EnumOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.EnumOptions} EnumOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                EnumOptions.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 2: {
                                message.allowAlias = reader.bool();
                                break;
                            }
                        case 3: {
                                message.deprecated = reader.bool();
                                break;
                            }
                        case 6: {
                                message.deprecatedLegacyJsonFieldConflicts = reader.bool();
                                break;
                            }
                        case 7: {
                                message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());
                                break;
                            }
                        case 999: {
                                if (!(message.uninterpretedOption && message.uninterpretedOption.length))
                                    message.uninterpretedOption = [];
                                message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an EnumOptions message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.EnumOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.EnumOptions} EnumOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                EnumOptions.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an EnumOptions message.
                 * @function verify
                 * @memberof google.protobuf.EnumOptions
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                EnumOptions.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.allowAlias != null && message.hasOwnProperty("allowAlias"))
                        if (typeof message.allowAlias !== "boolean")
                            return "allowAlias: boolean expected";
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        if (typeof message.deprecated !== "boolean")
                            return "deprecated: boolean expected";
                    if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts"))
                        if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean")
                            return "deprecatedLegacyJsonFieldConflicts: boolean expected";
                    if (message.features != null && message.hasOwnProperty("features")) {
                        var error = $root.google.protobuf.FeatureSet.verify(message.features);
                        if (error)
                            return "features." + error;
                    }
                    if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
                        if (!Array.isArray(message.uninterpretedOption))
                            return "uninterpretedOption: array expected";
                        for (var i = 0; i < message.uninterpretedOption.length; ++i) {
                            var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
                            if (error)
                                return "uninterpretedOption." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.EnumOptions
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.EnumOptions} EnumOptions
                 */
                EnumOptions.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.EnumOptions)
                        return object;
                    var message = new $root.google.protobuf.EnumOptions();
                    if (object.allowAlias != null)
                        message.allowAlias = Boolean(object.allowAlias);
                    if (object.deprecated != null)
                        message.deprecated = Boolean(object.deprecated);
                    if (object.deprecatedLegacyJsonFieldConflicts != null)
                        message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts);
                    if (object.features != null) {
                        if (typeof object.features !== "object")
                            throw TypeError(".google.protobuf.EnumOptions.features: object expected");
                        message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);
                    }
                    if (object.uninterpretedOption) {
                        if (!Array.isArray(object.uninterpretedOption))
                            throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected");
                        message.uninterpretedOption = [];
                        for (var i = 0; i < object.uninterpretedOption.length; ++i) {
                            if (typeof object.uninterpretedOption[i] !== "object")
                                throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected");
                            message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
                        }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from an EnumOptions message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.EnumOptions
                 * @static
                 * @param {google.protobuf.EnumOptions} message EnumOptions
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                EnumOptions.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.uninterpretedOption = [];
                    if (options.defaults) {
                        object.allowAlias = false;
                        object.deprecated = false;
                        object.deprecatedLegacyJsonFieldConflicts = false;
                        object.features = null;
                    }
                    if (message.allowAlias != null && message.hasOwnProperty("allowAlias"))
                        object.allowAlias = message.allowAlias;
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        object.deprecated = message.deprecated;
                    if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts"))
                        object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts;
                    if (message.features != null && message.hasOwnProperty("features"))
                        object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);
                    if (message.uninterpretedOption && message.uninterpretedOption.length) {
                        object.uninterpretedOption = [];
                        for (var j = 0; j < message.uninterpretedOption.length; ++j)
                            object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
                    }
                    return object;
                };
    
                /**
                 * Converts this EnumOptions to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.EnumOptions
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                EnumOptions.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for EnumOptions
                 * @function getTypeUrl
                 * @memberof google.protobuf.EnumOptions
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.EnumOptions";
                };
    
                return EnumOptions;
            })();
    
            protobuf.EnumValueOptions = (function() {
    
                /**
                 * Properties of an EnumValueOptions.
                 * @memberof google.protobuf
                 * @interface IEnumValueOptions
                 * @property {boolean|null} [deprecated] EnumValueOptions deprecated
                 * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features
                 * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact
                 * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumValueOptions uninterpretedOption
                 */
    
                /**
                 * Constructs a new EnumValueOptions.
                 * @memberof google.protobuf
                 * @classdesc Represents an EnumValueOptions.
                 * @implements IEnumValueOptions
                 * @constructor
                 * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
                 */
                function EnumValueOptions(properties) {
                    this.uninterpretedOption = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * EnumValueOptions deprecated.
                 * @member {boolean} deprecated
                 * @memberof google.protobuf.EnumValueOptions
                 * @instance
                 */
                EnumValueOptions.prototype.deprecated = false;
    
                /**
                 * EnumValueOptions features.
                 * @member {google.protobuf.IFeatureSet|null|undefined} features
                 * @memberof google.protobuf.EnumValueOptions
                 * @instance
                 */
                EnumValueOptions.prototype.features = null;
    
                /**
                 * EnumValueOptions debugRedact.
                 * @member {boolean} debugRedact
                 * @memberof google.protobuf.EnumValueOptions
                 * @instance
                 */
                EnumValueOptions.prototype.debugRedact = false;
    
                /**
                 * EnumValueOptions uninterpretedOption.
                 * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
                 * @memberof google.protobuf.EnumValueOptions
                 * @instance
                 */
                EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray;
    
                /**
                 * Creates a new EnumValueOptions instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.EnumValueOptions
                 * @static
                 * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
                 * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance
                 */
                EnumValueOptions.create = function create(properties) {
                    return new EnumValueOptions(properties);
                };
    
                /**
                 * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.EnumValueOptions
                 * @static
                 * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                EnumValueOptions.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
                        writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated);
                    if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                        $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                    if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact"))
                        writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact);
                    if (message.uninterpretedOption != null && message.uninterpretedOption.length)
                        for (var i = 0; i < message.uninterpretedOption.length; ++i)
                            $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.EnumValueOptions
                 * @static
                 * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an EnumValueOptions message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.EnumValueOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                EnumValueOptions.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.deprecated = reader.bool();
                                break;
                            }
                        case 2: {
                                message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());
                                break;
                            }
                        case 3: {
                                message.debugRedact = reader.bool();
                                break;
                            }
                        case 999: {
                                if (!(message.uninterpretedOption && message.uninterpretedOption.length))
                                    message.uninterpretedOption = [];
                                message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.EnumValueOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                EnumValueOptions.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an EnumValueOptions message.
                 * @function verify
                 * @memberof google.protobuf.EnumValueOptions
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                EnumValueOptions.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        if (typeof message.deprecated !== "boolean")
                            return "deprecated: boolean expected";
                    if (message.features != null && message.hasOwnProperty("features")) {
                        var error = $root.google.protobuf.FeatureSet.verify(message.features);
                        if (error)
                            return "features." + error;
                    }
                    if (message.debugRedact != null && message.hasOwnProperty("debugRedact"))
                        if (typeof message.debugRedact !== "boolean")
                            return "debugRedact: boolean expected";
                    if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
                        if (!Array.isArray(message.uninterpretedOption))
                            return "uninterpretedOption: array expected";
                        for (var i = 0; i < message.uninterpretedOption.length; ++i) {
                            var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
                            if (error)
                                return "uninterpretedOption." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.EnumValueOptions
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
                 */
                EnumValueOptions.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.EnumValueOptions)
                        return object;
                    var message = new $root.google.protobuf.EnumValueOptions();
                    if (object.deprecated != null)
                        message.deprecated = Boolean(object.deprecated);
                    if (object.features != null) {
                        if (typeof object.features !== "object")
                            throw TypeError(".google.protobuf.EnumValueOptions.features: object expected");
                        message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);
                    }
                    if (object.debugRedact != null)
                        message.debugRedact = Boolean(object.debugRedact);
                    if (object.uninterpretedOption) {
                        if (!Array.isArray(object.uninterpretedOption))
                            throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected");
                        message.uninterpretedOption = [];
                        for (var i = 0; i < object.uninterpretedOption.length; ++i) {
                            if (typeof object.uninterpretedOption[i] !== "object")
                                throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected");
                            message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
                        }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.EnumValueOptions
                 * @static
                 * @param {google.protobuf.EnumValueOptions} message EnumValueOptions
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                EnumValueOptions.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.uninterpretedOption = [];
                    if (options.defaults) {
                        object.deprecated = false;
                        object.features = null;
                        object.debugRedact = false;
                    }
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        object.deprecated = message.deprecated;
                    if (message.features != null && message.hasOwnProperty("features"))
                        object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);
                    if (message.debugRedact != null && message.hasOwnProperty("debugRedact"))
                        object.debugRedact = message.debugRedact;
                    if (message.uninterpretedOption && message.uninterpretedOption.length) {
                        object.uninterpretedOption = [];
                        for (var j = 0; j < message.uninterpretedOption.length; ++j)
                            object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
                    }
                    return object;
                };
    
                /**
                 * Converts this EnumValueOptions to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.EnumValueOptions
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                EnumValueOptions.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for EnumValueOptions
                 * @function getTypeUrl
                 * @memberof google.protobuf.EnumValueOptions
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.EnumValueOptions";
                };
    
                return EnumValueOptions;
            })();
    
            protobuf.ServiceOptions = (function() {
    
                /**
                 * Properties of a ServiceOptions.
                 * @memberof google.protobuf
                 * @interface IServiceOptions
                 * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features
                 * @property {boolean|null} [deprecated] ServiceOptions deprecated
                 * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ServiceOptions uninterpretedOption
                 * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost
                 * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes
                 */
    
                /**
                 * Constructs a new ServiceOptions.
                 * @memberof google.protobuf
                 * @classdesc Represents a ServiceOptions.
                 * @implements IServiceOptions
                 * @constructor
                 * @param {google.protobuf.IServiceOptions=} [properties] Properties to set
                 */
                function ServiceOptions(properties) {
                    this.uninterpretedOption = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * ServiceOptions features.
                 * @member {google.protobuf.IFeatureSet|null|undefined} features
                 * @memberof google.protobuf.ServiceOptions
                 * @instance
                 */
                ServiceOptions.prototype.features = null;
    
                /**
                 * ServiceOptions deprecated.
                 * @member {boolean} deprecated
                 * @memberof google.protobuf.ServiceOptions
                 * @instance
                 */
                ServiceOptions.prototype.deprecated = false;
    
                /**
                 * ServiceOptions uninterpretedOption.
                 * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
                 * @memberof google.protobuf.ServiceOptions
                 * @instance
                 */
                ServiceOptions.prototype.uninterpretedOption = $util.emptyArray;
    
                /**
                 * ServiceOptions .google.api.defaultHost.
                 * @member {string} .google.api.defaultHost
                 * @memberof google.protobuf.ServiceOptions
                 * @instance
                 */
                ServiceOptions.prototype[".google.api.defaultHost"] = "";
    
                /**
                 * ServiceOptions .google.api.oauthScopes.
                 * @member {string} .google.api.oauthScopes
                 * @memberof google.protobuf.ServiceOptions
                 * @instance
                 */
                ServiceOptions.prototype[".google.api.oauthScopes"] = "";
    
                /**
                 * Creates a new ServiceOptions instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.ServiceOptions
                 * @static
                 * @param {google.protobuf.IServiceOptions=} [properties] Properties to set
                 * @returns {google.protobuf.ServiceOptions} ServiceOptions instance
                 */
                ServiceOptions.create = function create(properties) {
                    return new ServiceOptions(properties);
                };
    
                /**
                 * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.ServiceOptions
                 * @static
                 * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ServiceOptions.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
                        writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);
                    if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                        $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim();
                    if (message.uninterpretedOption != null && message.uninterpretedOption.length)
                        for (var i = 0; i < message.uninterpretedOption.length; ++i)
                            $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
                    if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost"))
                        writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]);
                    if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes"))
                        writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]);
                    return writer;
                };
    
                /**
                 * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.ServiceOptions
                 * @static
                 * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a ServiceOptions message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.ServiceOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.ServiceOptions} ServiceOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ServiceOptions.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 34: {
                                message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());
                                break;
                            }
                        case 33: {
                                message.deprecated = reader.bool();
                                break;
                            }
                        case 999: {
                                if (!(message.uninterpretedOption && message.uninterpretedOption.length))
                                    message.uninterpretedOption = [];
                                message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
                                break;
                            }
                        case 1049: {
                                message[".google.api.defaultHost"] = reader.string();
                                break;
                            }
                        case 1050: {
                                message[".google.api.oauthScopes"] = reader.string();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a ServiceOptions message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.ServiceOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.ServiceOptions} ServiceOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ServiceOptions.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a ServiceOptions message.
                 * @function verify
                 * @memberof google.protobuf.ServiceOptions
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                ServiceOptions.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.features != null && message.hasOwnProperty("features")) {
                        var error = $root.google.protobuf.FeatureSet.verify(message.features);
                        if (error)
                            return "features." + error;
                    }
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        if (typeof message.deprecated !== "boolean")
                            return "deprecated: boolean expected";
                    if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
                        if (!Array.isArray(message.uninterpretedOption))
                            return "uninterpretedOption: array expected";
                        for (var i = 0; i < message.uninterpretedOption.length; ++i) {
                            var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
                            if (error)
                                return "uninterpretedOption." + error;
                        }
                    }
                    if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost"))
                        if (!$util.isString(message[".google.api.defaultHost"]))
                            return ".google.api.defaultHost: string expected";
                    if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes"))
                        if (!$util.isString(message[".google.api.oauthScopes"]))
                            return ".google.api.oauthScopes: string expected";
                    return null;
                };
    
                /**
                 * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.ServiceOptions
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.ServiceOptions} ServiceOptions
                 */
                ServiceOptions.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.ServiceOptions)
                        return object;
                    var message = new $root.google.protobuf.ServiceOptions();
                    if (object.features != null) {
                        if (typeof object.features !== "object")
                            throw TypeError(".google.protobuf.ServiceOptions.features: object expected");
                        message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);
                    }
                    if (object.deprecated != null)
                        message.deprecated = Boolean(object.deprecated);
                    if (object.uninterpretedOption) {
                        if (!Array.isArray(object.uninterpretedOption))
                            throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected");
                        message.uninterpretedOption = [];
                        for (var i = 0; i < object.uninterpretedOption.length; ++i) {
                            if (typeof object.uninterpretedOption[i] !== "object")
                                throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected");
                            message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
                        }
                    }
                    if (object[".google.api.defaultHost"] != null)
                        message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]);
                    if (object[".google.api.oauthScopes"] != null)
                        message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]);
                    return message;
                };
    
                /**
                 * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.ServiceOptions
                 * @static
                 * @param {google.protobuf.ServiceOptions} message ServiceOptions
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                ServiceOptions.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.uninterpretedOption = [];
                    if (options.defaults) {
                        object.deprecated = false;
                        object.features = null;
                        object[".google.api.defaultHost"] = "";
                        object[".google.api.oauthScopes"] = "";
                    }
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        object.deprecated = message.deprecated;
                    if (message.features != null && message.hasOwnProperty("features"))
                        object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);
                    if (message.uninterpretedOption && message.uninterpretedOption.length) {
                        object.uninterpretedOption = [];
                        for (var j = 0; j < message.uninterpretedOption.length; ++j)
                            object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
                    }
                    if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost"))
                        object[".google.api.defaultHost"] = message[".google.api.defaultHost"];
                    if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes"))
                        object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"];
                    return object;
                };
    
                /**
                 * Converts this ServiceOptions to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.ServiceOptions
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                ServiceOptions.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for ServiceOptions
                 * @function getTypeUrl
                 * @memberof google.protobuf.ServiceOptions
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.ServiceOptions";
                };
    
                return ServiceOptions;
            })();
    
            protobuf.MethodOptions = (function() {
    
                /**
                 * Properties of a MethodOptions.
                 * @memberof google.protobuf
                 * @interface IMethodOptions
                 * @property {boolean|null} [deprecated] MethodOptions deprecated
                 * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel
                 * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features
                 * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MethodOptions uninterpretedOption
                 * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http
                 * @property {Array.<string>|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature
                 * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo
                 */
    
                /**
                 * Constructs a new MethodOptions.
                 * @memberof google.protobuf
                 * @classdesc Represents a MethodOptions.
                 * @implements IMethodOptions
                 * @constructor
                 * @param {google.protobuf.IMethodOptions=} [properties] Properties to set
                 */
                function MethodOptions(properties) {
                    this.uninterpretedOption = [];
                    this[".google.api.methodSignature"] = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * MethodOptions deprecated.
                 * @member {boolean} deprecated
                 * @memberof google.protobuf.MethodOptions
                 * @instance
                 */
                MethodOptions.prototype.deprecated = false;
    
                /**
                 * MethodOptions idempotencyLevel.
                 * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel
                 * @memberof google.protobuf.MethodOptions
                 * @instance
                 */
                MethodOptions.prototype.idempotencyLevel = 0;
    
                /**
                 * MethodOptions features.
                 * @member {google.protobuf.IFeatureSet|null|undefined} features
                 * @memberof google.protobuf.MethodOptions
                 * @instance
                 */
                MethodOptions.prototype.features = null;
    
                /**
                 * MethodOptions uninterpretedOption.
                 * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
                 * @memberof google.protobuf.MethodOptions
                 * @instance
                 */
                MethodOptions.prototype.uninterpretedOption = $util.emptyArray;
    
                /**
                 * MethodOptions .google.api.http.
                 * @member {google.api.IHttpRule|null|undefined} .google.api.http
                 * @memberof google.protobuf.MethodOptions
                 * @instance
                 */
                MethodOptions.prototype[".google.api.http"] = null;
    
                /**
                 * MethodOptions .google.api.methodSignature.
                 * @member {Array.<string>} .google.api.methodSignature
                 * @memberof google.protobuf.MethodOptions
                 * @instance
                 */
                MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray;
    
                /**
                 * MethodOptions .google.longrunning.operationInfo.
                 * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo
                 * @memberof google.protobuf.MethodOptions
                 * @instance
                 */
                MethodOptions.prototype[".google.longrunning.operationInfo"] = null;
    
                /**
                 * Creates a new MethodOptions instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.MethodOptions
                 * @static
                 * @param {google.protobuf.IMethodOptions=} [properties] Properties to set
                 * @returns {google.protobuf.MethodOptions} MethodOptions instance
                 */
                MethodOptions.create = function create(properties) {
                    return new MethodOptions(properties);
                };
    
                /**
                 * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.MethodOptions
                 * @static
                 * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                MethodOptions.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
                        writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);
                    if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel"))
                        writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel);
                    if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                        $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim();
                    if (message.uninterpretedOption != null && message.uninterpretedOption.length)
                        for (var i = 0; i < message.uninterpretedOption.length; ++i)
                            $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
                    if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo"))
                        $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim();
                    if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length)
                        for (var i = 0; i < message[".google.api.methodSignature"].length; ++i)
                            writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]);
                    if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http"))
                        $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.MethodOptions
                 * @static
                 * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                MethodOptions.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a MethodOptions message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.MethodOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.MethodOptions} MethodOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                MethodOptions.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 33: {
                                message.deprecated = reader.bool();
                                break;
                            }
                        case 34: {
                                message.idempotencyLevel = reader.int32();
                                break;
                            }
                        case 35: {
                                message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());
                                break;
                            }
                        case 999: {
                                if (!(message.uninterpretedOption && message.uninterpretedOption.length))
                                    message.uninterpretedOption = [];
                                message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
                                break;
                            }
                        case 72295728: {
                                message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32());
                                break;
                            }
                        case 1051: {
                                if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length))
                                    message[".google.api.methodSignature"] = [];
                                message[".google.api.methodSignature"].push(reader.string());
                                break;
                            }
                        case 1049: {
                                message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a MethodOptions message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.MethodOptions
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.MethodOptions} MethodOptions
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                MethodOptions.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a MethodOptions message.
                 * @function verify
                 * @memberof google.protobuf.MethodOptions
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                MethodOptions.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        if (typeof message.deprecated !== "boolean")
                            return "deprecated: boolean expected";
                    if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel"))
                        switch (message.idempotencyLevel) {
                        default:
                            return "idempotencyLevel: enum value expected";
                        case 0:
                        case 1:
                        case 2:
                            break;
                        }
                    if (message.features != null && message.hasOwnProperty("features")) {
                        var error = $root.google.protobuf.FeatureSet.verify(message.features);
                        if (error)
                            return "features." + error;
                    }
                    if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
                        if (!Array.isArray(message.uninterpretedOption))
                            return "uninterpretedOption: array expected";
                        for (var i = 0; i < message.uninterpretedOption.length; ++i) {
                            var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
                            if (error)
                                return "uninterpretedOption." + error;
                        }
                    }
                    if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) {
                        var error = $root.google.api.HttpRule.verify(message[".google.api.http"]);
                        if (error)
                            return ".google.api.http." + error;
                    }
                    if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) {
                        if (!Array.isArray(message[".google.api.methodSignature"]))
                            return ".google.api.methodSignature: array expected";
                        for (var i = 0; i < message[".google.api.methodSignature"].length; ++i)
                            if (!$util.isString(message[".google.api.methodSignature"][i]))
                                return ".google.api.methodSignature: string[] expected";
                    }
                    if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) {
                        var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]);
                        if (error)
                            return ".google.longrunning.operationInfo." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.MethodOptions
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.MethodOptions} MethodOptions
                 */
                MethodOptions.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.MethodOptions)
                        return object;
                    var message = new $root.google.protobuf.MethodOptions();
                    if (object.deprecated != null)
                        message.deprecated = Boolean(object.deprecated);
                    switch (object.idempotencyLevel) {
                    default:
                        if (typeof object.idempotencyLevel === "number") {
                            message.idempotencyLevel = object.idempotencyLevel;
                            break;
                        }
                        break;
                    case "IDEMPOTENCY_UNKNOWN":
                    case 0:
                        message.idempotencyLevel = 0;
                        break;
                    case "NO_SIDE_EFFECTS":
                    case 1:
                        message.idempotencyLevel = 1;
                        break;
                    case "IDEMPOTENT":
                    case 2:
                        message.idempotencyLevel = 2;
                        break;
                    }
                    if (object.features != null) {
                        if (typeof object.features !== "object")
                            throw TypeError(".google.protobuf.MethodOptions.features: object expected");
                        message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);
                    }
                    if (object.uninterpretedOption) {
                        if (!Array.isArray(object.uninterpretedOption))
                            throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected");
                        message.uninterpretedOption = [];
                        for (var i = 0; i < object.uninterpretedOption.length; ++i) {
                            if (typeof object.uninterpretedOption[i] !== "object")
                                throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected");
                            message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
                        }
                    }
                    if (object[".google.api.http"] != null) {
                        if (typeof object[".google.api.http"] !== "object")
                            throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected");
                        message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]);
                    }
                    if (object[".google.api.methodSignature"]) {
                        if (!Array.isArray(object[".google.api.methodSignature"]))
                            throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected");
                        message[".google.api.methodSignature"] = [];
                        for (var i = 0; i < object[".google.api.methodSignature"].length; ++i)
                            message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]);
                    }
                    if (object[".google.longrunning.operationInfo"] != null) {
                        if (typeof object[".google.longrunning.operationInfo"] !== "object")
                            throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected");
                        message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a MethodOptions message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.MethodOptions
                 * @static
                 * @param {google.protobuf.MethodOptions} message MethodOptions
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                MethodOptions.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults) {
                        object.uninterpretedOption = [];
                        object[".google.api.methodSignature"] = [];
                    }
                    if (options.defaults) {
                        object.deprecated = false;
                        object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0;
                        object.features = null;
                        object[".google.longrunning.operationInfo"] = null;
                        object[".google.api.http"] = null;
                    }
                    if (message.deprecated != null && message.hasOwnProperty("deprecated"))
                        object.deprecated = message.deprecated;
                    if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel"))
                        object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel;
                    if (message.features != null && message.hasOwnProperty("features"))
                        object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);
                    if (message.uninterpretedOption && message.uninterpretedOption.length) {
                        object.uninterpretedOption = [];
                        for (var j = 0; j < message.uninterpretedOption.length; ++j)
                            object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
                    }
                    if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo"))
                        object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options);
                    if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) {
                        object[".google.api.methodSignature"] = [];
                        for (var j = 0; j < message[".google.api.methodSignature"].length; ++j)
                            object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j];
                    }
                    if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http"))
                        object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options);
                    return object;
                };
    
                /**
                 * Converts this MethodOptions to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.MethodOptions
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                MethodOptions.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for MethodOptions
                 * @function getTypeUrl
                 * @memberof google.protobuf.MethodOptions
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.MethodOptions";
                };
    
                /**
                 * IdempotencyLevel enum.
                 * @name google.protobuf.MethodOptions.IdempotencyLevel
                 * @enum {number}
                 * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value
                 * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value
                 * @property {number} IDEMPOTENT=2 IDEMPOTENT value
                 */
                MethodOptions.IdempotencyLevel = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0;
                    values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1;
                    values[valuesById[2] = "IDEMPOTENT"] = 2;
                    return values;
                })();
    
                return MethodOptions;
            })();
    
            protobuf.UninterpretedOption = (function() {
    
                /**
                 * Properties of an UninterpretedOption.
                 * @memberof google.protobuf
                 * @interface IUninterpretedOption
                 * @property {Array.<google.protobuf.UninterpretedOption.INamePart>|null} [name] UninterpretedOption name
                 * @property {string|null} [identifierValue] UninterpretedOption identifierValue
                 * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue
                 * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue
                 * @property {number|null} [doubleValue] UninterpretedOption doubleValue
                 * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue
                 * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue
                 */
    
                /**
                 * Constructs a new UninterpretedOption.
                 * @memberof google.protobuf
                 * @classdesc Represents an UninterpretedOption.
                 * @implements IUninterpretedOption
                 * @constructor
                 * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
                 */
                function UninterpretedOption(properties) {
                    this.name = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * UninterpretedOption name.
                 * @member {Array.<google.protobuf.UninterpretedOption.INamePart>} name
                 * @memberof google.protobuf.UninterpretedOption
                 * @instance
                 */
                UninterpretedOption.prototype.name = $util.emptyArray;
    
                /**
                 * UninterpretedOption identifierValue.
                 * @member {string} identifierValue
                 * @memberof google.protobuf.UninterpretedOption
                 * @instance
                 */
                UninterpretedOption.prototype.identifierValue = "";
    
                /**
                 * UninterpretedOption positiveIntValue.
                 * @member {number|Long} positiveIntValue
                 * @memberof google.protobuf.UninterpretedOption
                 * @instance
                 */
                UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
    
                /**
                 * UninterpretedOption negativeIntValue.
                 * @member {number|Long} negativeIntValue
                 * @memberof google.protobuf.UninterpretedOption
                 * @instance
                 */
                UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
    
                /**
                 * UninterpretedOption doubleValue.
                 * @member {number} doubleValue
                 * @memberof google.protobuf.UninterpretedOption
                 * @instance
                 */
                UninterpretedOption.prototype.doubleValue = 0;
    
                /**
                 * UninterpretedOption stringValue.
                 * @member {Uint8Array} stringValue
                 * @memberof google.protobuf.UninterpretedOption
                 * @instance
                 */
                UninterpretedOption.prototype.stringValue = $util.newBuffer([]);
    
                /**
                 * UninterpretedOption aggregateValue.
                 * @member {string} aggregateValue
                 * @memberof google.protobuf.UninterpretedOption
                 * @instance
                 */
                UninterpretedOption.prototype.aggregateValue = "";
    
                /**
                 * Creates a new UninterpretedOption instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.UninterpretedOption
                 * @static
                 * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
                 * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance
                 */
                UninterpretedOption.create = function create(properties) {
                    return new UninterpretedOption(properties);
                };
    
                /**
                 * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.UninterpretedOption
                 * @static
                 * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                UninterpretedOption.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && message.name.length)
                        for (var i = 0; i < message.name.length; ++i)
                            $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                    if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue"))
                        writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue);
                    if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue"))
                        writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue);
                    if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue"))
                        writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue);
                    if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue"))
                        writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue);
                    if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue"))
                        writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue);
                    if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue"))
                        writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue);
                    return writer;
                };
    
                /**
                 * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.UninterpretedOption
                 * @static
                 * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an UninterpretedOption message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.UninterpretedOption
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                UninterpretedOption.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 2: {
                                if (!(message.name && message.name.length))
                                    message.name = [];
                                message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32()));
                                break;
                            }
                        case 3: {
                                message.identifierValue = reader.string();
                                break;
                            }
                        case 4: {
                                message.positiveIntValue = reader.uint64();
                                break;
                            }
                        case 5: {
                                message.negativeIntValue = reader.int64();
                                break;
                            }
                        case 6: {
                                message.doubleValue = reader.double();
                                break;
                            }
                        case 7: {
                                message.stringValue = reader.bytes();
                                break;
                            }
                        case 8: {
                                message.aggregateValue = reader.string();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.UninterpretedOption
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                UninterpretedOption.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an UninterpretedOption message.
                 * @function verify
                 * @memberof google.protobuf.UninterpretedOption
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                UninterpretedOption.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name")) {
                        if (!Array.isArray(message.name))
                            return "name: array expected";
                        for (var i = 0; i < message.name.length; ++i) {
                            var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]);
                            if (error)
                                return "name." + error;
                        }
                    }
                    if (message.identifierValue != null && message.hasOwnProperty("identifierValue"))
                        if (!$util.isString(message.identifierValue))
                            return "identifierValue: string expected";
                    if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue"))
                        if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high)))
                            return "positiveIntValue: integer|Long expected";
                    if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue"))
                        if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high)))
                            return "negativeIntValue: integer|Long expected";
                    if (message.doubleValue != null && message.hasOwnProperty("doubleValue"))
                        if (typeof message.doubleValue !== "number")
                            return "doubleValue: number expected";
                    if (message.stringValue != null && message.hasOwnProperty("stringValue"))
                        if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue)))
                            return "stringValue: buffer expected";
                    if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue"))
                        if (!$util.isString(message.aggregateValue))
                            return "aggregateValue: string expected";
                    return null;
                };
    
                /**
                 * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.UninterpretedOption
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
                 */
                UninterpretedOption.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.UninterpretedOption)
                        return object;
                    var message = new $root.google.protobuf.UninterpretedOption();
                    if (object.name) {
                        if (!Array.isArray(object.name))
                            throw TypeError(".google.protobuf.UninterpretedOption.name: array expected");
                        message.name = [];
                        for (var i = 0; i < object.name.length; ++i) {
                            if (typeof object.name[i] !== "object")
                                throw TypeError(".google.protobuf.UninterpretedOption.name: object expected");
                            message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]);
                        }
                    }
                    if (object.identifierValue != null)
                        message.identifierValue = String(object.identifierValue);
                    if (object.positiveIntValue != null)
                        if ($util.Long)
                            (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true;
                        else if (typeof object.positiveIntValue === "string")
                            message.positiveIntValue = parseInt(object.positiveIntValue, 10);
                        else if (typeof object.positiveIntValue === "number")
                            message.positiveIntValue = object.positiveIntValue;
                        else if (typeof object.positiveIntValue === "object")
                            message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true);
                    if (object.negativeIntValue != null)
                        if ($util.Long)
                            (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false;
                        else if (typeof object.negativeIntValue === "string")
                            message.negativeIntValue = parseInt(object.negativeIntValue, 10);
                        else if (typeof object.negativeIntValue === "number")
                            message.negativeIntValue = object.negativeIntValue;
                        else if (typeof object.negativeIntValue === "object")
                            message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber();
                    if (object.doubleValue != null)
                        message.doubleValue = Number(object.doubleValue);
                    if (object.stringValue != null)
                        if (typeof object.stringValue === "string")
                            $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0);
                        else if (object.stringValue.length >= 0)
                            message.stringValue = object.stringValue;
                    if (object.aggregateValue != null)
                        message.aggregateValue = String(object.aggregateValue);
                    return message;
                };
    
                /**
                 * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.UninterpretedOption
                 * @static
                 * @param {google.protobuf.UninterpretedOption} message UninterpretedOption
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                UninterpretedOption.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.name = [];
                    if (options.defaults) {
                        object.identifierValue = "";
                        if ($util.Long) {
                            var long = new $util.Long(0, 0, true);
                            object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                        } else
                            object.positiveIntValue = options.longs === String ? "0" : 0;
                        if ($util.Long) {
                            var long = new $util.Long(0, 0, false);
                            object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                        } else
                            object.negativeIntValue = options.longs === String ? "0" : 0;
                        object.doubleValue = 0;
                        if (options.bytes === String)
                            object.stringValue = "";
                        else {
                            object.stringValue = [];
                            if (options.bytes !== Array)
                                object.stringValue = $util.newBuffer(object.stringValue);
                        }
                        object.aggregateValue = "";
                    }
                    if (message.name && message.name.length) {
                        object.name = [];
                        for (var j = 0; j < message.name.length; ++j)
                            object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options);
                    }
                    if (message.identifierValue != null && message.hasOwnProperty("identifierValue"))
                        object.identifierValue = message.identifierValue;
                    if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue"))
                        if (typeof message.positiveIntValue === "number")
                            object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue;
                        else
                            object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue;
                    if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue"))
                        if (typeof message.negativeIntValue === "number")
                            object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue;
                        else
                            object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue;
                    if (message.doubleValue != null && message.hasOwnProperty("doubleValue"))
                        object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue;
                    if (message.stringValue != null && message.hasOwnProperty("stringValue"))
                        object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue;
                    if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue"))
                        object.aggregateValue = message.aggregateValue;
                    return object;
                };
    
                /**
                 * Converts this UninterpretedOption to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.UninterpretedOption
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                UninterpretedOption.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for UninterpretedOption
                 * @function getTypeUrl
                 * @memberof google.protobuf.UninterpretedOption
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.UninterpretedOption";
                };
    
                UninterpretedOption.NamePart = (function() {
    
                    /**
                     * Properties of a NamePart.
                     * @memberof google.protobuf.UninterpretedOption
                     * @interface INamePart
                     * @property {string} namePart NamePart namePart
                     * @property {boolean} isExtension NamePart isExtension
                     */
    
                    /**
                     * Constructs a new NamePart.
                     * @memberof google.protobuf.UninterpretedOption
                     * @classdesc Represents a NamePart.
                     * @implements INamePart
                     * @constructor
                     * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
                     */
                    function NamePart(properties) {
                        if (properties)
                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                if (properties[keys[i]] != null)
                                    this[keys[i]] = properties[keys[i]];
                    }
    
                    /**
                     * NamePart namePart.
                     * @member {string} namePart
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @instance
                     */
                    NamePart.prototype.namePart = "";
    
                    /**
                     * NamePart isExtension.
                     * @member {boolean} isExtension
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @instance
                     */
                    NamePart.prototype.isExtension = false;
    
                    /**
                     * Creates a new NamePart instance using the specified properties.
                     * @function create
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @static
                     * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
                     * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance
                     */
                    NamePart.create = function create(properties) {
                        return new NamePart(properties);
                    };
    
                    /**
                     * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
                     * @function encode
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @static
                     * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    NamePart.encode = function encode(message, writer) {
                        if (!writer)
                            writer = $Writer.create();
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart);
                        writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension);
                        return writer;
                    };
    
                    /**
                     * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
                     * @function encodeDelimited
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @static
                     * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    NamePart.encodeDelimited = function encodeDelimited(message, writer) {
                        return this.encode(message, writer).ldelim();
                    };
    
                    /**
                     * Decodes a NamePart message from the specified reader or buffer.
                     * @function decode
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    NamePart.decode = function decode(reader, length) {
                        if (!(reader instanceof $Reader))
                            reader = $Reader.create(reader);
                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart();
                        while (reader.pos < end) {
                            var tag = reader.uint32();
                            switch (tag >>> 3) {
                            case 1: {
                                    message.namePart = reader.string();
                                    break;
                                }
                            case 2: {
                                    message.isExtension = reader.bool();
                                    break;
                                }
                            default:
                                reader.skipType(tag & 7);
                                break;
                            }
                        }
                        if (!message.hasOwnProperty("namePart"))
                            throw $util.ProtocolError("missing required 'namePart'", { instance: message });
                        if (!message.hasOwnProperty("isExtension"))
                            throw $util.ProtocolError("missing required 'isExtension'", { instance: message });
                        return message;
                    };
    
                    /**
                     * Decodes a NamePart message from the specified reader or buffer, length delimited.
                     * @function decodeDelimited
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    NamePart.decodeDelimited = function decodeDelimited(reader) {
                        if (!(reader instanceof $Reader))
                            reader = new $Reader(reader);
                        return this.decode(reader, reader.uint32());
                    };
    
                    /**
                     * Verifies a NamePart message.
                     * @function verify
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @static
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {string|null} `null` if valid, otherwise the reason why it is not
                     */
                    NamePart.verify = function verify(message) {
                        if (typeof message !== "object" || message === null)
                            return "object expected";
                        if (!$util.isString(message.namePart))
                            return "namePart: string expected";
                        if (typeof message.isExtension !== "boolean")
                            return "isExtension: boolean expected";
                        return null;
                    };
    
                    /**
                     * Creates a NamePart message from a plain object. Also converts values to their respective internal types.
                     * @function fromObject
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @static
                     * @param {Object.<string,*>} object Plain object
                     * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
                     */
                    NamePart.fromObject = function fromObject(object) {
                        if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart)
                            return object;
                        var message = new $root.google.protobuf.UninterpretedOption.NamePart();
                        if (object.namePart != null)
                            message.namePart = String(object.namePart);
                        if (object.isExtension != null)
                            message.isExtension = Boolean(object.isExtension);
                        return message;
                    };
    
                    /**
                     * Creates a plain object from a NamePart message. Also converts values to other types if specified.
                     * @function toObject
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @static
                     * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart
                     * @param {$protobuf.IConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    NamePart.toObject = function toObject(message, options) {
                        if (!options)
                            options = {};
                        var object = {};
                        if (options.defaults) {
                            object.namePart = "";
                            object.isExtension = false;
                        }
                        if (message.namePart != null && message.hasOwnProperty("namePart"))
                            object.namePart = message.namePart;
                        if (message.isExtension != null && message.hasOwnProperty("isExtension"))
                            object.isExtension = message.isExtension;
                        return object;
                    };
    
                    /**
                     * Converts this NamePart to JSON.
                     * @function toJSON
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @instance
                     * @returns {Object.<string,*>} JSON object
                     */
                    NamePart.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };
    
                    /**
                     * Gets the default type url for NamePart
                     * @function getTypeUrl
                     * @memberof google.protobuf.UninterpretedOption.NamePart
                     * @static
                     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                     * @returns {string} The default type url
                     */
                    NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart";
                    };
    
                    return NamePart;
                })();
    
                return UninterpretedOption;
            })();
    
            protobuf.FeatureSet = (function() {
    
                /**
                 * Properties of a FeatureSet.
                 * @memberof google.protobuf
                 * @interface IFeatureSet
                 * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence
                 * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType
                 * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding
                 * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation
                 * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding
                 * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat
                 */
    
                /**
                 * Constructs a new FeatureSet.
                 * @memberof google.protobuf
                 * @classdesc Represents a FeatureSet.
                 * @implements IFeatureSet
                 * @constructor
                 * @param {google.protobuf.IFeatureSet=} [properties] Properties to set
                 */
                function FeatureSet(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * FeatureSet fieldPresence.
                 * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence
                 * @memberof google.protobuf.FeatureSet
                 * @instance
                 */
                FeatureSet.prototype.fieldPresence = 0;
    
                /**
                 * FeatureSet enumType.
                 * @member {google.protobuf.FeatureSet.EnumType} enumType
                 * @memberof google.protobuf.FeatureSet
                 * @instance
                 */
                FeatureSet.prototype.enumType = 0;
    
                /**
                 * FeatureSet repeatedFieldEncoding.
                 * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding
                 * @memberof google.protobuf.FeatureSet
                 * @instance
                 */
                FeatureSet.prototype.repeatedFieldEncoding = 0;
    
                /**
                 * FeatureSet utf8Validation.
                 * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation
                 * @memberof google.protobuf.FeatureSet
                 * @instance
                 */
                FeatureSet.prototype.utf8Validation = 0;
    
                /**
                 * FeatureSet messageEncoding.
                 * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding
                 * @memberof google.protobuf.FeatureSet
                 * @instance
                 */
                FeatureSet.prototype.messageEncoding = 0;
    
                /**
                 * FeatureSet jsonFormat.
                 * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat
                 * @memberof google.protobuf.FeatureSet
                 * @instance
                 */
                FeatureSet.prototype.jsonFormat = 0;
    
                /**
                 * Creates a new FeatureSet instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.FeatureSet
                 * @static
                 * @param {google.protobuf.IFeatureSet=} [properties] Properties to set
                 * @returns {google.protobuf.FeatureSet} FeatureSet instance
                 */
                FeatureSet.create = function create(properties) {
                    return new FeatureSet(properties);
                };
    
                /**
                 * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.FeatureSet
                 * @static
                 * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FeatureSet.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence"))
                        writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence);
                    if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType"))
                        writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType);
                    if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding"))
                        writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding);
                    if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation"))
                        writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation);
                    if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding"))
                        writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding);
                    if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat"))
                        writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat);
                    return writer;
                };
    
                /**
                 * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.FeatureSet
                 * @static
                 * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FeatureSet.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a FeatureSet message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.FeatureSet
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.FeatureSet} FeatureSet
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FeatureSet.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.fieldPresence = reader.int32();
                                break;
                            }
                        case 2: {
                                message.enumType = reader.int32();
                                break;
                            }
                        case 3: {
                                message.repeatedFieldEncoding = reader.int32();
                                break;
                            }
                        case 4: {
                                message.utf8Validation = reader.int32();
                                break;
                            }
                        case 5: {
                                message.messageEncoding = reader.int32();
                                break;
                            }
                        case 6: {
                                message.jsonFormat = reader.int32();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a FeatureSet message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.FeatureSet
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.FeatureSet} FeatureSet
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FeatureSet.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a FeatureSet message.
                 * @function verify
                 * @memberof google.protobuf.FeatureSet
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                FeatureSet.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence"))
                        switch (message.fieldPresence) {
                        default:
                            return "fieldPresence: enum value expected";
                        case 0:
                        case 1:
                        case 2:
                        case 3:
                            break;
                        }
                    if (message.enumType != null && message.hasOwnProperty("enumType"))
                        switch (message.enumType) {
                        default:
                            return "enumType: enum value expected";
                        case 0:
                        case 1:
                        case 2:
                            break;
                        }
                    if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding"))
                        switch (message.repeatedFieldEncoding) {
                        default:
                            return "repeatedFieldEncoding: enum value expected";
                        case 0:
                        case 1:
                        case 2:
                            break;
                        }
                    if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation"))
                        switch (message.utf8Validation) {
                        default:
                            return "utf8Validation: enum value expected";
                        case 0:
                        case 2:
                        case 3:
                            break;
                        }
                    if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding"))
                        switch (message.messageEncoding) {
                        default:
                            return "messageEncoding: enum value expected";
                        case 0:
                        case 1:
                        case 2:
                            break;
                        }
                    if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat"))
                        switch (message.jsonFormat) {
                        default:
                            return "jsonFormat: enum value expected";
                        case 0:
                        case 1:
                        case 2:
                            break;
                        }
                    return null;
                };
    
                /**
                 * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.FeatureSet
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.FeatureSet} FeatureSet
                 */
                FeatureSet.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.FeatureSet)
                        return object;
                    var message = new $root.google.protobuf.FeatureSet();
                    switch (object.fieldPresence) {
                    default:
                        if (typeof object.fieldPresence === "number") {
                            message.fieldPresence = object.fieldPresence;
                            break;
                        }
                        break;
                    case "FIELD_PRESENCE_UNKNOWN":
                    case 0:
                        message.fieldPresence = 0;
                        break;
                    case "EXPLICIT":
                    case 1:
                        message.fieldPresence = 1;
                        break;
                    case "IMPLICIT":
                    case 2:
                        message.fieldPresence = 2;
                        break;
                    case "LEGACY_REQUIRED":
                    case 3:
                        message.fieldPresence = 3;
                        break;
                    }
                    switch (object.enumType) {
                    default:
                        if (typeof object.enumType === "number") {
                            message.enumType = object.enumType;
                            break;
                        }
                        break;
                    case "ENUM_TYPE_UNKNOWN":
                    case 0:
                        message.enumType = 0;
                        break;
                    case "OPEN":
                    case 1:
                        message.enumType = 1;
                        break;
                    case "CLOSED":
                    case 2:
                        message.enumType = 2;
                        break;
                    }
                    switch (object.repeatedFieldEncoding) {
                    default:
                        if (typeof object.repeatedFieldEncoding === "number") {
                            message.repeatedFieldEncoding = object.repeatedFieldEncoding;
                            break;
                        }
                        break;
                    case "REPEATED_FIELD_ENCODING_UNKNOWN":
                    case 0:
                        message.repeatedFieldEncoding = 0;
                        break;
                    case "PACKED":
                    case 1:
                        message.repeatedFieldEncoding = 1;
                        break;
                    case "EXPANDED":
                    case 2:
                        message.repeatedFieldEncoding = 2;
                        break;
                    }
                    switch (object.utf8Validation) {
                    default:
                        if (typeof object.utf8Validation === "number") {
                            message.utf8Validation = object.utf8Validation;
                            break;
                        }
                        break;
                    case "UTF8_VALIDATION_UNKNOWN":
                    case 0:
                        message.utf8Validation = 0;
                        break;
                    case "VERIFY":
                    case 2:
                        message.utf8Validation = 2;
                        break;
                    case "NONE":
                    case 3:
                        message.utf8Validation = 3;
                        break;
                    }
                    switch (object.messageEncoding) {
                    default:
                        if (typeof object.messageEncoding === "number") {
                            message.messageEncoding = object.messageEncoding;
                            break;
                        }
                        break;
                    case "MESSAGE_ENCODING_UNKNOWN":
                    case 0:
                        message.messageEncoding = 0;
                        break;
                    case "LENGTH_PREFIXED":
                    case 1:
                        message.messageEncoding = 1;
                        break;
                    case "DELIMITED":
                    case 2:
                        message.messageEncoding = 2;
                        break;
                    }
                    switch (object.jsonFormat) {
                    default:
                        if (typeof object.jsonFormat === "number") {
                            message.jsonFormat = object.jsonFormat;
                            break;
                        }
                        break;
                    case "JSON_FORMAT_UNKNOWN":
                    case 0:
                        message.jsonFormat = 0;
                        break;
                    case "ALLOW":
                    case 1:
                        message.jsonFormat = 1;
                        break;
                    case "LEGACY_BEST_EFFORT":
                    case 2:
                        message.jsonFormat = 2;
                        break;
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a FeatureSet message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.FeatureSet
                 * @static
                 * @param {google.protobuf.FeatureSet} message FeatureSet
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                FeatureSet.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0;
                        object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0;
                        object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0;
                        object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0;
                        object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0;
                        object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0;
                    }
                    if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence"))
                        object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence;
                    if (message.enumType != null && message.hasOwnProperty("enumType"))
                        object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType;
                    if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding"))
                        object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding;
                    if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation"))
                        object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation;
                    if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding"))
                        object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding;
                    if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat"))
                        object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat;
                    return object;
                };
    
                /**
                 * Converts this FeatureSet to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.FeatureSet
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                FeatureSet.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for FeatureSet
                 * @function getTypeUrl
                 * @memberof google.protobuf.FeatureSet
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.FeatureSet";
                };
    
                /**
                 * FieldPresence enum.
                 * @name google.protobuf.FeatureSet.FieldPresence
                 * @enum {number}
                 * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value
                 * @property {number} EXPLICIT=1 EXPLICIT value
                 * @property {number} IMPLICIT=2 IMPLICIT value
                 * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value
                 */
                FeatureSet.FieldPresence = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0;
                    values[valuesById[1] = "EXPLICIT"] = 1;
                    values[valuesById[2] = "IMPLICIT"] = 2;
                    values[valuesById[3] = "LEGACY_REQUIRED"] = 3;
                    return values;
                })();
    
                /**
                 * EnumType enum.
                 * @name google.protobuf.FeatureSet.EnumType
                 * @enum {number}
                 * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value
                 * @property {number} OPEN=1 OPEN value
                 * @property {number} CLOSED=2 CLOSED value
                 */
                FeatureSet.EnumType = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0;
                    values[valuesById[1] = "OPEN"] = 1;
                    values[valuesById[2] = "CLOSED"] = 2;
                    return values;
                })();
    
                /**
                 * RepeatedFieldEncoding enum.
                 * @name google.protobuf.FeatureSet.RepeatedFieldEncoding
                 * @enum {number}
                 * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value
                 * @property {number} PACKED=1 PACKED value
                 * @property {number} EXPANDED=2 EXPANDED value
                 */
                FeatureSet.RepeatedFieldEncoding = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0;
                    values[valuesById[1] = "PACKED"] = 1;
                    values[valuesById[2] = "EXPANDED"] = 2;
                    return values;
                })();
    
                /**
                 * Utf8Validation enum.
                 * @name google.protobuf.FeatureSet.Utf8Validation
                 * @enum {number}
                 * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value
                 * @property {number} VERIFY=2 VERIFY value
                 * @property {number} NONE=3 NONE value
                 */
                FeatureSet.Utf8Validation = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0;
                    values[valuesById[2] = "VERIFY"] = 2;
                    values[valuesById[3] = "NONE"] = 3;
                    return values;
                })();
    
                /**
                 * MessageEncoding enum.
                 * @name google.protobuf.FeatureSet.MessageEncoding
                 * @enum {number}
                 * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value
                 * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value
                 * @property {number} DELIMITED=2 DELIMITED value
                 */
                FeatureSet.MessageEncoding = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0;
                    values[valuesById[1] = "LENGTH_PREFIXED"] = 1;
                    values[valuesById[2] = "DELIMITED"] = 2;
                    return values;
                })();
    
                /**
                 * JsonFormat enum.
                 * @name google.protobuf.FeatureSet.JsonFormat
                 * @enum {number}
                 * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value
                 * @property {number} ALLOW=1 ALLOW value
                 * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value
                 */
                FeatureSet.JsonFormat = (function() {
                    var valuesById = {}, values = Object.create(valuesById);
                    values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0;
                    values[valuesById[1] = "ALLOW"] = 1;
                    values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2;
                    return values;
                })();
    
                return FeatureSet;
            })();
    
            protobuf.FeatureSetDefaults = (function() {
    
                /**
                 * Properties of a FeatureSetDefaults.
                 * @memberof google.protobuf
                 * @interface IFeatureSetDefaults
                 * @property {Array.<google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault>|null} [defaults] FeatureSetDefaults defaults
                 * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition
                 * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition
                 */
    
                /**
                 * Constructs a new FeatureSetDefaults.
                 * @memberof google.protobuf
                 * @classdesc Represents a FeatureSetDefaults.
                 * @implements IFeatureSetDefaults
                 * @constructor
                 * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set
                 */
                function FeatureSetDefaults(properties) {
                    this.defaults = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * FeatureSetDefaults defaults.
                 * @member {Array.<google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault>} defaults
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @instance
                 */
                FeatureSetDefaults.prototype.defaults = $util.emptyArray;
    
                /**
                 * FeatureSetDefaults minimumEdition.
                 * @member {google.protobuf.Edition} minimumEdition
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @instance
                 */
                FeatureSetDefaults.prototype.minimumEdition = 0;
    
                /**
                 * FeatureSetDefaults maximumEdition.
                 * @member {google.protobuf.Edition} maximumEdition
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @instance
                 */
                FeatureSetDefaults.prototype.maximumEdition = 0;
    
                /**
                 * Creates a new FeatureSetDefaults instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @static
                 * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set
                 * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance
                 */
                FeatureSetDefaults.create = function create(properties) {
                    return new FeatureSetDefaults(properties);
                };
    
                /**
                 * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @static
                 * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FeatureSetDefaults.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.defaults != null && message.defaults.length)
                        for (var i = 0; i < message.defaults.length; ++i)
                            $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition"))
                        writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition);
                    if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition"))
                        writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition);
                    return writer;
                };
    
                /**
                 * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @static
                 * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a FeatureSetDefaults message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FeatureSetDefaults.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                if (!(message.defaults && message.defaults.length))
                                    message.defaults = [];
                                message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32()));
                                break;
                            }
                        case 4: {
                                message.minimumEdition = reader.int32();
                                break;
                            }
                        case 5: {
                                message.maximumEdition = reader.int32();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a FeatureSetDefaults message.
                 * @function verify
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                FeatureSetDefaults.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.defaults != null && message.hasOwnProperty("defaults")) {
                        if (!Array.isArray(message.defaults))
                            return "defaults: array expected";
                        for (var i = 0; i < message.defaults.length; ++i) {
                            var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]);
                            if (error)
                                return "defaults." + error;
                        }
                    }
                    if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition"))
                        switch (message.minimumEdition) {
                        default:
                            return "minimumEdition: enum value expected";
                        case 0:
                        case 998:
                        case 999:
                        case 1000:
                        case 1001:
                        case 1:
                        case 2:
                        case 99997:
                        case 99998:
                        case 99999:
                        case 2147483647:
                            break;
                        }
                    if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition"))
                        switch (message.maximumEdition) {
                        default:
                            return "maximumEdition: enum value expected";
                        case 0:
                        case 998:
                        case 999:
                        case 1000:
                        case 1001:
                        case 1:
                        case 2:
                        case 99997:
                        case 99998:
                        case 99999:
                        case 2147483647:
                            break;
                        }
                    return null;
                };
    
                /**
                 * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults
                 */
                FeatureSetDefaults.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.FeatureSetDefaults)
                        return object;
                    var message = new $root.google.protobuf.FeatureSetDefaults();
                    if (object.defaults) {
                        if (!Array.isArray(object.defaults))
                            throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected");
                        message.defaults = [];
                        for (var i = 0; i < object.defaults.length; ++i) {
                            if (typeof object.defaults[i] !== "object")
                                throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected");
                            message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]);
                        }
                    }
                    switch (object.minimumEdition) {
                    default:
                        if (typeof object.minimumEdition === "number") {
                            message.minimumEdition = object.minimumEdition;
                            break;
                        }
                        break;
                    case "EDITION_UNKNOWN":
                    case 0:
                        message.minimumEdition = 0;
                        break;
                    case "EDITION_PROTO2":
                    case 998:
                        message.minimumEdition = 998;
                        break;
                    case "EDITION_PROTO3":
                    case 999:
                        message.minimumEdition = 999;
                        break;
                    case "EDITION_2023":
                    case 1000:
                        message.minimumEdition = 1000;
                        break;
                    case "EDITION_2024":
                    case 1001:
                        message.minimumEdition = 1001;
                        break;
                    case "EDITION_1_TEST_ONLY":
                    case 1:
                        message.minimumEdition = 1;
                        break;
                    case "EDITION_2_TEST_ONLY":
                    case 2:
                        message.minimumEdition = 2;
                        break;
                    case "EDITION_99997_TEST_ONLY":
                    case 99997:
                        message.minimumEdition = 99997;
                        break;
                    case "EDITION_99998_TEST_ONLY":
                    case 99998:
                        message.minimumEdition = 99998;
                        break;
                    case "EDITION_99999_TEST_ONLY":
                    case 99999:
                        message.minimumEdition = 99999;
                        break;
                    case "EDITION_MAX":
                    case 2147483647:
                        message.minimumEdition = 2147483647;
                        break;
                    }
                    switch (object.maximumEdition) {
                    default:
                        if (typeof object.maximumEdition === "number") {
                            message.maximumEdition = object.maximumEdition;
                            break;
                        }
                        break;
                    case "EDITION_UNKNOWN":
                    case 0:
                        message.maximumEdition = 0;
                        break;
                    case "EDITION_PROTO2":
                    case 998:
                        message.maximumEdition = 998;
                        break;
                    case "EDITION_PROTO3":
                    case 999:
                        message.maximumEdition = 999;
                        break;
                    case "EDITION_2023":
                    case 1000:
                        message.maximumEdition = 1000;
                        break;
                    case "EDITION_2024":
                    case 1001:
                        message.maximumEdition = 1001;
                        break;
                    case "EDITION_1_TEST_ONLY":
                    case 1:
                        message.maximumEdition = 1;
                        break;
                    case "EDITION_2_TEST_ONLY":
                    case 2:
                        message.maximumEdition = 2;
                        break;
                    case "EDITION_99997_TEST_ONLY":
                    case 99997:
                        message.maximumEdition = 99997;
                        break;
                    case "EDITION_99998_TEST_ONLY":
                    case 99998:
                        message.maximumEdition = 99998;
                        break;
                    case "EDITION_99999_TEST_ONLY":
                    case 99999:
                        message.maximumEdition = 99999;
                        break;
                    case "EDITION_MAX":
                    case 2147483647:
                        message.maximumEdition = 2147483647;
                        break;
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @static
                 * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                FeatureSetDefaults.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.defaults = [];
                    if (options.defaults) {
                        object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0;
                        object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0;
                    }
                    if (message.defaults && message.defaults.length) {
                        object.defaults = [];
                        for (var j = 0; j < message.defaults.length; ++j)
                            object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options);
                    }
                    if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition"))
                        object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition;
                    if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition"))
                        object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition;
                    return object;
                };
    
                /**
                 * Converts this FeatureSetDefaults to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                FeatureSetDefaults.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for FeatureSetDefaults
                 * @function getTypeUrl
                 * @memberof google.protobuf.FeatureSetDefaults
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults";
                };
    
                FeatureSetDefaults.FeatureSetEditionDefault = (function() {
    
                    /**
                     * Properties of a FeatureSetEditionDefault.
                     * @memberof google.protobuf.FeatureSetDefaults
                     * @interface IFeatureSetEditionDefault
                     * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition
                     * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features
                     */
    
                    /**
                     * Constructs a new FeatureSetEditionDefault.
                     * @memberof google.protobuf.FeatureSetDefaults
                     * @classdesc Represents a FeatureSetEditionDefault.
                     * @implements IFeatureSetEditionDefault
                     * @constructor
                     * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set
                     */
                    function FeatureSetEditionDefault(properties) {
                        if (properties)
                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                if (properties[keys[i]] != null)
                                    this[keys[i]] = properties[keys[i]];
                    }
    
                    /**
                     * FeatureSetEditionDefault edition.
                     * @member {google.protobuf.Edition} edition
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @instance
                     */
                    FeatureSetEditionDefault.prototype.edition = 0;
    
                    /**
                     * FeatureSetEditionDefault features.
                     * @member {google.protobuf.IFeatureSet|null|undefined} features
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @instance
                     */
                    FeatureSetEditionDefault.prototype.features = null;
    
                    /**
                     * Creates a new FeatureSetEditionDefault instance using the specified properties.
                     * @function create
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @static
                     * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set
                     * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance
                     */
                    FeatureSetEditionDefault.create = function create(properties) {
                        return new FeatureSetEditionDefault(properties);
                    };
    
                    /**
                     * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages.
                     * @function encode
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @static
                     * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    FeatureSetEditionDefault.encode = function encode(message, writer) {
                        if (!writer)
                            writer = $Writer.create();
                        if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                            $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                        if (message.edition != null && Object.hasOwnProperty.call(message, "edition"))
                            writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition);
                        return writer;
                    };
    
                    /**
                     * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages.
                     * @function encodeDelimited
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @static
                     * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) {
                        return this.encode(message, writer).ldelim();
                    };
    
                    /**
                     * Decodes a FeatureSetEditionDefault message from the specified reader or buffer.
                     * @function decode
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    FeatureSetEditionDefault.decode = function decode(reader, length) {
                        if (!(reader instanceof $Reader))
                            reader = $Reader.create(reader);
                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault();
                        while (reader.pos < end) {
                            var tag = reader.uint32();
                            switch (tag >>> 3) {
                            case 3: {
                                    message.edition = reader.int32();
                                    break;
                                }
                            case 2: {
                                    message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32());
                                    break;
                                }
                            default:
                                reader.skipType(tag & 7);
                                break;
                            }
                        }
                        return message;
                    };
    
                    /**
                     * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited.
                     * @function decodeDelimited
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) {
                        if (!(reader instanceof $Reader))
                            reader = new $Reader(reader);
                        return this.decode(reader, reader.uint32());
                    };
    
                    /**
                     * Verifies a FeatureSetEditionDefault message.
                     * @function verify
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @static
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {string|null} `null` if valid, otherwise the reason why it is not
                     */
                    FeatureSetEditionDefault.verify = function verify(message) {
                        if (typeof message !== "object" || message === null)
                            return "object expected";
                        if (message.edition != null && message.hasOwnProperty("edition"))
                            switch (message.edition) {
                            default:
                                return "edition: enum value expected";
                            case 0:
                            case 998:
                            case 999:
                            case 1000:
                            case 1001:
                            case 1:
                            case 2:
                            case 99997:
                            case 99998:
                            case 99999:
                            case 2147483647:
                                break;
                            }
                        if (message.features != null && message.hasOwnProperty("features")) {
                            var error = $root.google.protobuf.FeatureSet.verify(message.features);
                            if (error)
                                return "features." + error;
                        }
                        return null;
                    };
    
                    /**
                     * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types.
                     * @function fromObject
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @static
                     * @param {Object.<string,*>} object Plain object
                     * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault
                     */
                    FeatureSetEditionDefault.fromObject = function fromObject(object) {
                        if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault)
                            return object;
                        var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault();
                        switch (object.edition) {
                        default:
                            if (typeof object.edition === "number") {
                                message.edition = object.edition;
                                break;
                            }
                            break;
                        case "EDITION_UNKNOWN":
                        case 0:
                            message.edition = 0;
                            break;
                        case "EDITION_PROTO2":
                        case 998:
                            message.edition = 998;
                            break;
                        case "EDITION_PROTO3":
                        case 999:
                            message.edition = 999;
                            break;
                        case "EDITION_2023":
                        case 1000:
                            message.edition = 1000;
                            break;
                        case "EDITION_2024":
                        case 1001:
                            message.edition = 1001;
                            break;
                        case "EDITION_1_TEST_ONLY":
                        case 1:
                            message.edition = 1;
                            break;
                        case "EDITION_2_TEST_ONLY":
                        case 2:
                            message.edition = 2;
                            break;
                        case "EDITION_99997_TEST_ONLY":
                        case 99997:
                            message.edition = 99997;
                            break;
                        case "EDITION_99998_TEST_ONLY":
                        case 99998:
                            message.edition = 99998;
                            break;
                        case "EDITION_99999_TEST_ONLY":
                        case 99999:
                            message.edition = 99999;
                            break;
                        case "EDITION_MAX":
                        case 2147483647:
                            message.edition = 2147483647;
                            break;
                        }
                        if (object.features != null) {
                            if (typeof object.features !== "object")
                                throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected");
                            message.features = $root.google.protobuf.FeatureSet.fromObject(object.features);
                        }
                        return message;
                    };
    
                    /**
                     * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified.
                     * @function toObject
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @static
                     * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault
                     * @param {$protobuf.IConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    FeatureSetEditionDefault.toObject = function toObject(message, options) {
                        if (!options)
                            options = {};
                        var object = {};
                        if (options.defaults) {
                            object.features = null;
                            object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0;
                        }
                        if (message.features != null && message.hasOwnProperty("features"))
                            object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options);
                        if (message.edition != null && message.hasOwnProperty("edition"))
                            object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition;
                        return object;
                    };
    
                    /**
                     * Converts this FeatureSetEditionDefault to JSON.
                     * @function toJSON
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @instance
                     * @returns {Object.<string,*>} JSON object
                     */
                    FeatureSetEditionDefault.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };
    
                    /**
                     * Gets the default type url for FeatureSetEditionDefault
                     * @function getTypeUrl
                     * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
                     * @static
                     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                     * @returns {string} The default type url
                     */
                    FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault";
                    };
    
                    return FeatureSetEditionDefault;
                })();
    
                return FeatureSetDefaults;
            })();
    
            protobuf.SourceCodeInfo = (function() {
    
                /**
                 * Properties of a SourceCodeInfo.
                 * @memberof google.protobuf
                 * @interface ISourceCodeInfo
                 * @property {Array.<google.protobuf.SourceCodeInfo.ILocation>|null} [location] SourceCodeInfo location
                 */
    
                /**
                 * Constructs a new SourceCodeInfo.
                 * @memberof google.protobuf
                 * @classdesc Represents a SourceCodeInfo.
                 * @implements ISourceCodeInfo
                 * @constructor
                 * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
                 */
                function SourceCodeInfo(properties) {
                    this.location = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * SourceCodeInfo location.
                 * @member {Array.<google.protobuf.SourceCodeInfo.ILocation>} location
                 * @memberof google.protobuf.SourceCodeInfo
                 * @instance
                 */
                SourceCodeInfo.prototype.location = $util.emptyArray;
    
                /**
                 * Creates a new SourceCodeInfo instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.SourceCodeInfo
                 * @static
                 * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
                 * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance
                 */
                SourceCodeInfo.create = function create(properties) {
                    return new SourceCodeInfo(properties);
                };
    
                /**
                 * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.SourceCodeInfo
                 * @static
                 * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                SourceCodeInfo.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.location != null && message.location.length)
                        for (var i = 0; i < message.location.length; ++i)
                            $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.SourceCodeInfo
                 * @static
                 * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a SourceCodeInfo message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.SourceCodeInfo
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                SourceCodeInfo.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                if (!(message.location && message.location.length))
                                    message.location = [];
                                message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32()));
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.SourceCodeInfo
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a SourceCodeInfo message.
                 * @function verify
                 * @memberof google.protobuf.SourceCodeInfo
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                SourceCodeInfo.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.location != null && message.hasOwnProperty("location")) {
                        if (!Array.isArray(message.location))
                            return "location: array expected";
                        for (var i = 0; i < message.location.length; ++i) {
                            var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]);
                            if (error)
                                return "location." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.SourceCodeInfo
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
                 */
                SourceCodeInfo.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.SourceCodeInfo)
                        return object;
                    var message = new $root.google.protobuf.SourceCodeInfo();
                    if (object.location) {
                        if (!Array.isArray(object.location))
                            throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected");
                        message.location = [];
                        for (var i = 0; i < object.location.length; ++i) {
                            if (typeof object.location[i] !== "object")
                                throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected");
                            message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]);
                        }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.SourceCodeInfo
                 * @static
                 * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                SourceCodeInfo.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.location = [];
                    if (message.location && message.location.length) {
                        object.location = [];
                        for (var j = 0; j < message.location.length; ++j)
                            object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options);
                    }
                    return object;
                };
    
                /**
                 * Converts this SourceCodeInfo to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.SourceCodeInfo
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                SourceCodeInfo.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for SourceCodeInfo
                 * @function getTypeUrl
                 * @memberof google.protobuf.SourceCodeInfo
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.SourceCodeInfo";
                };
    
                SourceCodeInfo.Location = (function() {
    
                    /**
                     * Properties of a Location.
                     * @memberof google.protobuf.SourceCodeInfo
                     * @interface ILocation
                     * @property {Array.<number>|null} [path] Location path
                     * @property {Array.<number>|null} [span] Location span
                     * @property {string|null} [leadingComments] Location leadingComments
                     * @property {string|null} [trailingComments] Location trailingComments
                     * @property {Array.<string>|null} [leadingDetachedComments] Location leadingDetachedComments
                     */
    
                    /**
                     * Constructs a new Location.
                     * @memberof google.protobuf.SourceCodeInfo
                     * @classdesc Represents a Location.
                     * @implements ILocation
                     * @constructor
                     * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
                     */
                    function Location(properties) {
                        this.path = [];
                        this.span = [];
                        this.leadingDetachedComments = [];
                        if (properties)
                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                if (properties[keys[i]] != null)
                                    this[keys[i]] = properties[keys[i]];
                    }
    
                    /**
                     * Location path.
                     * @member {Array.<number>} path
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @instance
                     */
                    Location.prototype.path = $util.emptyArray;
    
                    /**
                     * Location span.
                     * @member {Array.<number>} span
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @instance
                     */
                    Location.prototype.span = $util.emptyArray;
    
                    /**
                     * Location leadingComments.
                     * @member {string} leadingComments
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @instance
                     */
                    Location.prototype.leadingComments = "";
    
                    /**
                     * Location trailingComments.
                     * @member {string} trailingComments
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @instance
                     */
                    Location.prototype.trailingComments = "";
    
                    /**
                     * Location leadingDetachedComments.
                     * @member {Array.<string>} leadingDetachedComments
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @instance
                     */
                    Location.prototype.leadingDetachedComments = $util.emptyArray;
    
                    /**
                     * Creates a new Location instance using the specified properties.
                     * @function create
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @static
                     * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
                     * @returns {google.protobuf.SourceCodeInfo.Location} Location instance
                     */
                    Location.create = function create(properties) {
                        return new Location(properties);
                    };
    
                    /**
                     * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
                     * @function encode
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @static
                     * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    Location.encode = function encode(message, writer) {
                        if (!writer)
                            writer = $Writer.create();
                        if (message.path != null && message.path.length) {
                            writer.uint32(/* id 1, wireType 2 =*/10).fork();
                            for (var i = 0; i < message.path.length; ++i)
                                writer.int32(message.path[i]);
                            writer.ldelim();
                        }
                        if (message.span != null && message.span.length) {
                            writer.uint32(/* id 2, wireType 2 =*/18).fork();
                            for (var i = 0; i < message.span.length; ++i)
                                writer.int32(message.span[i]);
                            writer.ldelim();
                        }
                        if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments"))
                            writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments);
                        if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments"))
                            writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments);
                        if (message.leadingDetachedComments != null && message.leadingDetachedComments.length)
                            for (var i = 0; i < message.leadingDetachedComments.length; ++i)
                                writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]);
                        return writer;
                    };
    
                    /**
                     * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
                     * @function encodeDelimited
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @static
                     * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    Location.encodeDelimited = function encodeDelimited(message, writer) {
                        return this.encode(message, writer).ldelim();
                    };
    
                    /**
                     * Decodes a Location message from the specified reader or buffer.
                     * @function decode
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {google.protobuf.SourceCodeInfo.Location} Location
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    Location.decode = function decode(reader, length) {
                        if (!(reader instanceof $Reader))
                            reader = $Reader.create(reader);
                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location();
                        while (reader.pos < end) {
                            var tag = reader.uint32();
                            switch (tag >>> 3) {
                            case 1: {
                                    if (!(message.path && message.path.length))
                                        message.path = [];
                                    if ((tag & 7) === 2) {
                                        var end2 = reader.uint32() + reader.pos;
                                        while (reader.pos < end2)
                                            message.path.push(reader.int32());
                                    } else
                                        message.path.push(reader.int32());
                                    break;
                                }
                            case 2: {
                                    if (!(message.span && message.span.length))
                                        message.span = [];
                                    if ((tag & 7) === 2) {
                                        var end2 = reader.uint32() + reader.pos;
                                        while (reader.pos < end2)
                                            message.span.push(reader.int32());
                                    } else
                                        message.span.push(reader.int32());
                                    break;
                                }
                            case 3: {
                                    message.leadingComments = reader.string();
                                    break;
                                }
                            case 4: {
                                    message.trailingComments = reader.string();
                                    break;
                                }
                            case 6: {
                                    if (!(message.leadingDetachedComments && message.leadingDetachedComments.length))
                                        message.leadingDetachedComments = [];
                                    message.leadingDetachedComments.push(reader.string());
                                    break;
                                }
                            default:
                                reader.skipType(tag & 7);
                                break;
                            }
                        }
                        return message;
                    };
    
                    /**
                     * Decodes a Location message from the specified reader or buffer, length delimited.
                     * @function decodeDelimited
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {google.protobuf.SourceCodeInfo.Location} Location
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    Location.decodeDelimited = function decodeDelimited(reader) {
                        if (!(reader instanceof $Reader))
                            reader = new $Reader(reader);
                        return this.decode(reader, reader.uint32());
                    };
    
                    /**
                     * Verifies a Location message.
                     * @function verify
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @static
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {string|null} `null` if valid, otherwise the reason why it is not
                     */
                    Location.verify = function verify(message) {
                        if (typeof message !== "object" || message === null)
                            return "object expected";
                        if (message.path != null && message.hasOwnProperty("path")) {
                            if (!Array.isArray(message.path))
                                return "path: array expected";
                            for (var i = 0; i < message.path.length; ++i)
                                if (!$util.isInteger(message.path[i]))
                                    return "path: integer[] expected";
                        }
                        if (message.span != null && message.hasOwnProperty("span")) {
                            if (!Array.isArray(message.span))
                                return "span: array expected";
                            for (var i = 0; i < message.span.length; ++i)
                                if (!$util.isInteger(message.span[i]))
                                    return "span: integer[] expected";
                        }
                        if (message.leadingComments != null && message.hasOwnProperty("leadingComments"))
                            if (!$util.isString(message.leadingComments))
                                return "leadingComments: string expected";
                        if (message.trailingComments != null && message.hasOwnProperty("trailingComments"))
                            if (!$util.isString(message.trailingComments))
                                return "trailingComments: string expected";
                        if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) {
                            if (!Array.isArray(message.leadingDetachedComments))
                                return "leadingDetachedComments: array expected";
                            for (var i = 0; i < message.leadingDetachedComments.length; ++i)
                                if (!$util.isString(message.leadingDetachedComments[i]))
                                    return "leadingDetachedComments: string[] expected";
                        }
                        return null;
                    };
    
                    /**
                     * Creates a Location message from a plain object. Also converts values to their respective internal types.
                     * @function fromObject
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @static
                     * @param {Object.<string,*>} object Plain object
                     * @returns {google.protobuf.SourceCodeInfo.Location} Location
                     */
                    Location.fromObject = function fromObject(object) {
                        if (object instanceof $root.google.protobuf.SourceCodeInfo.Location)
                            return object;
                        var message = new $root.google.protobuf.SourceCodeInfo.Location();
                        if (object.path) {
                            if (!Array.isArray(object.path))
                                throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected");
                            message.path = [];
                            for (var i = 0; i < object.path.length; ++i)
                                message.path[i] = object.path[i] | 0;
                        }
                        if (object.span) {
                            if (!Array.isArray(object.span))
                                throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected");
                            message.span = [];
                            for (var i = 0; i < object.span.length; ++i)
                                message.span[i] = object.span[i] | 0;
                        }
                        if (object.leadingComments != null)
                            message.leadingComments = String(object.leadingComments);
                        if (object.trailingComments != null)
                            message.trailingComments = String(object.trailingComments);
                        if (object.leadingDetachedComments) {
                            if (!Array.isArray(object.leadingDetachedComments))
                                throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected");
                            message.leadingDetachedComments = [];
                            for (var i = 0; i < object.leadingDetachedComments.length; ++i)
                                message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]);
                        }
                        return message;
                    };
    
                    /**
                     * Creates a plain object from a Location message. Also converts values to other types if specified.
                     * @function toObject
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @static
                     * @param {google.protobuf.SourceCodeInfo.Location} message Location
                     * @param {$protobuf.IConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    Location.toObject = function toObject(message, options) {
                        if (!options)
                            options = {};
                        var object = {};
                        if (options.arrays || options.defaults) {
                            object.path = [];
                            object.span = [];
                            object.leadingDetachedComments = [];
                        }
                        if (options.defaults) {
                            object.leadingComments = "";
                            object.trailingComments = "";
                        }
                        if (message.path && message.path.length) {
                            object.path = [];
                            for (var j = 0; j < message.path.length; ++j)
                                object.path[j] = message.path[j];
                        }
                        if (message.span && message.span.length) {
                            object.span = [];
                            for (var j = 0; j < message.span.length; ++j)
                                object.span[j] = message.span[j];
                        }
                        if (message.leadingComments != null && message.hasOwnProperty("leadingComments"))
                            object.leadingComments = message.leadingComments;
                        if (message.trailingComments != null && message.hasOwnProperty("trailingComments"))
                            object.trailingComments = message.trailingComments;
                        if (message.leadingDetachedComments && message.leadingDetachedComments.length) {
                            object.leadingDetachedComments = [];
                            for (var j = 0; j < message.leadingDetachedComments.length; ++j)
                                object.leadingDetachedComments[j] = message.leadingDetachedComments[j];
                        }
                        return object;
                    };
    
                    /**
                     * Converts this Location to JSON.
                     * @function toJSON
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @instance
                     * @returns {Object.<string,*>} JSON object
                     */
                    Location.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };
    
                    /**
                     * Gets the default type url for Location
                     * @function getTypeUrl
                     * @memberof google.protobuf.SourceCodeInfo.Location
                     * @static
                     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                     * @returns {string} The default type url
                     */
                    Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location";
                    };
    
                    return Location;
                })();
    
                return SourceCodeInfo;
            })();
    
            protobuf.GeneratedCodeInfo = (function() {
    
                /**
                 * Properties of a GeneratedCodeInfo.
                 * @memberof google.protobuf
                 * @interface IGeneratedCodeInfo
                 * @property {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>|null} [annotation] GeneratedCodeInfo annotation
                 */
    
                /**
                 * Constructs a new GeneratedCodeInfo.
                 * @memberof google.protobuf
                 * @classdesc Represents a GeneratedCodeInfo.
                 * @implements IGeneratedCodeInfo
                 * @constructor
                 * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set
                 */
                function GeneratedCodeInfo(properties) {
                    this.annotation = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * GeneratedCodeInfo annotation.
                 * @member {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>} annotation
                 * @memberof google.protobuf.GeneratedCodeInfo
                 * @instance
                 */
                GeneratedCodeInfo.prototype.annotation = $util.emptyArray;
    
                /**
                 * Creates a new GeneratedCodeInfo instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.GeneratedCodeInfo
                 * @static
                 * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set
                 * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance
                 */
                GeneratedCodeInfo.create = function create(properties) {
                    return new GeneratedCodeInfo(properties);
                };
    
                /**
                 * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.GeneratedCodeInfo
                 * @static
                 * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                GeneratedCodeInfo.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.annotation != null && message.annotation.length)
                        for (var i = 0; i < message.annotation.length; ++i)
                            $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.GeneratedCodeInfo
                 * @static
                 * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a GeneratedCodeInfo message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.GeneratedCodeInfo
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                GeneratedCodeInfo.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                if (!(message.annotation && message.annotation.length))
                                    message.annotation = [];
                                message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32()));
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.GeneratedCodeInfo
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a GeneratedCodeInfo message.
                 * @function verify
                 * @memberof google.protobuf.GeneratedCodeInfo
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                GeneratedCodeInfo.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.annotation != null && message.hasOwnProperty("annotation")) {
                        if (!Array.isArray(message.annotation))
                            return "annotation: array expected";
                        for (var i = 0; i < message.annotation.length; ++i) {
                            var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]);
                            if (error)
                                return "annotation." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.GeneratedCodeInfo
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
                 */
                GeneratedCodeInfo.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.GeneratedCodeInfo)
                        return object;
                    var message = new $root.google.protobuf.GeneratedCodeInfo();
                    if (object.annotation) {
                        if (!Array.isArray(object.annotation))
                            throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected");
                        message.annotation = [];
                        for (var i = 0; i < object.annotation.length; ++i) {
                            if (typeof object.annotation[i] !== "object")
                                throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected");
                            message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]);
                        }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.GeneratedCodeInfo
                 * @static
                 * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                GeneratedCodeInfo.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.annotation = [];
                    if (message.annotation && message.annotation.length) {
                        object.annotation = [];
                        for (var j = 0; j < message.annotation.length; ++j)
                            object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options);
                    }
                    return object;
                };
    
                /**
                 * Converts this GeneratedCodeInfo to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.GeneratedCodeInfo
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                GeneratedCodeInfo.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for GeneratedCodeInfo
                 * @function getTypeUrl
                 * @memberof google.protobuf.GeneratedCodeInfo
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo";
                };
    
                GeneratedCodeInfo.Annotation = (function() {
    
                    /**
                     * Properties of an Annotation.
                     * @memberof google.protobuf.GeneratedCodeInfo
                     * @interface IAnnotation
                     * @property {Array.<number>|null} [path] Annotation path
                     * @property {string|null} [sourceFile] Annotation sourceFile
                     * @property {number|null} [begin] Annotation begin
                     * @property {number|null} [end] Annotation end
                     * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic
                     */
    
                    /**
                     * Constructs a new Annotation.
                     * @memberof google.protobuf.GeneratedCodeInfo
                     * @classdesc Represents an Annotation.
                     * @implements IAnnotation
                     * @constructor
                     * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set
                     */
                    function Annotation(properties) {
                        this.path = [];
                        if (properties)
                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                                if (properties[keys[i]] != null)
                                    this[keys[i]] = properties[keys[i]];
                    }
    
                    /**
                     * Annotation path.
                     * @member {Array.<number>} path
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @instance
                     */
                    Annotation.prototype.path = $util.emptyArray;
    
                    /**
                     * Annotation sourceFile.
                     * @member {string} sourceFile
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @instance
                     */
                    Annotation.prototype.sourceFile = "";
    
                    /**
                     * Annotation begin.
                     * @member {number} begin
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @instance
                     */
                    Annotation.prototype.begin = 0;
    
                    /**
                     * Annotation end.
                     * @member {number} end
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @instance
                     */
                    Annotation.prototype.end = 0;
    
                    /**
                     * Annotation semantic.
                     * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @instance
                     */
                    Annotation.prototype.semantic = 0;
    
                    /**
                     * Creates a new Annotation instance using the specified properties.
                     * @function create
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @static
                     * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set
                     * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance
                     */
                    Annotation.create = function create(properties) {
                        return new Annotation(properties);
                    };
    
                    /**
                     * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.
                     * @function encode
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @static
                     * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    Annotation.encode = function encode(message, writer) {
                        if (!writer)
                            writer = $Writer.create();
                        if (message.path != null && message.path.length) {
                            writer.uint32(/* id 1, wireType 2 =*/10).fork();
                            for (var i = 0; i < message.path.length; ++i)
                                writer.int32(message.path[i]);
                            writer.ldelim();
                        }
                        if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile"))
                            writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile);
                        if (message.begin != null && Object.hasOwnProperty.call(message, "begin"))
                            writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin);
                        if (message.end != null && Object.hasOwnProperty.call(message, "end"))
                            writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end);
                        if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic"))
                            writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic);
                        return writer;
                    };
    
                    /**
                     * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.
                     * @function encodeDelimited
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @static
                     * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    Annotation.encodeDelimited = function encodeDelimited(message, writer) {
                        return this.encode(message, writer).ldelim();
                    };
    
                    /**
                     * Decodes an Annotation message from the specified reader or buffer.
                     * @function decode
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    Annotation.decode = function decode(reader, length) {
                        if (!(reader instanceof $Reader))
                            reader = $Reader.create(reader);
                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();
                        while (reader.pos < end) {
                            var tag = reader.uint32();
                            switch (tag >>> 3) {
                            case 1: {
                                    if (!(message.path && message.path.length))
                                        message.path = [];
                                    if ((tag & 7) === 2) {
                                        var end2 = reader.uint32() + reader.pos;
                                        while (reader.pos < end2)
                                            message.path.push(reader.int32());
                                    } else
                                        message.path.push(reader.int32());
                                    break;
                                }
                            case 2: {
                                    message.sourceFile = reader.string();
                                    break;
                                }
                            case 3: {
                                    message.begin = reader.int32();
                                    break;
                                }
                            case 4: {
                                    message.end = reader.int32();
                                    break;
                                }
                            case 5: {
                                    message.semantic = reader.int32();
                                    break;
                                }
                            default:
                                reader.skipType(tag & 7);
                                break;
                            }
                        }
                        return message;
                    };
    
                    /**
                     * Decodes an Annotation message from the specified reader or buffer, length delimited.
                     * @function decodeDelimited
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @static
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    Annotation.decodeDelimited = function decodeDelimited(reader) {
                        if (!(reader instanceof $Reader))
                            reader = new $Reader(reader);
                        return this.decode(reader, reader.uint32());
                    };
    
                    /**
                     * Verifies an Annotation message.
                     * @function verify
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @static
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {string|null} `null` if valid, otherwise the reason why it is not
                     */
                    Annotation.verify = function verify(message) {
                        if (typeof message !== "object" || message === null)
                            return "object expected";
                        if (message.path != null && message.hasOwnProperty("path")) {
                            if (!Array.isArray(message.path))
                                return "path: array expected";
                            for (var i = 0; i < message.path.length; ++i)
                                if (!$util.isInteger(message.path[i]))
                                    return "path: integer[] expected";
                        }
                        if (message.sourceFile != null && message.hasOwnProperty("sourceFile"))
                            if (!$util.isString(message.sourceFile))
                                return "sourceFile: string expected";
                        if (message.begin != null && message.hasOwnProperty("begin"))
                            if (!$util.isInteger(message.begin))
                                return "begin: integer expected";
                        if (message.end != null && message.hasOwnProperty("end"))
                            if (!$util.isInteger(message.end))
                                return "end: integer expected";
                        if (message.semantic != null && message.hasOwnProperty("semantic"))
                            switch (message.semantic) {
                            default:
                                return "semantic: enum value expected";
                            case 0:
                            case 1:
                            case 2:
                                break;
                            }
                        return null;
                    };
    
                    /**
                     * Creates an Annotation message from a plain object. Also converts values to their respective internal types.
                     * @function fromObject
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @static
                     * @param {Object.<string,*>} object Plain object
                     * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
                     */
                    Annotation.fromObject = function fromObject(object) {
                        if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation)
                            return object;
                        var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();
                        if (object.path) {
                            if (!Array.isArray(object.path))
                                throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected");
                            message.path = [];
                            for (var i = 0; i < object.path.length; ++i)
                                message.path[i] = object.path[i] | 0;
                        }
                        if (object.sourceFile != null)
                            message.sourceFile = String(object.sourceFile);
                        if (object.begin != null)
                            message.begin = object.begin | 0;
                        if (object.end != null)
                            message.end = object.end | 0;
                        switch (object.semantic) {
                        default:
                            if (typeof object.semantic === "number") {
                                message.semantic = object.semantic;
                                break;
                            }
                            break;
                        case "NONE":
                        case 0:
                            message.semantic = 0;
                            break;
                        case "SET":
                        case 1:
                            message.semantic = 1;
                            break;
                        case "ALIAS":
                        case 2:
                            message.semantic = 2;
                            break;
                        }
                        return message;
                    };
    
                    /**
                     * Creates a plain object from an Annotation message. Also converts values to other types if specified.
                     * @function toObject
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @static
                     * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation
                     * @param {$protobuf.IConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    Annotation.toObject = function toObject(message, options) {
                        if (!options)
                            options = {};
                        var object = {};
                        if (options.arrays || options.defaults)
                            object.path = [];
                        if (options.defaults) {
                            object.sourceFile = "";
                            object.begin = 0;
                            object.end = 0;
                            object.semantic = options.enums === String ? "NONE" : 0;
                        }
                        if (message.path && message.path.length) {
                            object.path = [];
                            for (var j = 0; j < message.path.length; ++j)
                                object.path[j] = message.path[j];
                        }
                        if (message.sourceFile != null && message.hasOwnProperty("sourceFile"))
                            object.sourceFile = message.sourceFile;
                        if (message.begin != null && message.hasOwnProperty("begin"))
                            object.begin = message.begin;
                        if (message.end != null && message.hasOwnProperty("end"))
                            object.end = message.end;
                        if (message.semantic != null && message.hasOwnProperty("semantic"))
                            object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic;
                        return object;
                    };
    
                    /**
                     * Converts this Annotation to JSON.
                     * @function toJSON
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @instance
                     * @returns {Object.<string,*>} JSON object
                     */
                    Annotation.prototype.toJSON = function toJSON() {
                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                    };
    
                    /**
                     * Gets the default type url for Annotation
                     * @function getTypeUrl
                     * @memberof google.protobuf.GeneratedCodeInfo.Annotation
                     * @static
                     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                     * @returns {string} The default type url
                     */
                    Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                        if (typeUrlPrefix === undefined) {
                            typeUrlPrefix = "type.googleapis.com";
                        }
                        return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation";
                    };
    
                    /**
                     * Semantic enum.
                     * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic
                     * @enum {number}
                     * @property {number} NONE=0 NONE value
                     * @property {number} SET=1 SET value
                     * @property {number} ALIAS=2 ALIAS value
                     */
                    Annotation.Semantic = (function() {
                        var valuesById = {}, values = Object.create(valuesById);
                        values[valuesById[0] = "NONE"] = 0;
                        values[valuesById[1] = "SET"] = 1;
                        values[valuesById[2] = "ALIAS"] = 2;
                        return values;
                    })();
    
                    return Annotation;
                })();
    
                return GeneratedCodeInfo;
            })();
    
            protobuf.Duration = (function() {
    
                /**
                 * Properties of a Duration.
                 * @memberof google.protobuf
                 * @interface IDuration
                 * @property {number|Long|null} [seconds] Duration seconds
                 * @property {number|null} [nanos] Duration nanos
                 */
    
                /**
                 * Constructs a new Duration.
                 * @memberof google.protobuf
                 * @classdesc Represents a Duration.
                 * @implements IDuration
                 * @constructor
                 * @param {google.protobuf.IDuration=} [properties] Properties to set
                 */
                function Duration(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * Duration seconds.
                 * @member {number|Long} seconds
                 * @memberof google.protobuf.Duration
                 * @instance
                 */
                Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
    
                /**
                 * Duration nanos.
                 * @member {number} nanos
                 * @memberof google.protobuf.Duration
                 * @instance
                 */
                Duration.prototype.nanos = 0;
    
                /**
                 * Creates a new Duration instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.Duration
                 * @static
                 * @param {google.protobuf.IDuration=} [properties] Properties to set
                 * @returns {google.protobuf.Duration} Duration instance
                 */
                Duration.create = function create(properties) {
                    return new Duration(properties);
                };
    
                /**
                 * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.Duration
                 * @static
                 * @param {google.protobuf.IDuration} message Duration message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Duration.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
                        writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
                    if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
                        writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
                    return writer;
                };
    
                /**
                 * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.Duration
                 * @static
                 * @param {google.protobuf.IDuration} message Duration message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Duration.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a Duration message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.Duration
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.Duration} Duration
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Duration.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.seconds = reader.int64();
                                break;
                            }
                        case 2: {
                                message.nanos = reader.int32();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a Duration message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.Duration
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.Duration} Duration
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Duration.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a Duration message.
                 * @function verify
                 * @memberof google.protobuf.Duration
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                Duration.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.seconds != null && message.hasOwnProperty("seconds"))
                        if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
                            return "seconds: integer|Long expected";
                    if (message.nanos != null && message.hasOwnProperty("nanos"))
                        if (!$util.isInteger(message.nanos))
                            return "nanos: integer expected";
                    return null;
                };
    
                /**
                 * Creates a Duration message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.Duration
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.Duration} Duration
                 */
                Duration.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.Duration)
                        return object;
                    var message = new $root.google.protobuf.Duration();
                    if (object.seconds != null)
                        if ($util.Long)
                            (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
                        else if (typeof object.seconds === "string")
                            message.seconds = parseInt(object.seconds, 10);
                        else if (typeof object.seconds === "number")
                            message.seconds = object.seconds;
                        else if (typeof object.seconds === "object")
                            message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
                    if (object.nanos != null)
                        message.nanos = object.nanos | 0;
                    return message;
                };
    
                /**
                 * Creates a plain object from a Duration message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.Duration
                 * @static
                 * @param {google.protobuf.Duration} message Duration
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                Duration.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        if ($util.Long) {
                            var long = new $util.Long(0, 0, false);
                            object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                        } else
                            object.seconds = options.longs === String ? "0" : 0;
                        object.nanos = 0;
                    }
                    if (message.seconds != null && message.hasOwnProperty("seconds"))
                        if (typeof message.seconds === "number")
                            object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
                        else
                            object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds;
                    if (message.nanos != null && message.hasOwnProperty("nanos"))
                        object.nanos = message.nanos;
                    return object;
                };
    
                /**
                 * Converts this Duration to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.Duration
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                Duration.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for Duration
                 * @function getTypeUrl
                 * @memberof google.protobuf.Duration
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.Duration";
                };
    
                return Duration;
            })();
    
            protobuf.Struct = (function() {
    
                /**
                 * Properties of a Struct.
                 * @memberof google.protobuf
                 * @interface IStruct
                 * @property {Object.<string,google.protobuf.IValue>|null} [fields] Struct fields
                 */
    
                /**
                 * Constructs a new Struct.
                 * @memberof google.protobuf
                 * @classdesc Represents a Struct.
                 * @implements IStruct
                 * @constructor
                 * @param {google.protobuf.IStruct=} [properties] Properties to set
                 */
                function Struct(properties) {
                    this.fields = {};
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * Struct fields.
                 * @member {Object.<string,google.protobuf.IValue>} fields
                 * @memberof google.protobuf.Struct
                 * @instance
                 */
                Struct.prototype.fields = $util.emptyObject;
    
                /**
                 * Creates a new Struct instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.Struct
                 * @static
                 * @param {google.protobuf.IStruct=} [properties] Properties to set
                 * @returns {google.protobuf.Struct} Struct instance
                 */
                Struct.create = function create(properties) {
                    return new Struct(properties);
                };
    
                /**
                 * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.Struct
                 * @static
                 * @param {google.protobuf.IStruct} message Struct message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Struct.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.fields != null && Object.hasOwnProperty.call(message, "fields"))
                        for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) {
                            writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
                            $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                        }
                    return writer;
                };
    
                /**
                 * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.Struct
                 * @static
                 * @param {google.protobuf.IStruct} message Struct message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Struct.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a Struct message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.Struct
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.Struct} Struct
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Struct.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value;
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                if (message.fields === $util.emptyObject)
                                    message.fields = {};
                                var end2 = reader.uint32() + reader.pos;
                                key = "";
                                value = null;
                                while (reader.pos < end2) {
                                    var tag2 = reader.uint32();
                                    switch (tag2 >>> 3) {
                                    case 1:
                                        key = reader.string();
                                        break;
                                    case 2:
                                        value = $root.google.protobuf.Value.decode(reader, reader.uint32());
                                        break;
                                    default:
                                        reader.skipType(tag2 & 7);
                                        break;
                                    }
                                }
                                message.fields[key] = value;
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a Struct message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.Struct
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.Struct} Struct
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Struct.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a Struct message.
                 * @function verify
                 * @memberof google.protobuf.Struct
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                Struct.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.fields != null && message.hasOwnProperty("fields")) {
                        if (!$util.isObject(message.fields))
                            return "fields: object expected";
                        var key = Object.keys(message.fields);
                        for (var i = 0; i < key.length; ++i) {
                            var error = $root.google.protobuf.Value.verify(message.fields[key[i]]);
                            if (error)
                                return "fields." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates a Struct message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.Struct
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.Struct} Struct
                 */
                Struct.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.Struct)
                        return object;
                    var message = new $root.google.protobuf.Struct();
                    if (object.fields) {
                        if (typeof object.fields !== "object")
                            throw TypeError(".google.protobuf.Struct.fields: object expected");
                        message.fields = {};
                        for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) {
                            if (typeof object.fields[keys[i]] !== "object")
                                throw TypeError(".google.protobuf.Struct.fields: object expected");
                            message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]);
                        }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a Struct message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.Struct
                 * @static
                 * @param {google.protobuf.Struct} message Struct
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                Struct.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.objects || options.defaults)
                        object.fields = {};
                    var keys2;
                    if (message.fields && (keys2 = Object.keys(message.fields)).length) {
                        object.fields = {};
                        for (var j = 0; j < keys2.length; ++j)
                            object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options);
                    }
                    return object;
                };
    
                /**
                 * Converts this Struct to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.Struct
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                Struct.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for Struct
                 * @function getTypeUrl
                 * @memberof google.protobuf.Struct
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.Struct";
                };
    
                return Struct;
            })();
    
            protobuf.Value = (function() {
    
                /**
                 * Properties of a Value.
                 * @memberof google.protobuf
                 * @interface IValue
                 * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue
                 * @property {number|null} [numberValue] Value numberValue
                 * @property {string|null} [stringValue] Value stringValue
                 * @property {boolean|null} [boolValue] Value boolValue
                 * @property {google.protobuf.IStruct|null} [structValue] Value structValue
                 * @property {google.protobuf.IListValue|null} [listValue] Value listValue
                 */
    
                /**
                 * Constructs a new Value.
                 * @memberof google.protobuf
                 * @classdesc Represents a Value.
                 * @implements IValue
                 * @constructor
                 * @param {google.protobuf.IValue=} [properties] Properties to set
                 */
                function Value(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * Value nullValue.
                 * @member {google.protobuf.NullValue|null|undefined} nullValue
                 * @memberof google.protobuf.Value
                 * @instance
                 */
                Value.prototype.nullValue = null;
    
                /**
                 * Value numberValue.
                 * @member {number|null|undefined} numberValue
                 * @memberof google.protobuf.Value
                 * @instance
                 */
                Value.prototype.numberValue = null;
    
                /**
                 * Value stringValue.
                 * @member {string|null|undefined} stringValue
                 * @memberof google.protobuf.Value
                 * @instance
                 */
                Value.prototype.stringValue = null;
    
                /**
                 * Value boolValue.
                 * @member {boolean|null|undefined} boolValue
                 * @memberof google.protobuf.Value
                 * @instance
                 */
                Value.prototype.boolValue = null;
    
                /**
                 * Value structValue.
                 * @member {google.protobuf.IStruct|null|undefined} structValue
                 * @memberof google.protobuf.Value
                 * @instance
                 */
                Value.prototype.structValue = null;
    
                /**
                 * Value listValue.
                 * @member {google.protobuf.IListValue|null|undefined} listValue
                 * @memberof google.protobuf.Value
                 * @instance
                 */
                Value.prototype.listValue = null;
    
                // OneOf field names bound to virtual getters and setters
                var $oneOfFields;
    
                /**
                 * Value kind.
                 * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind
                 * @memberof google.protobuf.Value
                 * @instance
                 */
                Object.defineProperty(Value.prototype, "kind", {
                    get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]),
                    set: $util.oneOfSetter($oneOfFields)
                });
    
                /**
                 * Creates a new Value instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.Value
                 * @static
                 * @param {google.protobuf.IValue=} [properties] Properties to set
                 * @returns {google.protobuf.Value} Value instance
                 */
                Value.create = function create(properties) {
                    return new Value(properties);
                };
    
                /**
                 * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.Value
                 * @static
                 * @param {google.protobuf.IValue} message Value message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Value.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue"))
                        writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue);
                    if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue"))
                        writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue);
                    if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue"))
                        writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue);
                    if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue"))
                        writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue);
                    if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue"))
                        $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                    if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue"))
                        $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.Value
                 * @static
                 * @param {google.protobuf.IValue} message Value message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Value.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a Value message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.Value
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.Value} Value
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Value.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.nullValue = reader.int32();
                                break;
                            }
                        case 2: {
                                message.numberValue = reader.double();
                                break;
                            }
                        case 3: {
                                message.stringValue = reader.string();
                                break;
                            }
                        case 4: {
                                message.boolValue = reader.bool();
                                break;
                            }
                        case 5: {
                                message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32());
                                break;
                            }
                        case 6: {
                                message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a Value message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.Value
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.Value} Value
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Value.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a Value message.
                 * @function verify
                 * @memberof google.protobuf.Value
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                Value.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    var properties = {};
                    if (message.nullValue != null && message.hasOwnProperty("nullValue")) {
                        properties.kind = 1;
                        switch (message.nullValue) {
                        default:
                            return "nullValue: enum value expected";
                        case 0:
                            break;
                        }
                    }
                    if (message.numberValue != null && message.hasOwnProperty("numberValue")) {
                        if (properties.kind === 1)
                            return "kind: multiple values";
                        properties.kind = 1;
                        if (typeof message.numberValue !== "number")
                            return "numberValue: number expected";
                    }
                    if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                        if (properties.kind === 1)
                            return "kind: multiple values";
                        properties.kind = 1;
                        if (!$util.isString(message.stringValue))
                            return "stringValue: string expected";
                    }
                    if (message.boolValue != null && message.hasOwnProperty("boolValue")) {
                        if (properties.kind === 1)
                            return "kind: multiple values";
                        properties.kind = 1;
                        if (typeof message.boolValue !== "boolean")
                            return "boolValue: boolean expected";
                    }
                    if (message.structValue != null && message.hasOwnProperty("structValue")) {
                        if (properties.kind === 1)
                            return "kind: multiple values";
                        properties.kind = 1;
                        {
                            var error = $root.google.protobuf.Struct.verify(message.structValue);
                            if (error)
                                return "structValue." + error;
                        }
                    }
                    if (message.listValue != null && message.hasOwnProperty("listValue")) {
                        if (properties.kind === 1)
                            return "kind: multiple values";
                        properties.kind = 1;
                        {
                            var error = $root.google.protobuf.ListValue.verify(message.listValue);
                            if (error)
                                return "listValue." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates a Value message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.Value
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.Value} Value
                 */
                Value.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.Value)
                        return object;
                    var message = new $root.google.protobuf.Value();
                    switch (object.nullValue) {
                    default:
                        if (typeof object.nullValue === "number") {
                            message.nullValue = object.nullValue;
                            break;
                        }
                        break;
                    case "NULL_VALUE":
                    case 0:
                        message.nullValue = 0;
                        break;
                    }
                    if (object.numberValue != null)
                        message.numberValue = Number(object.numberValue);
                    if (object.stringValue != null)
                        message.stringValue = String(object.stringValue);
                    if (object.boolValue != null)
                        message.boolValue = Boolean(object.boolValue);
                    if (object.structValue != null) {
                        if (typeof object.structValue !== "object")
                            throw TypeError(".google.protobuf.Value.structValue: object expected");
                        message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue);
                    }
                    if (object.listValue != null) {
                        if (typeof object.listValue !== "object")
                            throw TypeError(".google.protobuf.Value.listValue: object expected");
                        message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a Value message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.Value
                 * @static
                 * @param {google.protobuf.Value} message Value
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                Value.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (message.nullValue != null && message.hasOwnProperty("nullValue")) {
                        object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue;
                        if (options.oneofs)
                            object.kind = "nullValue";
                    }
                    if (message.numberValue != null && message.hasOwnProperty("numberValue")) {
                        object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue;
                        if (options.oneofs)
                            object.kind = "numberValue";
                    }
                    if (message.stringValue != null && message.hasOwnProperty("stringValue")) {
                        object.stringValue = message.stringValue;
                        if (options.oneofs)
                            object.kind = "stringValue";
                    }
                    if (message.boolValue != null && message.hasOwnProperty("boolValue")) {
                        object.boolValue = message.boolValue;
                        if (options.oneofs)
                            object.kind = "boolValue";
                    }
                    if (message.structValue != null && message.hasOwnProperty("structValue")) {
                        object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options);
                        if (options.oneofs)
                            object.kind = "structValue";
                    }
                    if (message.listValue != null && message.hasOwnProperty("listValue")) {
                        object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options);
                        if (options.oneofs)
                            object.kind = "listValue";
                    }
                    return object;
                };
    
                /**
                 * Converts this Value to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.Value
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                Value.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for Value
                 * @function getTypeUrl
                 * @memberof google.protobuf.Value
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.Value";
                };
    
                return Value;
            })();
    
            /**
             * NullValue enum.
             * @name google.protobuf.NullValue
             * @enum {number}
             * @property {number} NULL_VALUE=0 NULL_VALUE value
             */
            protobuf.NullValue = (function() {
                var valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "NULL_VALUE"] = 0;
                return values;
            })();
    
            protobuf.ListValue = (function() {
    
                /**
                 * Properties of a ListValue.
                 * @memberof google.protobuf
                 * @interface IListValue
                 * @property {Array.<google.protobuf.IValue>|null} [values] ListValue values
                 */
    
                /**
                 * Constructs a new ListValue.
                 * @memberof google.protobuf
                 * @classdesc Represents a ListValue.
                 * @implements IListValue
                 * @constructor
                 * @param {google.protobuf.IListValue=} [properties] Properties to set
                 */
                function ListValue(properties) {
                    this.values = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * ListValue values.
                 * @member {Array.<google.protobuf.IValue>} values
                 * @memberof google.protobuf.ListValue
                 * @instance
                 */
                ListValue.prototype.values = $util.emptyArray;
    
                /**
                 * Creates a new ListValue instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.ListValue
                 * @static
                 * @param {google.protobuf.IListValue=} [properties] Properties to set
                 * @returns {google.protobuf.ListValue} ListValue instance
                 */
                ListValue.create = function create(properties) {
                    return new ListValue(properties);
                };
    
                /**
                 * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.ListValue
                 * @static
                 * @param {google.protobuf.IListValue} message ListValue message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ListValue.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.values != null && message.values.length)
                        for (var i = 0; i < message.values.length; ++i)
                            $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.ListValue
                 * @static
                 * @param {google.protobuf.IListValue} message ListValue message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ListValue.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a ListValue message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.ListValue
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.ListValue} ListValue
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ListValue.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                if (!(message.values && message.values.length))
                                    message.values = [];
                                message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32()));
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a ListValue message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.ListValue
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.ListValue} ListValue
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ListValue.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a ListValue message.
                 * @function verify
                 * @memberof google.protobuf.ListValue
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                ListValue.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.values != null && message.hasOwnProperty("values")) {
                        if (!Array.isArray(message.values))
                            return "values: array expected";
                        for (var i = 0; i < message.values.length; ++i) {
                            var error = $root.google.protobuf.Value.verify(message.values[i]);
                            if (error)
                                return "values." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates a ListValue message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.ListValue
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.ListValue} ListValue
                 */
                ListValue.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.ListValue)
                        return object;
                    var message = new $root.google.protobuf.ListValue();
                    if (object.values) {
                        if (!Array.isArray(object.values))
                            throw TypeError(".google.protobuf.ListValue.values: array expected");
                        message.values = [];
                        for (var i = 0; i < object.values.length; ++i) {
                            if (typeof object.values[i] !== "object")
                                throw TypeError(".google.protobuf.ListValue.values: object expected");
                            message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]);
                        }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a ListValue message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.ListValue
                 * @static
                 * @param {google.protobuf.ListValue} message ListValue
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                ListValue.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.values = [];
                    if (message.values && message.values.length) {
                        object.values = [];
                        for (var j = 0; j < message.values.length; ++j)
                            object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options);
                    }
                    return object;
                };
    
                /**
                 * Converts this ListValue to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.ListValue
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                ListValue.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for ListValue
                 * @function getTypeUrl
                 * @memberof google.protobuf.ListValue
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.ListValue";
                };
    
                return ListValue;
            })();
    
            protobuf.Timestamp = (function() {
    
                /**
                 * Properties of a Timestamp.
                 * @memberof google.protobuf
                 * @interface ITimestamp
                 * @property {number|Long|null} [seconds] Timestamp seconds
                 * @property {number|null} [nanos] Timestamp nanos
                 */
    
                /**
                 * Constructs a new Timestamp.
                 * @memberof google.protobuf
                 * @classdesc Represents a Timestamp.
                 * @implements ITimestamp
                 * @constructor
                 * @param {google.protobuf.ITimestamp=} [properties] Properties to set
                 */
                function Timestamp(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * Timestamp seconds.
                 * @member {number|Long} seconds
                 * @memberof google.protobuf.Timestamp
                 * @instance
                 */
                Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
    
                /**
                 * Timestamp nanos.
                 * @member {number} nanos
                 * @memberof google.protobuf.Timestamp
                 * @instance
                 */
                Timestamp.prototype.nanos = 0;
    
                /**
                 * Creates a new Timestamp instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.Timestamp
                 * @static
                 * @param {google.protobuf.ITimestamp=} [properties] Properties to set
                 * @returns {google.protobuf.Timestamp} Timestamp instance
                 */
                Timestamp.create = function create(properties) {
                    return new Timestamp(properties);
                };
    
                /**
                 * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.Timestamp
                 * @static
                 * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Timestamp.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
                        writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
                    if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
                        writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
                    return writer;
                };
    
                /**
                 * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.Timestamp
                 * @static
                 * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Timestamp.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a Timestamp message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.Timestamp
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.Timestamp} Timestamp
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Timestamp.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.seconds = reader.int64();
                                break;
                            }
                        case 2: {
                                message.nanos = reader.int32();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a Timestamp message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.Timestamp
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.Timestamp} Timestamp
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Timestamp.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a Timestamp message.
                 * @function verify
                 * @memberof google.protobuf.Timestamp
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                Timestamp.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.seconds != null && message.hasOwnProperty("seconds"))
                        if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
                            return "seconds: integer|Long expected";
                    if (message.nanos != null && message.hasOwnProperty("nanos"))
                        if (!$util.isInteger(message.nanos))
                            return "nanos: integer expected";
                    return null;
                };
    
                /**
                 * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.Timestamp
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.Timestamp} Timestamp
                 */
                Timestamp.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.Timestamp)
                        return object;
                    var message = new $root.google.protobuf.Timestamp();
                    if (object.seconds != null)
                        if ($util.Long)
                            (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
                        else if (typeof object.seconds === "string")
                            message.seconds = parseInt(object.seconds, 10);
                        else if (typeof object.seconds === "number")
                            message.seconds = object.seconds;
                        else if (typeof object.seconds === "object")
                            message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
                    if (object.nanos != null)
                        message.nanos = object.nanos | 0;
                    return message;
                };
    
                /**
                 * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.Timestamp
                 * @static
                 * @param {google.protobuf.Timestamp} message Timestamp
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                Timestamp.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        if ($util.Long) {
                            var long = new $util.Long(0, 0, false);
                            object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                        } else
                            object.seconds = options.longs === String ? "0" : 0;
                        object.nanos = 0;
                    }
                    if (message.seconds != null && message.hasOwnProperty("seconds"))
                        if (typeof message.seconds === "number")
                            object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
                        else
                            object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds;
                    if (message.nanos != null && message.hasOwnProperty("nanos"))
                        object.nanos = message.nanos;
                    return object;
                };
    
                /**
                 * Converts this Timestamp to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.Timestamp
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                Timestamp.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for Timestamp
                 * @function getTypeUrl
                 * @memberof google.protobuf.Timestamp
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.Timestamp";
                };
    
                return Timestamp;
            })();
    
            protobuf.Empty = (function() {
    
                /**
                 * Properties of an Empty.
                 * @memberof google.protobuf
                 * @interface IEmpty
                 */
    
                /**
                 * Constructs a new Empty.
                 * @memberof google.protobuf
                 * @classdesc Represents an Empty.
                 * @implements IEmpty
                 * @constructor
                 * @param {google.protobuf.IEmpty=} [properties] Properties to set
                 */
                function Empty(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * Creates a new Empty instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.Empty
                 * @static
                 * @param {google.protobuf.IEmpty=} [properties] Properties to set
                 * @returns {google.protobuf.Empty} Empty instance
                 */
                Empty.create = function create(properties) {
                    return new Empty(properties);
                };
    
                /**
                 * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.Empty
                 * @static
                 * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Empty.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    return writer;
                };
    
                /**
                 * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.Empty
                 * @static
                 * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Empty.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an Empty message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.Empty
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.Empty} Empty
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Empty.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an Empty message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.Empty
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.Empty} Empty
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Empty.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an Empty message.
                 * @function verify
                 * @memberof google.protobuf.Empty
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                Empty.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    return null;
                };
    
                /**
                 * Creates an Empty message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.Empty
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.Empty} Empty
                 */
                Empty.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.Empty)
                        return object;
                    return new $root.google.protobuf.Empty();
                };
    
                /**
                 * Creates a plain object from an Empty message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.Empty
                 * @static
                 * @param {google.protobuf.Empty} message Empty
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                Empty.toObject = function toObject() {
                    return {};
                };
    
                /**
                 * Converts this Empty to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.Empty
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                Empty.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for Empty
                 * @function getTypeUrl
                 * @memberof google.protobuf.Empty
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.Empty";
                };
    
                return Empty;
            })();
    
            protobuf.FieldMask = (function() {
    
                /**
                 * Properties of a FieldMask.
                 * @memberof google.protobuf
                 * @interface IFieldMask
                 * @property {Array.<string>|null} [paths] FieldMask paths
                 */
    
                /**
                 * Constructs a new FieldMask.
                 * @memberof google.protobuf
                 * @classdesc Represents a FieldMask.
                 * @implements IFieldMask
                 * @constructor
                 * @param {google.protobuf.IFieldMask=} [properties] Properties to set
                 */
                function FieldMask(properties) {
                    this.paths = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * FieldMask paths.
                 * @member {Array.<string>} paths
                 * @memberof google.protobuf.FieldMask
                 * @instance
                 */
                FieldMask.prototype.paths = $util.emptyArray;
    
                /**
                 * Creates a new FieldMask instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.FieldMask
                 * @static
                 * @param {google.protobuf.IFieldMask=} [properties] Properties to set
                 * @returns {google.protobuf.FieldMask} FieldMask instance
                 */
                FieldMask.create = function create(properties) {
                    return new FieldMask(properties);
                };
    
                /**
                 * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.FieldMask
                 * @static
                 * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FieldMask.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.paths != null && message.paths.length)
                        for (var i = 0; i < message.paths.length; ++i)
                            writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]);
                    return writer;
                };
    
                /**
                 * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.FieldMask
                 * @static
                 * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                FieldMask.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a FieldMask message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.FieldMask
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.FieldMask} FieldMask
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FieldMask.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                if (!(message.paths && message.paths.length))
                                    message.paths = [];
                                message.paths.push(reader.string());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a FieldMask message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.FieldMask
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.FieldMask} FieldMask
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                FieldMask.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a FieldMask message.
                 * @function verify
                 * @memberof google.protobuf.FieldMask
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                FieldMask.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.paths != null && message.hasOwnProperty("paths")) {
                        if (!Array.isArray(message.paths))
                            return "paths: array expected";
                        for (var i = 0; i < message.paths.length; ++i)
                            if (!$util.isString(message.paths[i]))
                                return "paths: string[] expected";
                    }
                    return null;
                };
    
                /**
                 * Creates a FieldMask message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.FieldMask
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.FieldMask} FieldMask
                 */
                FieldMask.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.FieldMask)
                        return object;
                    var message = new $root.google.protobuf.FieldMask();
                    if (object.paths) {
                        if (!Array.isArray(object.paths))
                            throw TypeError(".google.protobuf.FieldMask.paths: array expected");
                        message.paths = [];
                        for (var i = 0; i < object.paths.length; ++i)
                            message.paths[i] = String(object.paths[i]);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a FieldMask message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.FieldMask
                 * @static
                 * @param {google.protobuf.FieldMask} message FieldMask
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                FieldMask.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.paths = [];
                    if (message.paths && message.paths.length) {
                        object.paths = [];
                        for (var j = 0; j < message.paths.length; ++j)
                            object.paths[j] = message.paths[j];
                    }
                    return object;
                };
    
                /**
                 * Converts this FieldMask to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.FieldMask
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                FieldMask.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for FieldMask
                 * @function getTypeUrl
                 * @memberof google.protobuf.FieldMask
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.FieldMask";
                };
    
                return FieldMask;
            })();
    
            protobuf.Any = (function() {
    
                /**
                 * Properties of an Any.
                 * @memberof google.protobuf
                 * @interface IAny
                 * @property {string|null} [type_url] Any type_url
                 * @property {Uint8Array|null} [value] Any value
                 */
    
                /**
                 * Constructs a new Any.
                 * @memberof google.protobuf
                 * @classdesc Represents an Any.
                 * @implements IAny
                 * @constructor
                 * @param {google.protobuf.IAny=} [properties] Properties to set
                 */
                function Any(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * Any type_url.
                 * @member {string} type_url
                 * @memberof google.protobuf.Any
                 * @instance
                 */
                Any.prototype.type_url = "";
    
                /**
                 * Any value.
                 * @member {Uint8Array} value
                 * @memberof google.protobuf.Any
                 * @instance
                 */
                Any.prototype.value = $util.newBuffer([]);
    
                /**
                 * Creates a new Any instance using the specified properties.
                 * @function create
                 * @memberof google.protobuf.Any
                 * @static
                 * @param {google.protobuf.IAny=} [properties] Properties to set
                 * @returns {google.protobuf.Any} Any instance
                 */
                Any.create = function create(properties) {
                    return new Any(properties);
                };
    
                /**
                 * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
                 * @function encode
                 * @memberof google.protobuf.Any
                 * @static
                 * @param {google.protobuf.IAny} message Any message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Any.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url);
                    if (message.value != null && Object.hasOwnProperty.call(message, "value"))
                        writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value);
                    return writer;
                };
    
                /**
                 * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.protobuf.Any
                 * @static
                 * @param {google.protobuf.IAny} message Any message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Any.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an Any message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.protobuf.Any
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.protobuf.Any} Any
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Any.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.type_url = reader.string();
                                break;
                            }
                        case 2: {
                                message.value = reader.bytes();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an Any message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.protobuf.Any
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.protobuf.Any} Any
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Any.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an Any message.
                 * @function verify
                 * @memberof google.protobuf.Any
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                Any.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.type_url != null && message.hasOwnProperty("type_url"))
                        if (!$util.isString(message.type_url))
                            return "type_url: string expected";
                    if (message.value != null && message.hasOwnProperty("value"))
                        if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value)))
                            return "value: buffer expected";
                    return null;
                };
    
                /**
                 * Creates an Any message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.protobuf.Any
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.protobuf.Any} Any
                 */
                Any.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.protobuf.Any)
                        return object;
                    var message = new $root.google.protobuf.Any();
                    if (object.type_url != null)
                        message.type_url = String(object.type_url);
                    if (object.value != null)
                        if (typeof object.value === "string")
                            $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);
                        else if (object.value.length >= 0)
                            message.value = object.value;
                    return message;
                };
    
                /**
                 * Creates a plain object from an Any message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.protobuf.Any
                 * @static
                 * @param {google.protobuf.Any} message Any
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                Any.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.type_url = "";
                        if (options.bytes === String)
                            object.value = "";
                        else {
                            object.value = [];
                            if (options.bytes !== Array)
                                object.value = $util.newBuffer(object.value);
                        }
                    }
                    if (message.type_url != null && message.hasOwnProperty("type_url"))
                        object.type_url = message.type_url;
                    if (message.value != null && message.hasOwnProperty("value"))
                        object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value;
                    return object;
                };
    
                /**
                 * Converts this Any to JSON.
                 * @function toJSON
                 * @memberof google.protobuf.Any
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                Any.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for Any
                 * @function getTypeUrl
                 * @memberof google.protobuf.Any
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.protobuf.Any";
                };
    
                return Any;
            })();
    
            return protobuf;
        })();
    
        google.rpc = (function() {
    
            /**
             * Namespace rpc.
             * @memberof google
             * @namespace
             */
            var rpc = {};
    
            rpc.Status = (function() {
    
                /**
                 * Properties of a Status.
                 * @memberof google.rpc
                 * @interface IStatus
                 * @property {number|null} [code] Status code
                 * @property {string|null} [message] Status message
                 * @property {Array.<google.protobuf.IAny>|null} [details] Status details
                 */
    
                /**
                 * Constructs a new Status.
                 * @memberof google.rpc
                 * @classdesc Represents a Status.
                 * @implements IStatus
                 * @constructor
                 * @param {google.rpc.IStatus=} [properties] Properties to set
                 */
                function Status(properties) {
                    this.details = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * Status code.
                 * @member {number} code
                 * @memberof google.rpc.Status
                 * @instance
                 */
                Status.prototype.code = 0;
    
                /**
                 * Status message.
                 * @member {string} message
                 * @memberof google.rpc.Status
                 * @instance
                 */
                Status.prototype.message = "";
    
                /**
                 * Status details.
                 * @member {Array.<google.protobuf.IAny>} details
                 * @memberof google.rpc.Status
                 * @instance
                 */
                Status.prototype.details = $util.emptyArray;
    
                /**
                 * Creates a new Status instance using the specified properties.
                 * @function create
                 * @memberof google.rpc.Status
                 * @static
                 * @param {google.rpc.IStatus=} [properties] Properties to set
                 * @returns {google.rpc.Status} Status instance
                 */
                Status.create = function create(properties) {
                    return new Status(properties);
                };
    
                /**
                 * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages.
                 * @function encode
                 * @memberof google.rpc.Status
                 * @static
                 * @param {google.rpc.IStatus} message Status message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Status.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.code != null && Object.hasOwnProperty.call(message, "code"))
                        writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
                    if (message.message != null && Object.hasOwnProperty.call(message, "message"))
                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.message);
                    if (message.details != null && message.details.length)
                        for (var i = 0; i < message.details.length; ++i)
                            $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.rpc.Status
                 * @static
                 * @param {google.rpc.IStatus} message Status message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Status.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a Status message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.rpc.Status
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.rpc.Status} Status
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Status.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.code = reader.int32();
                                break;
                            }
                        case 2: {
                                message.message = reader.string();
                                break;
                            }
                        case 3: {
                                if (!(message.details && message.details.length))
                                    message.details = [];
                                message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32()));
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a Status message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.rpc.Status
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.rpc.Status} Status
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Status.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a Status message.
                 * @function verify
                 * @memberof google.rpc.Status
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                Status.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.code != null && message.hasOwnProperty("code"))
                        if (!$util.isInteger(message.code))
                            return "code: integer expected";
                    if (message.message != null && message.hasOwnProperty("message"))
                        if (!$util.isString(message.message))
                            return "message: string expected";
                    if (message.details != null && message.hasOwnProperty("details")) {
                        if (!Array.isArray(message.details))
                            return "details: array expected";
                        for (var i = 0; i < message.details.length; ++i) {
                            var error = $root.google.protobuf.Any.verify(message.details[i]);
                            if (error)
                                return "details." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates a Status message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.rpc.Status
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.rpc.Status} Status
                 */
                Status.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.rpc.Status)
                        return object;
                    var message = new $root.google.rpc.Status();
                    if (object.code != null)
                        message.code = object.code | 0;
                    if (object.message != null)
                        message.message = String(object.message);
                    if (object.details) {
                        if (!Array.isArray(object.details))
                            throw TypeError(".google.rpc.Status.details: array expected");
                        message.details = [];
                        for (var i = 0; i < object.details.length; ++i) {
                            if (typeof object.details[i] !== "object")
                                throw TypeError(".google.rpc.Status.details: object expected");
                            message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]);
                        }
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a Status message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.rpc.Status
                 * @static
                 * @param {google.rpc.Status} message Status
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                Status.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.details = [];
                    if (options.defaults) {
                        object.code = 0;
                        object.message = "";
                    }
                    if (message.code != null && message.hasOwnProperty("code"))
                        object.code = message.code;
                    if (message.message != null && message.hasOwnProperty("message"))
                        object.message = message.message;
                    if (message.details && message.details.length) {
                        object.details = [];
                        for (var j = 0; j < message.details.length; ++j)
                            object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options);
                    }
                    return object;
                };
    
                /**
                 * Converts this Status to JSON.
                 * @function toJSON
                 * @memberof google.rpc.Status
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                Status.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for Status
                 * @function getTypeUrl
                 * @memberof google.rpc.Status
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.rpc.Status";
                };
    
                return Status;
            })();
    
            return rpc;
        })();
    
        google.longrunning = (function() {
    
            /**
             * Namespace longrunning.
             * @memberof google
             * @namespace
             */
            var longrunning = {};
    
            longrunning.Operations = (function() {
    
                /**
                 * Constructs a new Operations service.
                 * @memberof google.longrunning
                 * @classdesc Represents an Operations
                 * @extends $protobuf.rpc.Service
                 * @constructor
                 * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                 * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                 * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                 */
                function Operations(rpcImpl, requestDelimited, responseDelimited) {
                    $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
                }
    
                (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations;
    
                /**
                 * Creates new Operations service using the specified rpc implementation.
                 * @function create
                 * @memberof google.longrunning.Operations
                 * @static
                 * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
                 * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
                 * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
                 * @returns {Operations} RPC service. Useful where requests and/or responses are streamed.
                 */
                Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) {
                    return new this(rpcImpl, requestDelimited, responseDelimited);
                };
    
                /**
                 * Callback as used by {@link google.longrunning.Operations|listOperations}.
                 * @memberof google.longrunning.Operations
                 * @typedef ListOperationsCallback
                 * @type {function}
                 * @param {Error|null} error Error, if any
                 * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse
                 */
    
                /**
                 * Calls ListOperations.
                 * @function listOperations
                 * @memberof google.longrunning.Operations
                 * @instance
                 * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object
                 * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse
                 * @returns {undefined}
                 * @variation 1
                 */
                Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) {
                    return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback);
                }, "name", { value: "ListOperations" });
    
                /**
                 * Calls ListOperations.
                 * @function listOperations
                 * @memberof google.longrunning.Operations
                 * @instance
                 * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object
                 * @returns {Promise<google.longrunning.ListOperationsResponse>} Promise
                 * @variation 2
                 */
    
                /**
                 * Callback as used by {@link google.longrunning.Operations|getOperation}.
                 * @memberof google.longrunning.Operations
                 * @typedef GetOperationCallback
                 * @type {function}
                 * @param {Error|null} error Error, if any
                 * @param {google.longrunning.Operation} [response] Operation
                 */
    
                /**
                 * Calls GetOperation.
                 * @function getOperation
                 * @memberof google.longrunning.Operations
                 * @instance
                 * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object
                 * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation
                 * @returns {undefined}
                 * @variation 1
                 */
                Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) {
                    return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback);
                }, "name", { value: "GetOperation" });
    
                /**
                 * Calls GetOperation.
                 * @function getOperation
                 * @memberof google.longrunning.Operations
                 * @instance
                 * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object
                 * @returns {Promise<google.longrunning.Operation>} Promise
                 * @variation 2
                 */
    
                /**
                 * Callback as used by {@link google.longrunning.Operations|deleteOperation}.
                 * @memberof google.longrunning.Operations
                 * @typedef DeleteOperationCallback
                 * @type {function}
                 * @param {Error|null} error Error, if any
                 * @param {google.protobuf.Empty} [response] Empty
                 */
    
                /**
                 * Calls DeleteOperation.
                 * @function deleteOperation
                 * @memberof google.longrunning.Operations
                 * @instance
                 * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object
                 * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty
                 * @returns {undefined}
                 * @variation 1
                 */
                Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) {
                    return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback);
                }, "name", { value: "DeleteOperation" });
    
                /**
                 * Calls DeleteOperation.
                 * @function deleteOperation
                 * @memberof google.longrunning.Operations
                 * @instance
                 * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object
                 * @returns {Promise<google.protobuf.Empty>} Promise
                 * @variation 2
                 */
    
                /**
                 * Callback as used by {@link google.longrunning.Operations|cancelOperation}.
                 * @memberof google.longrunning.Operations
                 * @typedef CancelOperationCallback
                 * @type {function}
                 * @param {Error|null} error Error, if any
                 * @param {google.protobuf.Empty} [response] Empty
                 */
    
                /**
                 * Calls CancelOperation.
                 * @function cancelOperation
                 * @memberof google.longrunning.Operations
                 * @instance
                 * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object
                 * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty
                 * @returns {undefined}
                 * @variation 1
                 */
                Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) {
                    return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback);
                }, "name", { value: "CancelOperation" });
    
                /**
                 * Calls CancelOperation.
                 * @function cancelOperation
                 * @memberof google.longrunning.Operations
                 * @instance
                 * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object
                 * @returns {Promise<google.protobuf.Empty>} Promise
                 * @variation 2
                 */
    
                /**
                 * Callback as used by {@link google.longrunning.Operations|waitOperation}.
                 * @memberof google.longrunning.Operations
                 * @typedef WaitOperationCallback
                 * @type {function}
                 * @param {Error|null} error Error, if any
                 * @param {google.longrunning.Operation} [response] Operation
                 */
    
                /**
                 * Calls WaitOperation.
                 * @function waitOperation
                 * @memberof google.longrunning.Operations
                 * @instance
                 * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object
                 * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation
                 * @returns {undefined}
                 * @variation 1
                 */
                Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) {
                    return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback);
                }, "name", { value: "WaitOperation" });
    
                /**
                 * Calls WaitOperation.
                 * @function waitOperation
                 * @memberof google.longrunning.Operations
                 * @instance
                 * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object
                 * @returns {Promise<google.longrunning.Operation>} Promise
                 * @variation 2
                 */
    
                return Operations;
            })();
    
            longrunning.Operation = (function() {
    
                /**
                 * Properties of an Operation.
                 * @memberof google.longrunning
                 * @interface IOperation
                 * @property {string|null} [name] Operation name
                 * @property {google.protobuf.IAny|null} [metadata] Operation metadata
                 * @property {boolean|null} [done] Operation done
                 * @property {google.rpc.IStatus|null} [error] Operation error
                 * @property {google.protobuf.IAny|null} [response] Operation response
                 */
    
                /**
                 * Constructs a new Operation.
                 * @memberof google.longrunning
                 * @classdesc Represents an Operation.
                 * @implements IOperation
                 * @constructor
                 * @param {google.longrunning.IOperation=} [properties] Properties to set
                 */
                function Operation(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * Operation name.
                 * @member {string} name
                 * @memberof google.longrunning.Operation
                 * @instance
                 */
                Operation.prototype.name = "";
    
                /**
                 * Operation metadata.
                 * @member {google.protobuf.IAny|null|undefined} metadata
                 * @memberof google.longrunning.Operation
                 * @instance
                 */
                Operation.prototype.metadata = null;
    
                /**
                 * Operation done.
                 * @member {boolean} done
                 * @memberof google.longrunning.Operation
                 * @instance
                 */
                Operation.prototype.done = false;
    
                /**
                 * Operation error.
                 * @member {google.rpc.IStatus|null|undefined} error
                 * @memberof google.longrunning.Operation
                 * @instance
                 */
                Operation.prototype.error = null;
    
                /**
                 * Operation response.
                 * @member {google.protobuf.IAny|null|undefined} response
                 * @memberof google.longrunning.Operation
                 * @instance
                 */
                Operation.prototype.response = null;
    
                // OneOf field names bound to virtual getters and setters
                var $oneOfFields;
    
                /**
                 * Operation result.
                 * @member {"error"|"response"|undefined} result
                 * @memberof google.longrunning.Operation
                 * @instance
                 */
                Object.defineProperty(Operation.prototype, "result", {
                    get: $util.oneOfGetter($oneOfFields = ["error", "response"]),
                    set: $util.oneOfSetter($oneOfFields)
                });
    
                /**
                 * Creates a new Operation instance using the specified properties.
                 * @function create
                 * @memberof google.longrunning.Operation
                 * @static
                 * @param {google.longrunning.IOperation=} [properties] Properties to set
                 * @returns {google.longrunning.Operation} Operation instance
                 */
                Operation.create = function create(properties) {
                    return new Operation(properties);
                };
    
                /**
                 * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages.
                 * @function encode
                 * @memberof google.longrunning.Operation
                 * @static
                 * @param {google.longrunning.IOperation} message Operation message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Operation.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
                        $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                    if (message.done != null && Object.hasOwnProperty.call(message, "done"))
                        writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done);
                    if (message.error != null && Object.hasOwnProperty.call(message, "error"))
                        $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
                    if (message.response != null && Object.hasOwnProperty.call(message, "response"))
                        $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.longrunning.Operation
                 * @static
                 * @param {google.longrunning.IOperation} message Operation message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                Operation.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an Operation message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.longrunning.Operation
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.longrunning.Operation} Operation
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Operation.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        case 2: {
                                message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32());
                                break;
                            }
                        case 3: {
                                message.done = reader.bool();
                                break;
                            }
                        case 4: {
                                message.error = $root.google.rpc.Status.decode(reader, reader.uint32());
                                break;
                            }
                        case 5: {
                                message.response = $root.google.protobuf.Any.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an Operation message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.longrunning.Operation
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.longrunning.Operation} Operation
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                Operation.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an Operation message.
                 * @function verify
                 * @memberof google.longrunning.Operation
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                Operation.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    var properties = {};
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    if (message.metadata != null && message.hasOwnProperty("metadata")) {
                        var error = $root.google.protobuf.Any.verify(message.metadata);
                        if (error)
                            return "metadata." + error;
                    }
                    if (message.done != null && message.hasOwnProperty("done"))
                        if (typeof message.done !== "boolean")
                            return "done: boolean expected";
                    if (message.error != null && message.hasOwnProperty("error")) {
                        properties.result = 1;
                        {
                            var error = $root.google.rpc.Status.verify(message.error);
                            if (error)
                                return "error." + error;
                        }
                    }
                    if (message.response != null && message.hasOwnProperty("response")) {
                        if (properties.result === 1)
                            return "result: multiple values";
                        properties.result = 1;
                        {
                            var error = $root.google.protobuf.Any.verify(message.response);
                            if (error)
                                return "response." + error;
                        }
                    }
                    return null;
                };
    
                /**
                 * Creates an Operation message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.longrunning.Operation
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.longrunning.Operation} Operation
                 */
                Operation.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.longrunning.Operation)
                        return object;
                    var message = new $root.google.longrunning.Operation();
                    if (object.name != null)
                        message.name = String(object.name);
                    if (object.metadata != null) {
                        if (typeof object.metadata !== "object")
                            throw TypeError(".google.longrunning.Operation.metadata: object expected");
                        message.metadata = $root.google.protobuf.Any.fromObject(object.metadata);
                    }
                    if (object.done != null)
                        message.done = Boolean(object.done);
                    if (object.error != null) {
                        if (typeof object.error !== "object")
                            throw TypeError(".google.longrunning.Operation.error: object expected");
                        message.error = $root.google.rpc.Status.fromObject(object.error);
                    }
                    if (object.response != null) {
                        if (typeof object.response !== "object")
                            throw TypeError(".google.longrunning.Operation.response: object expected");
                        message.response = $root.google.protobuf.Any.fromObject(object.response);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from an Operation message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.longrunning.Operation
                 * @static
                 * @param {google.longrunning.Operation} message Operation
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                Operation.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.name = "";
                        object.metadata = null;
                        object.done = false;
                    }
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    if (message.metadata != null && message.hasOwnProperty("metadata"))
                        object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options);
                    if (message.done != null && message.hasOwnProperty("done"))
                        object.done = message.done;
                    if (message.error != null && message.hasOwnProperty("error")) {
                        object.error = $root.google.rpc.Status.toObject(message.error, options);
                        if (options.oneofs)
                            object.result = "error";
                    }
                    if (message.response != null && message.hasOwnProperty("response")) {
                        object.response = $root.google.protobuf.Any.toObject(message.response, options);
                        if (options.oneofs)
                            object.result = "response";
                    }
                    return object;
                };
    
                /**
                 * Converts this Operation to JSON.
                 * @function toJSON
                 * @memberof google.longrunning.Operation
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                Operation.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for Operation
                 * @function getTypeUrl
                 * @memberof google.longrunning.Operation
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.longrunning.Operation";
                };
    
                return Operation;
            })();
    
            longrunning.GetOperationRequest = (function() {
    
                /**
                 * Properties of a GetOperationRequest.
                 * @memberof google.longrunning
                 * @interface IGetOperationRequest
                 * @property {string|null} [name] GetOperationRequest name
                 */
    
                /**
                 * Constructs a new GetOperationRequest.
                 * @memberof google.longrunning
                 * @classdesc Represents a GetOperationRequest.
                 * @implements IGetOperationRequest
                 * @constructor
                 * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set
                 */
                function GetOperationRequest(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * GetOperationRequest name.
                 * @member {string} name
                 * @memberof google.longrunning.GetOperationRequest
                 * @instance
                 */
                GetOperationRequest.prototype.name = "";
    
                /**
                 * Creates a new GetOperationRequest instance using the specified properties.
                 * @function create
                 * @memberof google.longrunning.GetOperationRequest
                 * @static
                 * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set
                 * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance
                 */
                GetOperationRequest.create = function create(properties) {
                    return new GetOperationRequest(properties);
                };
    
                /**
                 * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages.
                 * @function encode
                 * @memberof google.longrunning.GetOperationRequest
                 * @static
                 * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                GetOperationRequest.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    return writer;
                };
    
                /**
                 * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.longrunning.GetOperationRequest
                 * @static
                 * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a GetOperationRequest message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.longrunning.GetOperationRequest
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.longrunning.GetOperationRequest} GetOperationRequest
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                GetOperationRequest.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.longrunning.GetOperationRequest
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.longrunning.GetOperationRequest} GetOperationRequest
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                GetOperationRequest.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a GetOperationRequest message.
                 * @function verify
                 * @memberof google.longrunning.GetOperationRequest
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                GetOperationRequest.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    return null;
                };
    
                /**
                 * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.longrunning.GetOperationRequest
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.longrunning.GetOperationRequest} GetOperationRequest
                 */
                GetOperationRequest.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.longrunning.GetOperationRequest)
                        return object;
                    var message = new $root.google.longrunning.GetOperationRequest();
                    if (object.name != null)
                        message.name = String(object.name);
                    return message;
                };
    
                /**
                 * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.longrunning.GetOperationRequest
                 * @static
                 * @param {google.longrunning.GetOperationRequest} message GetOperationRequest
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                GetOperationRequest.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults)
                        object.name = "";
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    return object;
                };
    
                /**
                 * Converts this GetOperationRequest to JSON.
                 * @function toJSON
                 * @memberof google.longrunning.GetOperationRequest
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                GetOperationRequest.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for GetOperationRequest
                 * @function getTypeUrl
                 * @memberof google.longrunning.GetOperationRequest
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.longrunning.GetOperationRequest";
                };
    
                return GetOperationRequest;
            })();
    
            longrunning.ListOperationsRequest = (function() {
    
                /**
                 * Properties of a ListOperationsRequest.
                 * @memberof google.longrunning
                 * @interface IListOperationsRequest
                 * @property {string|null} [name] ListOperationsRequest name
                 * @property {string|null} [filter] ListOperationsRequest filter
                 * @property {number|null} [pageSize] ListOperationsRequest pageSize
                 * @property {string|null} [pageToken] ListOperationsRequest pageToken
                 */
    
                /**
                 * Constructs a new ListOperationsRequest.
                 * @memberof google.longrunning
                 * @classdesc Represents a ListOperationsRequest.
                 * @implements IListOperationsRequest
                 * @constructor
                 * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set
                 */
                function ListOperationsRequest(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * ListOperationsRequest name.
                 * @member {string} name
                 * @memberof google.longrunning.ListOperationsRequest
                 * @instance
                 */
                ListOperationsRequest.prototype.name = "";
    
                /**
                 * ListOperationsRequest filter.
                 * @member {string} filter
                 * @memberof google.longrunning.ListOperationsRequest
                 * @instance
                 */
                ListOperationsRequest.prototype.filter = "";
    
                /**
                 * ListOperationsRequest pageSize.
                 * @member {number} pageSize
                 * @memberof google.longrunning.ListOperationsRequest
                 * @instance
                 */
                ListOperationsRequest.prototype.pageSize = 0;
    
                /**
                 * ListOperationsRequest pageToken.
                 * @member {string} pageToken
                 * @memberof google.longrunning.ListOperationsRequest
                 * @instance
                 */
                ListOperationsRequest.prototype.pageToken = "";
    
                /**
                 * Creates a new ListOperationsRequest instance using the specified properties.
                 * @function create
                 * @memberof google.longrunning.ListOperationsRequest
                 * @static
                 * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set
                 * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance
                 */
                ListOperationsRequest.create = function create(properties) {
                    return new ListOperationsRequest(properties);
                };
    
                /**
                 * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages.
                 * @function encode
                 * @memberof google.longrunning.ListOperationsRequest
                 * @static
                 * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ListOperationsRequest.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.filter != null && Object.hasOwnProperty.call(message, "filter"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter);
                    if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
                        writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
                    if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
                        writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 4, wireType 2 =*/34).string(message.name);
                    return writer;
                };
    
                /**
                 * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.longrunning.ListOperationsRequest
                 * @static
                 * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a ListOperationsRequest message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.longrunning.ListOperationsRequest
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ListOperationsRequest.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 4: {
                                message.name = reader.string();
                                break;
                            }
                        case 1: {
                                message.filter = reader.string();
                                break;
                            }
                        case 2: {
                                message.pageSize = reader.int32();
                                break;
                            }
                        case 3: {
                                message.pageToken = reader.string();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.longrunning.ListOperationsRequest
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a ListOperationsRequest message.
                 * @function verify
                 * @memberof google.longrunning.ListOperationsRequest
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                ListOperationsRequest.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    if (message.filter != null && message.hasOwnProperty("filter"))
                        if (!$util.isString(message.filter))
                            return "filter: string expected";
                    if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                        if (!$util.isInteger(message.pageSize))
                            return "pageSize: integer expected";
                    if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                        if (!$util.isString(message.pageToken))
                            return "pageToken: string expected";
                    return null;
                };
    
                /**
                 * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.longrunning.ListOperationsRequest
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest
                 */
                ListOperationsRequest.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.longrunning.ListOperationsRequest)
                        return object;
                    var message = new $root.google.longrunning.ListOperationsRequest();
                    if (object.name != null)
                        message.name = String(object.name);
                    if (object.filter != null)
                        message.filter = String(object.filter);
                    if (object.pageSize != null)
                        message.pageSize = object.pageSize | 0;
                    if (object.pageToken != null)
                        message.pageToken = String(object.pageToken);
                    return message;
                };
    
                /**
                 * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.longrunning.ListOperationsRequest
                 * @static
                 * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                ListOperationsRequest.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.filter = "";
                        object.pageSize = 0;
                        object.pageToken = "";
                        object.name = "";
                    }
                    if (message.filter != null && message.hasOwnProperty("filter"))
                        object.filter = message.filter;
                    if (message.pageSize != null && message.hasOwnProperty("pageSize"))
                        object.pageSize = message.pageSize;
                    if (message.pageToken != null && message.hasOwnProperty("pageToken"))
                        object.pageToken = message.pageToken;
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    return object;
                };
    
                /**
                 * Converts this ListOperationsRequest to JSON.
                 * @function toJSON
                 * @memberof google.longrunning.ListOperationsRequest
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                ListOperationsRequest.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for ListOperationsRequest
                 * @function getTypeUrl
                 * @memberof google.longrunning.ListOperationsRequest
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.longrunning.ListOperationsRequest";
                };
    
                return ListOperationsRequest;
            })();
    
            longrunning.ListOperationsResponse = (function() {
    
                /**
                 * Properties of a ListOperationsResponse.
                 * @memberof google.longrunning
                 * @interface IListOperationsResponse
                 * @property {Array.<google.longrunning.IOperation>|null} [operations] ListOperationsResponse operations
                 * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken
                 */
    
                /**
                 * Constructs a new ListOperationsResponse.
                 * @memberof google.longrunning
                 * @classdesc Represents a ListOperationsResponse.
                 * @implements IListOperationsResponse
                 * @constructor
                 * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set
                 */
                function ListOperationsResponse(properties) {
                    this.operations = [];
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * ListOperationsResponse operations.
                 * @member {Array.<google.longrunning.IOperation>} operations
                 * @memberof google.longrunning.ListOperationsResponse
                 * @instance
                 */
                ListOperationsResponse.prototype.operations = $util.emptyArray;
    
                /**
                 * ListOperationsResponse nextPageToken.
                 * @member {string} nextPageToken
                 * @memberof google.longrunning.ListOperationsResponse
                 * @instance
                 */
                ListOperationsResponse.prototype.nextPageToken = "";
    
                /**
                 * Creates a new ListOperationsResponse instance using the specified properties.
                 * @function create
                 * @memberof google.longrunning.ListOperationsResponse
                 * @static
                 * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set
                 * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance
                 */
                ListOperationsResponse.create = function create(properties) {
                    return new ListOperationsResponse(properties);
                };
    
                /**
                 * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages.
                 * @function encode
                 * @memberof google.longrunning.ListOperationsResponse
                 * @static
                 * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ListOperationsResponse.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.operations != null && message.operations.length)
                        for (var i = 0; i < message.operations.length; ++i)
                            $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                    if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
                    return writer;
                };
    
                /**
                 * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.longrunning.ListOperationsResponse
                 * @static
                 * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a ListOperationsResponse message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.longrunning.ListOperationsResponse
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ListOperationsResponse.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                if (!(message.operations && message.operations.length))
                                    message.operations = [];
                                message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32()));
                                break;
                            }
                        case 2: {
                                message.nextPageToken = reader.string();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.longrunning.ListOperationsResponse
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a ListOperationsResponse message.
                 * @function verify
                 * @memberof google.longrunning.ListOperationsResponse
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                ListOperationsResponse.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.operations != null && message.hasOwnProperty("operations")) {
                        if (!Array.isArray(message.operations))
                            return "operations: array expected";
                        for (var i = 0; i < message.operations.length; ++i) {
                            var error = $root.google.longrunning.Operation.verify(message.operations[i]);
                            if (error)
                                return "operations." + error;
                        }
                    }
                    if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                        if (!$util.isString(message.nextPageToken))
                            return "nextPageToken: string expected";
                    return null;
                };
    
                /**
                 * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.longrunning.ListOperationsResponse
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse
                 */
                ListOperationsResponse.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.longrunning.ListOperationsResponse)
                        return object;
                    var message = new $root.google.longrunning.ListOperationsResponse();
                    if (object.operations) {
                        if (!Array.isArray(object.operations))
                            throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected");
                        message.operations = [];
                        for (var i = 0; i < object.operations.length; ++i) {
                            if (typeof object.operations[i] !== "object")
                                throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected");
                            message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]);
                        }
                    }
                    if (object.nextPageToken != null)
                        message.nextPageToken = String(object.nextPageToken);
                    return message;
                };
    
                /**
                 * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.longrunning.ListOperationsResponse
                 * @static
                 * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                ListOperationsResponse.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.arrays || options.defaults)
                        object.operations = [];
                    if (options.defaults)
                        object.nextPageToken = "";
                    if (message.operations && message.operations.length) {
                        object.operations = [];
                        for (var j = 0; j < message.operations.length; ++j)
                            object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options);
                    }
                    if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
                        object.nextPageToken = message.nextPageToken;
                    return object;
                };
    
                /**
                 * Converts this ListOperationsResponse to JSON.
                 * @function toJSON
                 * @memberof google.longrunning.ListOperationsResponse
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                ListOperationsResponse.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for ListOperationsResponse
                 * @function getTypeUrl
                 * @memberof google.longrunning.ListOperationsResponse
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.longrunning.ListOperationsResponse";
                };
    
                return ListOperationsResponse;
            })();
    
            longrunning.CancelOperationRequest = (function() {
    
                /**
                 * Properties of a CancelOperationRequest.
                 * @memberof google.longrunning
                 * @interface ICancelOperationRequest
                 * @property {string|null} [name] CancelOperationRequest name
                 */
    
                /**
                 * Constructs a new CancelOperationRequest.
                 * @memberof google.longrunning
                 * @classdesc Represents a CancelOperationRequest.
                 * @implements ICancelOperationRequest
                 * @constructor
                 * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set
                 */
                function CancelOperationRequest(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * CancelOperationRequest name.
                 * @member {string} name
                 * @memberof google.longrunning.CancelOperationRequest
                 * @instance
                 */
                CancelOperationRequest.prototype.name = "";
    
                /**
                 * Creates a new CancelOperationRequest instance using the specified properties.
                 * @function create
                 * @memberof google.longrunning.CancelOperationRequest
                 * @static
                 * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set
                 * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance
                 */
                CancelOperationRequest.create = function create(properties) {
                    return new CancelOperationRequest(properties);
                };
    
                /**
                 * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages.
                 * @function encode
                 * @memberof google.longrunning.CancelOperationRequest
                 * @static
                 * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                CancelOperationRequest.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    return writer;
                };
    
                /**
                 * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.longrunning.CancelOperationRequest
                 * @static
                 * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a CancelOperationRequest message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.longrunning.CancelOperationRequest
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                CancelOperationRequest.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.longrunning.CancelOperationRequest
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a CancelOperationRequest message.
                 * @function verify
                 * @memberof google.longrunning.CancelOperationRequest
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                CancelOperationRequest.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    return null;
                };
    
                /**
                 * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.longrunning.CancelOperationRequest
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest
                 */
                CancelOperationRequest.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.longrunning.CancelOperationRequest)
                        return object;
                    var message = new $root.google.longrunning.CancelOperationRequest();
                    if (object.name != null)
                        message.name = String(object.name);
                    return message;
                };
    
                /**
                 * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.longrunning.CancelOperationRequest
                 * @static
                 * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                CancelOperationRequest.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults)
                        object.name = "";
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    return object;
                };
    
                /**
                 * Converts this CancelOperationRequest to JSON.
                 * @function toJSON
                 * @memberof google.longrunning.CancelOperationRequest
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                CancelOperationRequest.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for CancelOperationRequest
                 * @function getTypeUrl
                 * @memberof google.longrunning.CancelOperationRequest
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.longrunning.CancelOperationRequest";
                };
    
                return CancelOperationRequest;
            })();
    
            longrunning.DeleteOperationRequest = (function() {
    
                /**
                 * Properties of a DeleteOperationRequest.
                 * @memberof google.longrunning
                 * @interface IDeleteOperationRequest
                 * @property {string|null} [name] DeleteOperationRequest name
                 */
    
                /**
                 * Constructs a new DeleteOperationRequest.
                 * @memberof google.longrunning
                 * @classdesc Represents a DeleteOperationRequest.
                 * @implements IDeleteOperationRequest
                 * @constructor
                 * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set
                 */
                function DeleteOperationRequest(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * DeleteOperationRequest name.
                 * @member {string} name
                 * @memberof google.longrunning.DeleteOperationRequest
                 * @instance
                 */
                DeleteOperationRequest.prototype.name = "";
    
                /**
                 * Creates a new DeleteOperationRequest instance using the specified properties.
                 * @function create
                 * @memberof google.longrunning.DeleteOperationRequest
                 * @static
                 * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set
                 * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance
                 */
                DeleteOperationRequest.create = function create(properties) {
                    return new DeleteOperationRequest(properties);
                };
    
                /**
                 * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages.
                 * @function encode
                 * @memberof google.longrunning.DeleteOperationRequest
                 * @static
                 * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                DeleteOperationRequest.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    return writer;
                };
    
                /**
                 * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.longrunning.DeleteOperationRequest
                 * @static
                 * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a DeleteOperationRequest message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.longrunning.DeleteOperationRequest
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                DeleteOperationRequest.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.longrunning.DeleteOperationRequest
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a DeleteOperationRequest message.
                 * @function verify
                 * @memberof google.longrunning.DeleteOperationRequest
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                DeleteOperationRequest.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    return null;
                };
    
                /**
                 * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.longrunning.DeleteOperationRequest
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest
                 */
                DeleteOperationRequest.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.longrunning.DeleteOperationRequest)
                        return object;
                    var message = new $root.google.longrunning.DeleteOperationRequest();
                    if (object.name != null)
                        message.name = String(object.name);
                    return message;
                };
    
                /**
                 * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.longrunning.DeleteOperationRequest
                 * @static
                 * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                DeleteOperationRequest.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults)
                        object.name = "";
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    return object;
                };
    
                /**
                 * Converts this DeleteOperationRequest to JSON.
                 * @function toJSON
                 * @memberof google.longrunning.DeleteOperationRequest
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                DeleteOperationRequest.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for DeleteOperationRequest
                 * @function getTypeUrl
                 * @memberof google.longrunning.DeleteOperationRequest
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest";
                };
    
                return DeleteOperationRequest;
            })();
    
            longrunning.WaitOperationRequest = (function() {
    
                /**
                 * Properties of a WaitOperationRequest.
                 * @memberof google.longrunning
                 * @interface IWaitOperationRequest
                 * @property {string|null} [name] WaitOperationRequest name
                 * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout
                 */
    
                /**
                 * Constructs a new WaitOperationRequest.
                 * @memberof google.longrunning
                 * @classdesc Represents a WaitOperationRequest.
                 * @implements IWaitOperationRequest
                 * @constructor
                 * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set
                 */
                function WaitOperationRequest(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * WaitOperationRequest name.
                 * @member {string} name
                 * @memberof google.longrunning.WaitOperationRequest
                 * @instance
                 */
                WaitOperationRequest.prototype.name = "";
    
                /**
                 * WaitOperationRequest timeout.
                 * @member {google.protobuf.IDuration|null|undefined} timeout
                 * @memberof google.longrunning.WaitOperationRequest
                 * @instance
                 */
                WaitOperationRequest.prototype.timeout = null;
    
                /**
                 * Creates a new WaitOperationRequest instance using the specified properties.
                 * @function create
                 * @memberof google.longrunning.WaitOperationRequest
                 * @static
                 * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set
                 * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance
                 */
                WaitOperationRequest.create = function create(properties) {
                    return new WaitOperationRequest(properties);
                };
    
                /**
                 * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages.
                 * @function encode
                 * @memberof google.longrunning.WaitOperationRequest
                 * @static
                 * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                WaitOperationRequest.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
                    if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout"))
                        $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
                    return writer;
                };
    
                /**
                 * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.longrunning.WaitOperationRequest
                 * @static
                 * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes a WaitOperationRequest message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.longrunning.WaitOperationRequest
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                WaitOperationRequest.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.name = reader.string();
                                break;
                            }
                        case 2: {
                                message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32());
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.longrunning.WaitOperationRequest
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies a WaitOperationRequest message.
                 * @function verify
                 * @memberof google.longrunning.WaitOperationRequest
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                WaitOperationRequest.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.name != null && message.hasOwnProperty("name"))
                        if (!$util.isString(message.name))
                            return "name: string expected";
                    if (message.timeout != null && message.hasOwnProperty("timeout")) {
                        var error = $root.google.protobuf.Duration.verify(message.timeout);
                        if (error)
                            return "timeout." + error;
                    }
                    return null;
                };
    
                /**
                 * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.longrunning.WaitOperationRequest
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest
                 */
                WaitOperationRequest.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.longrunning.WaitOperationRequest)
                        return object;
                    var message = new $root.google.longrunning.WaitOperationRequest();
                    if (object.name != null)
                        message.name = String(object.name);
                    if (object.timeout != null) {
                        if (typeof object.timeout !== "object")
                            throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected");
                        message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout);
                    }
                    return message;
                };
    
                /**
                 * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.longrunning.WaitOperationRequest
                 * @static
                 * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                WaitOperationRequest.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.name = "";
                        object.timeout = null;
                    }
                    if (message.name != null && message.hasOwnProperty("name"))
                        object.name = message.name;
                    if (message.timeout != null && message.hasOwnProperty("timeout"))
                        object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options);
                    return object;
                };
    
                /**
                 * Converts this WaitOperationRequest to JSON.
                 * @function toJSON
                 * @memberof google.longrunning.WaitOperationRequest
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                WaitOperationRequest.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for WaitOperationRequest
                 * @function getTypeUrl
                 * @memberof google.longrunning.WaitOperationRequest
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.longrunning.WaitOperationRequest";
                };
    
                return WaitOperationRequest;
            })();
    
            longrunning.OperationInfo = (function() {
    
                /**
                 * Properties of an OperationInfo.
                 * @memberof google.longrunning
                 * @interface IOperationInfo
                 * @property {string|null} [responseType] OperationInfo responseType
                 * @property {string|null} [metadataType] OperationInfo metadataType
                 */
    
                /**
                 * Constructs a new OperationInfo.
                 * @memberof google.longrunning
                 * @classdesc Represents an OperationInfo.
                 * @implements IOperationInfo
                 * @constructor
                 * @param {google.longrunning.IOperationInfo=} [properties] Properties to set
                 */
                function OperationInfo(properties) {
                    if (properties)
                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                            if (properties[keys[i]] != null)
                                this[keys[i]] = properties[keys[i]];
                }
    
                /**
                 * OperationInfo responseType.
                 * @member {string} responseType
                 * @memberof google.longrunning.OperationInfo
                 * @instance
                 */
                OperationInfo.prototype.responseType = "";
    
                /**
                 * OperationInfo metadataType.
                 * @member {string} metadataType
                 * @memberof google.longrunning.OperationInfo
                 * @instance
                 */
                OperationInfo.prototype.metadataType = "";
    
                /**
                 * Creates a new OperationInfo instance using the specified properties.
                 * @function create
                 * @memberof google.longrunning.OperationInfo
                 * @static
                 * @param {google.longrunning.IOperationInfo=} [properties] Properties to set
                 * @returns {google.longrunning.OperationInfo} OperationInfo instance
                 */
                OperationInfo.create = function create(properties) {
                    return new OperationInfo(properties);
                };
    
                /**
                 * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages.
                 * @function encode
                 * @memberof google.longrunning.OperationInfo
                 * @static
                 * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                OperationInfo.encode = function encode(message, writer) {
                    if (!writer)
                        writer = $Writer.create();
                    if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType"))
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType);
                    if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType"))
                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType);
                    return writer;
                };
    
                /**
                 * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages.
                 * @function encodeDelimited
                 * @memberof google.longrunning.OperationInfo
                 * @static
                 * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode
                 * @param {$protobuf.Writer} [writer] Writer to encode to
                 * @returns {$protobuf.Writer} Writer
                 */
                OperationInfo.encodeDelimited = function encodeDelimited(message, writer) {
                    return this.encode(message, writer).ldelim();
                };
    
                /**
                 * Decodes an OperationInfo message from the specified reader or buffer.
                 * @function decode
                 * @memberof google.longrunning.OperationInfo
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @param {number} [length] Message length if known beforehand
                 * @returns {google.longrunning.OperationInfo} OperationInfo
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                OperationInfo.decode = function decode(reader, length) {
                    if (!(reader instanceof $Reader))
                        reader = $Reader.create(reader);
                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo();
                    while (reader.pos < end) {
                        var tag = reader.uint32();
                        switch (tag >>> 3) {
                        case 1: {
                                message.responseType = reader.string();
                                break;
                            }
                        case 2: {
                                message.metadataType = reader.string();
                                break;
                            }
                        default:
                            reader.skipType(tag & 7);
                            break;
                        }
                    }
                    return message;
                };
    
                /**
                 * Decodes an OperationInfo message from the specified reader or buffer, length delimited.
                 * @function decodeDelimited
                 * @memberof google.longrunning.OperationInfo
                 * @static
                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                 * @returns {google.longrunning.OperationInfo} OperationInfo
                 * @throws {Error} If the payload is not a reader or valid buffer
                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
                 */
                OperationInfo.decodeDelimited = function decodeDelimited(reader) {
                    if (!(reader instanceof $Reader))
                        reader = new $Reader(reader);
                    return this.decode(reader, reader.uint32());
                };
    
                /**
                 * Verifies an OperationInfo message.
                 * @function verify
                 * @memberof google.longrunning.OperationInfo
                 * @static
                 * @param {Object.<string,*>} message Plain object to verify
                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
                 */
                OperationInfo.verify = function verify(message) {
                    if (typeof message !== "object" || message === null)
                        return "object expected";
                    if (message.responseType != null && message.hasOwnProperty("responseType"))
                        if (!$util.isString(message.responseType))
                            return "responseType: string expected";
                    if (message.metadataType != null && message.hasOwnProperty("metadataType"))
                        if (!$util.isString(message.metadataType))
                            return "metadataType: string expected";
                    return null;
                };
    
                /**
                 * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types.
                 * @function fromObject
                 * @memberof google.longrunning.OperationInfo
                 * @static
                 * @param {Object.<string,*>} object Plain object
                 * @returns {google.longrunning.OperationInfo} OperationInfo
                 */
                OperationInfo.fromObject = function fromObject(object) {
                    if (object instanceof $root.google.longrunning.OperationInfo)
                        return object;
                    var message = new $root.google.longrunning.OperationInfo();
                    if (object.responseType != null)
                        message.responseType = String(object.responseType);
                    if (object.metadataType != null)
                        message.metadataType = String(object.metadataType);
                    return message;
                };
    
                /**
                 * Creates a plain object from an OperationInfo message. Also converts values to other types if specified.
                 * @function toObject
                 * @memberof google.longrunning.OperationInfo
                 * @static
                 * @param {google.longrunning.OperationInfo} message OperationInfo
                 * @param {$protobuf.IConversionOptions} [options] Conversion options
                 * @returns {Object.<string,*>} Plain object
                 */
                OperationInfo.toObject = function toObject(message, options) {
                    if (!options)
                        options = {};
                    var object = {};
                    if (options.defaults) {
                        object.responseType = "";
                        object.metadataType = "";
                    }
                    if (message.responseType != null && message.hasOwnProperty("responseType"))
                        object.responseType = message.responseType;
                    if (message.metadataType != null && message.hasOwnProperty("metadataType"))
                        object.metadataType = message.metadataType;
                    return object;
                };
    
                /**
                 * Converts this OperationInfo to JSON.
                 * @function toJSON
                 * @memberof google.longrunning.OperationInfo
                 * @instance
                 * @returns {Object.<string,*>} JSON object
                 */
                OperationInfo.prototype.toJSON = function toJSON() {
                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
                };
    
                /**
                 * Gets the default type url for OperationInfo
                 * @function getTypeUrl
                 * @memberof google.longrunning.OperationInfo
                 * @static
                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
                 * @returns {string} The default type url
                 */
                OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                    if (typeUrlPrefix === undefined) {
                        typeUrlPrefix = "type.googleapis.com";
                    }
                    return typeUrlPrefix + "/google.longrunning.OperationInfo";
                };
    
                return OperationInfo;
            })();
    
            return longrunning;
        })();
    
        return google;
    })();

    return $root;
});
